[llvm-dev] Opt can't find 'hello' pass

Arthur Eubanks via llvm-dev llvm-dev at lists.llvm.org
Wed Feb 10 15:23:23 PST 2021


Can you post the .ll file that doesn't work and the command you ran?

On Wed, Feb 10, 2021 at 3:21 PM Joshua R Hilke <jrhilke at mit.edu> wrote:

> Got it. Thank you. I tried using the new pass manager from the new
> tutorial as well but was having an issue where the ‘helloworld’ pass would
> only work if I manually removed all the metadata from my hello.ll file to
> where the only thing in it was the function. Otherwise, it would run
> silently and not print out any function names. Any solution to that?
>
>
> On Feb 10, 2021, at 2:11 PM, Arthur Eubanks <aeubanks at google.com> wrote:
>
> That's due to the recent transition to the new pass manager. Adding
> -enable-new-pm=0 to the opt command should work.
>
> I'll update the documentation to explicitly say that the legacy pass
> manager is no longer the default in big red letters.
>
> On Wed, Feb 10, 2021 at 1:49 PM Joshua R Hilke via llvm-dev <
> llvm-dev at lists.llvm.org> wrote:
>
>> I’m just trying to run the hello world example from the LLVM Writing a
>> Pass Tutorial (https://llvm.org/docs/WritingAnLLVMPass.html), but
>> whenever I run:
>>
>> $BUILD_DIR/bin/clang -c -emit-llvm hello.c
>>
>> $BUILD_DIR/bin/opt -load $BUILD_DIR/lib/LLVMHello.so -hello < hello.bc >
>> /dev/null
>>
>>
>>
>> I get the following error:
>>
>> bin/opt: unknown pass name ‘hello’
>>
>>
>>
>> Which seems odd because if I run:
>>
>> $BUILD_DIR/bin/opt -load $BUILD_DIR/lib/LLVMHello.so --help | grep hello
>>
>>
>> I get:
>>
>> --hello  - Hello World Pass
>>
>>
>> To build LLVM I’m running the following commands from my build directory:
>>
>> cmake -G Ninja -DLLVM_ENABLE_PROJECTS=‘clang’ ../llvm
>>
>> cmake --build .
>>
>>
>> Just to clarify, I’m not writing my own pass. Just trying to run the
>> ‘hello’ pass that comes default when building LLVM
>>
>> _______________________________________________
>> LLVM Developers mailing list
>> llvm-dev at lists.llvm.org
>> https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev
>>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20210210/3267c386/attachment.html>


More information about the llvm-dev mailing list