Nick Johnson
2009-May-11 20:01 UTC
[LLVMdev] Pass Manager hangs with CallGraph and LoopSimplify
Hello, I have discovered a situation in which the pass manager will infinite loop. The minimal test case is below this message. The required structure of these passes is; Before requires CallGraph After requires LoopSimplify and Before I can observe this through opt: opt -load ./libBug.so -after input.bc -o output.bc I built my copy of llvm from svn revision 68820 using gcc 4.1.2 Any suggestions? -- Nick Johnson #include "llvm/Pass.h" #include "llvm/Transforms/Scalar.h" #include "llvm/Analysis/CallGraph.h" using namespace llvm; class Before : public ModulePass { public: static char ID; Before() : ModulePass(&ID) {} void getAnalysisUsage(AnalysisUsage &au) const { au.addRequired< CallGraph >(); au.setPreservesAll(); } bool runOnModule(Module &m) { return false; } }; class After : public FunctionPass { public: static char ID; After() : FunctionPass(&ID) {} void getAnalysisUsage(AnalysisUsage &au) const { au.addRequiredID( LoopSimplifyID ); au.addRequired< Before >(); au.setPreservesAll(); } bool runOnFunction(Function &f) { return false; } }; char Before::ID = 0; char After::ID = 0; namespace { RegisterPass< Before > x("before", "before"); RegisterPass< After > y("after", "after"); }
Samuel Crow
2009-May-11 20:16 UTC
[LLVMdev] Pass Manager hangs with CallGraph and LoopSimplify
See http://llvm.org/docs/GettingStarted.html#brokengcc and then try building with something OTHER than GCC 4.1.2 . ----- Original Message ----> From: Nick Johnson <npjohnso at cs.princeton.edu> > To: LLVM Developers Mailing List <llvmdev at cs.uiuc.edu> > Sent: Monday, May 11, 2009 3:01:12 PM > Subject: [LLVMdev] Pass Manager hangs with CallGraph and LoopSimplify > > Hello, > > I have discovered a situation in which the pass manager will infinite > loop. The minimal test case is below this message. The required > structure of these passes is; > > Before requires CallGraph > After requires LoopSimplify and Before > > I can observe this through opt: > > opt -load ./libBug.so -after input.bc -o output.bc > > I built my copy of llvm from svn revision 68820 using gcc 4.1.2 > > Any suggestions? > -- > Nick Johnson > > > > > #include "llvm/Pass.h" > #include "llvm/Transforms/Scalar.h" > #include "llvm/Analysis/CallGraph.h" > > > using namespace llvm; > > class Before : public ModulePass { > public: > static char ID; > Before() : ModulePass(&ID) {} > > void getAnalysisUsage(AnalysisUsage &au) const { > au.addRequired< CallGraph >(); > au.setPreservesAll(); > } > > bool runOnModule(Module &m) { return false; } > }; > > class After : public FunctionPass { > public: > static char ID; > > After() : FunctionPass(&ID) {} > > void getAnalysisUsage(AnalysisUsage &au) const { > au.addRequiredID( LoopSimplifyID ); > au.addRequired< Before >(); > au.setPreservesAll(); > } > > bool runOnFunction(Function &f) { return false; } > }; > > char Before::ID = 0; > char After::ID = 0; > namespace { > RegisterPass< Before > x("before", "before"); > RegisterPass< After > y("after", "after"); > } > _______________________________________________ > LLVM Developers mailing list > LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
Nick Johnson
2009-May-11 20:27 UTC
[LLVMdev] Pass Manager hangs with CallGraph and LoopSimplify
> See http://llvm.org/docs/GettingStarted.html#brokengcc and then try building with something OTHER than GCC 4.1.2 .I have confirmed this bug with GCC v 4.2.4, which is NOT on your list. Nick> > > > ----- Original Message ---- >> From: Nick Johnson <npjohnso at cs.princeton.edu> >> To: LLVM Developers Mailing List <llvmdev at cs.uiuc.edu> >> Sent: Monday, May 11, 2009 3:01:12 PM >> Subject: [LLVMdev] Pass Manager hangs with CallGraph and LoopSimplify >> >> Hello, >> >> I have discovered a situation in which the pass manager will infinite >> loop. The minimal test case is below this message. The required >> structure of these passes is; >> >> Before requires CallGraph >> After requires LoopSimplify and Before >> >> I can observe this through opt: >> >> opt -load ./libBug.so -after input.bc -o output.bc >> >> I built my copy of llvm from svn revision 68820 using gcc 4.1.2 >> >> Any suggestions? >> -- >> Nick Johnson >> >> >> >> >> #include "llvm/Pass.h" >> #include "llvm/Transforms/Scalar.h" >> #include "llvm/Analysis/CallGraph.h" >> >> >> using namespace llvm; >> >> class Before : public ModulePass { >> public: >> static char ID; >> Before() : ModulePass(&ID) {} >> >> void getAnalysisUsage(AnalysisUsage &au) const { >> au.addRequired< CallGraph >(); >> au.setPreservesAll(); >> } >> >> bool runOnModule(Module &m) { return false; } >> }; >> >> class After : public FunctionPass { >> public: >> static char ID; >> >> After() : FunctionPass(&ID) {} >> >> void getAnalysisUsage(AnalysisUsage &au) const { >> au.addRequiredID( LoopSimplifyID ); >> au.addRequired< Before >(); >> au.setPreservesAll(); >> } >> >> bool runOnFunction(Function &f) { return false; } >> }; >> >> char Before::ID = 0; >> char After::ID = 0; >> namespace { >> RegisterPass< Before > x("before", "before"); >> RegisterPass< After > y("after", "after"); >> } >> _______________________________________________ >> LLVM Developers mailing list >> LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu >> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev > > > > > _______________________________________________ > LLVM Developers mailing list > LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev >-- Nick Johnson
Possibly Parallel Threads
- [LLVMdev] Pass Manager hangs with CallGraph and LoopSimplify
- Preservation of CallGraph (by BasicBlockPass, FunctionPass)
- Preservation of CallGraph (by BasicBlockPass, FunctionPass)
- Preservation of CallGraph (by BasicBlockPass, FunctionPass)
- Preservation of CallGraph (by BasicBlockPass, FunctionPass)