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?

coder hacker
  • 4,819
  • 1
  • 25
  • 50

1 Answers1

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

hadi sadeghi
  • 517
  • 4
  • 7