[LLVMdev] Pass Incompatibility

Luke Dalessandro luked at cs.rochester.edu
Wed Oct 20 04:05:50 PDT 2010


I have a transformation where I'd like to use both DominatorTree (for ExtractCodeRegion), and DemoteRegisterToMemory (i.e., reg2mem). The transformation is phased, so all occurrences of getAnalysis<DominatorTree>(Function) happen before any occurrence of getAnalysisID<FunctionPass>(&DemoteRegisterToMemoryID, Function).

If I register these two passes with DominatorTree first, I get the following assert.

PassAnalysisSupport.h:239: AnalysisType& llvm::Pass::getAnalysisID(const void*, llvm::Function&) [with AnalysisType = llvm::DominatorTree]: Assertion `ResultPass && "Unable to find requested analysis info"' failed.

If I register DemoteRegisterToMemoryID first then I get this assert during code extraction.

CodeExtractor.cpp:681: llvm::Function*<unnamed>::CodeExtractor::ExtractCodeRegion(const std::vector<llvm::BasicBlock*, std::allocator<llvm::BasicBlock*> >&): Assertion `BlocksToExtract.count(*PI) && "No blocks in this region may have entries from outside the region" " except for the first block!"' failed.

If I split my pass in half, then the transformation works as expected, with region extraction and DemoteRegisterToMemory going on their merry way. The split pass is harder to understand though, and injects a pass into -help that doesn't actually work on its own.

Is it simply the case the, in order to use these two passes, I must split my transformation into two passes, or is there another/a better way?

Thanks,
Luke



More information about the llvm-dev mailing list