Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replaces deprecated CreateGlobalStringPtr with CreateGlobalString #2217

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

MattBolitho
Copy link
Contributor

No description provided.

@@ -84,7 +84,7 @@ void TraceGenerator::visitFunction(Function &F) {
continue;

auto arg = fn->arg_begin() + i;
auto name = Builder.CreateGlobalStringPtr(arg->getName());
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is the new function available in LLVM15? If not, can this be version gated (e.g. with

#if LLVM_VERSION_MAJOR >= 16
 auto name = Builder.CreateGlobalString(arg->getName());
#else
  auto name = Builder.CreateGlobalStringPtr(arg->getName());
#endif

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks like this API was deprecated in LLVM 15 too, so the test failures are genuine (my bad for only running the C++ tests...). Will try to find some time to look into it soon.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CI seems unhappy here with

RUN: at line 1: if [ 15 -lt 16 ]; then /usr/lib/llvm-15/bin/opt < /home/runner/work/Enzyme/Enzyme/enzyme/test/Enzyme/ProbProg/trace-static.ll  --enable-new-pm=0 -load=/home/runner/work/Enzyme/Enzyme/build/Enzyme/LLVMEnzyme-15.so --enzyme-attributor=0 -enzyme -S | FileCheck /home/runner/work/Enzyme/Enzyme/enzyme/test/Enzyme/ProbProg/trace-static.ll; fi
+ '[' 15 -lt 16 ']'
+ FileCheck /home/runner/work/Enzyme/Enzyme/enzyme/test/Enzyme/ProbProg/trace-static.ll
+ /usr/lib/llvm-15/bin/opt --enable-new-pm=0 -load=/home/runner/work/Enzyme/Enzyme/build/Enzyme/LLVMEnzyme-15.so --enzyme-attributor=0 -enzyme -S
Call parameter type does not match function signature!
[5 x i8]* @0
 i8*  call void @__enzyme_insert_argument(i8* %trace, [5 x i8]* nocapture readonly @0, i8* %0, i64 0)
Call parameter type does not match function signature!
[2 x i8]* @1
 i8*  call void @__enzyme_insert_argument(i8* %trace, [2 x i8]* nocapture readonly @1, i8* %2, i64 4)
in function trace_loss
LLVM ERROR: Broken function found, compilation aborted!
PLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ and include the crash backtrace.
Stack dump:
0.	Program arguments: /usr/lib/llvm-15/bin/opt --enable-new-pm=0 -load=/home/runner/work/Enzyme/Enzyme/build/Enzyme/LLVMEnzyme-15.so --enzyme-attributor=0 -enzyme -S
1.	Running pass 'Function Pass Manager' on module '<stdin>'.
2.	Running pass 'Module Verifier' on function '@trace_loss'
 #0 0x00007f2954f043b1 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) (/usr/lib/llvm-15/lib/libLLVM-15.so.1+0xf043b1)
 #1 0x00007f2954f020fe llvm::sys::RunSignalHandlers() (/usr/lib/llvm-15/lib/libLLVM-15.so.1+0xf020fe)
 #2 0x00007f2954f048d6 (/usr/lib/llvm-15/lib/libLLVM-15.so.1+0xf048d6)
 #3 0x00007f2953842520 (/lib/x86_64-linux-gnu/libc.so.6+0x42520)
 #4 0x00007f29538969fc pthread_kill (/lib/x86_64-linux-gnu/libc.so.6+0x969fc)
 #5 0x00007f2953842476 gsignal (/lib/x86_64-linux-gnu/libc.so.6+0x42476)
 #6 0x00007f29538[287](https://github.com/EnzymeAD/Enzyme/actions/runs/12602788069/job/35126525285?pr=2217#step:9:288)f3 abort (/lib/x86_64-linux-gnu/libc.so.6+0x287f3)
 #7 0x00007f2954e393db llvm::report_fatal_error(llvm::Twine const&, bool) (/usr/lib/llvm-15/lib/libLLVM-15.so.1+0xe393db)
 #8 0x00007f2954e39226 (/usr/lib/llvm-15/lib/libLLVM-15.so.1+0xe39226)
 #9 0x00007f29550c8bdf (/usr/lib/llvm-15/lib/libLLVM-15.so.1+0x10c8bdf)
#10 0x00007f2955040ce2 llvm::FPPassManager::runOnFunction(llvm::Function&) (/usr/lib/llvm-15/lib/libLLVM-15.so.1+0x1040ce2)
#11 0x00007f29550482a3 llvm::FPPassManager::runOnModule(llvm::Module&) (/usr/lib/llvm-15/lib/libLLVM-15.so.1+0x10482a3)
#12 0x00007f2955041886 llvm::legacy::PassManagerImpl::run(llvm::Module&) (/usr/lib/llvm-15/lib/libLLVM-15.so.1+0x1041886)
#13 0x00005607ae555e5a main (/usr/lib/llvm-15/bin/opt+0x34e5a)
#14 0x00007f[295](https://github.com/EnzymeAD/Enzyme/actions/runs/12602788069/job/35126525285?pr=2217#step:9:296)3829d90 (/lib/x86_64-linux-gnu/libc.so.6+0x29d90)
#15 0x00007f2953829e40 __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x29e40)
#16 0x00005607ae53c905 _start (/usr/lib/llvm-15/bin/opt+0x1b905)
FileCheck error: '<stdin>' is empty.
FileCheck command line:  FileCheck /home/runner/work/Enzyme/Enzyme/enzyme/test/Enzyme/ProbProg/trace-static.ll

could you add a cast to an i8* ptr, then I assume it would pass

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants