Hi,
I’m trying to write a custom pass for LLVM 15 or later version.
Before doing that, I tried to run Hello example. But I got the problem like this.
$ ./bin/opt --load ./lib/LLVMHello.so -passes=hello < /tmp/a.ll > /tmp/b
./bin/opt: unknown pass name ‘hello’
When I do “./bin/opt --load ./lib/LLVMHello.so --help”, it shows that “hello” and “hello2” are valid passes.
However, the following works well regardless of adding “–load ./lib/LLVMHello.so”:
$ ./bin/opt -passes=helloworld < /tmp/a.ll > /tmp/b
foo
bar
I tried the examples for LLVM15.0, 15.7, and 16.0. But got all the same errors. I believe I’m making some stupid mistake. Could anyone help me?
Thanks,
David