[LLVMdev] Pass Manager hangs with CallGraph and LoopSimplify
Nick Johnson
npjohnso at cs.princeton.edu
Mon May 11 13:01:12 PDT 2009
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");
}
More information about the llvm-dev
mailing list