[llvm-commits] CodeGen patch: Use getNumBlockIDs() to set the limit on block IDs in EdgeBundles.cpp.

Anna Zaks ganna at apple.com
Wed Jun 15 16:02:32 PDT 2011


Submitting the attached patch for review. 

Function::getNumBlockIDs() should be used instead of Function::size() to set the upper limit on the block IDs.

EdgeBundles code assumes that block numbers are all less then MF->size(). Which is not true if a basic block gets removed (simplified away). See the attached test. In this case, SelectionDAGBuilder::visitBr() calls llvm::MachineFunction::removeFromMBBNumbering(), which introduces the hole in numbering leading to an assert in llc.

Anna.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: edge-bundles.diff
Type: application/octet-stream
Size: 4000 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20110615/f485049b/attachment.obj>


More information about the llvm-commits mailing list