[LLVMdev] Pass Incompatibility

Luke Dalessandro luked at cs.rochester.edu
Wed Oct 20 10:10:49 PDT 2010


On Oct 20, 2010, at 12:37 PM, Devang Patel wrote:

> 
> On Oct 20, 2010, at 4:05 AM, Luke Dalessandro wrote:
> 
>> If I register DemoteRegisterToMemoryID first
> 
> I'd expect this to work.
> 
>> 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.
> 
> AFAIU, this assertion is not related to ordering of analysis passes. Analyzing incoming bb vector for ExtractCodeRegion() may help you understand why you're triggering this assertion. May the vector is stale ?

Hmm... the code for extraction doesn't change, it's literally the order of registration that matters. The extraction point looks like:

  vector<BasicBlock*> blocks;
  fill(blocks);
  ExtractCodeRegion(getAnalysis<DominatorTree>(*f), blocks)

Maybe, when DemoteRegisterToMemory is added before DominatorTree, this getAnalysis call triggers a DemoteRegisterToMemory on the function where blocks come from before running the DominatorTree analysis...

It sound like I'm just going to need multiple transformation passes to do what I want.

Thanks,
Luke

> 
> 
> -
> Devang
> 





More information about the llvm-dev mailing list