1

I am writing an LLVM Function pass. I would like to call Loop Pass on each of Loops in the function. However I am not able to call a Loop Pass from Function Pass. When I add addRequired for required loop pass, it gives error that it can't schedule that pass.

Any workarounds?

1 Answer 1

1

I'm wondering if you want to run the LoopPass on every loop, then why don't you just invoke the loop pass normally via command line ? by the way it is possible to invoke a loop pass inside function pass. LoopPassManager is doing exactly what you want, it is a function pass which runs loops passes on every loop. so take a look at LPPassManager class in LoopPass.cpp and LoopPass.h

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.