summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen
diff options
context:
space:
mode:
authorAnna Zaks <ganna@apple.com>2011-06-16 00:03:21 +0000
committerAnna Zaks <ganna@apple.com>2011-06-16 00:03:21 +0000
commit2c2aa9a9bef61a9962ff28895ef61df6fed9ab98 (patch)
tree48badc6beabdb4a6875a1feb655d7c9ee5d5f518 /llvm/lib/CodeGen
parent5d36a8cc700ef258df055baf95a248f854444f36 (diff)
downloadbcm5719-llvm-2c2aa9a9bef61a9962ff28895ef61df6fed9ab98.tar.gz
bcm5719-llvm-2c2aa9a9bef61a9962ff28895ef61df6fed9ab98.zip
Function::getNumBlockIDs() should be used instead of Function::size() to set the upper limit on the block IDs since basic blocks might get removed (simplified away) after being initially numbered. Plus the test case, in which SelectionDAGBuilder::visitBr() calls llvm::MachineFunction::removeFromMBBNumbering(), which introduces the hole in numbering leading to an assert in llc (prior to the fix).
llvm-svn: 133113
Diffstat (limited to 'llvm/lib/CodeGen')
-rw-r--r--llvm/lib/CodeGen/EdgeBundles.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/llvm/lib/CodeGen/EdgeBundles.cpp b/llvm/lib/CodeGen/EdgeBundles.cpp
index 646e01407a4..a7aba89b87f 100644
--- a/llvm/lib/CodeGen/EdgeBundles.cpp
+++ b/llvm/lib/CodeGen/EdgeBundles.cpp
@@ -39,7 +39,7 @@ void EdgeBundles::getAnalysisUsage(AnalysisUsage &AU) const {
bool EdgeBundles::runOnMachineFunction(MachineFunction &mf) {
MF = &mf;
EC.clear();
- EC.grow(2 * MF->size());
+ EC.grow(2 * MF->getNumBlockIDs());
for (MachineFunction::const_iterator I = MF->begin(), E = MF->end(); I != E;
++I) {
OpenPOWER on IntegriCloud