1

From what I have gathered, to use opt to run a compiler pass on an .ll file, I can load a plugin first, and then run the pass using the plugin:

opt -load=./myPass.so -help

opt -myPass myProgram.ll -o myOptimizedProgram.ll

However, when I run the first command, the newly loaded plugin does not show up in the -help output. Opt doesn't print any error message, so I'm not sure how to start to look for a reason why.

If anyone can suggest a way to begin to track down a reason for this error (eg, is there any way to make opt print out any usable error message), I would greatly appreciate that as well.

I have seen the following solutions, which did not work for me:

LLVM OPT not giving optimised file as output.

Using LLVM opt with built-in passes

It also might be helpful to know that, when I try to run the pass using clang like so:

clang++ -Xclang -load -Xclang ./myPass.so myProgram.ll -o myOptimizedProgram.ll

it prints out an error message just fine.

*Edited some misused words.

Daniel W.
  • 11
  • 1

0 Answers0