summaryrefslogtreecommitdiffstats
path: root/llvm/lib
diff options
context:
space:
mode:
authorChandler Carruth <chandlerc@gmail.com>2011-11-14 10:55:53 +0000
committerChandler Carruth <chandlerc@gmail.com>2011-11-14 10:55:53 +0000
commit0a31d149ea337e6760ccc0a9785ac38ce5c54677 (patch)
treec6c55c99b79d62e66b81cb1ff569742884697b33 /llvm/lib
parent0af6a0bb699bfb2f3f3c2ff2f47f419f1bc4d8b4 (diff)
downloadbcm5719-llvm-0a31d149ea337e6760ccc0a9785ac38ce5c54677.tar.gz
bcm5719-llvm-0a31d149ea337e6760ccc0a9785ac38ce5c54677.zip
Remove an over-eager assert that was firing on one of the ARM regression
tests when I forcibly enabled block placement. It is apparantly possible for an unanalyzable block to fallthrough to a non-loop block. I don't actually beleive this is correct, I believe that 'canFallThrough' is returning true needlessly for the code construct, and I've left a bit of a FIXME on the verification code to try to track down why this is coming up. Anyways, removing the assert doesn't degrade the correctness of the algorithm. llvm-svn: 144532
Diffstat (limited to 'llvm/lib')
-rw-r--r--llvm/lib/CodeGen/MachineBlockPlacement.cpp9
1 files changed, 6 insertions, 3 deletions
diff --git a/llvm/lib/CodeGen/MachineBlockPlacement.cpp b/llvm/lib/CodeGen/MachineBlockPlacement.cpp
index 6c8390fee61..412d0b1fab6 100644
--- a/llvm/lib/CodeGen/MachineBlockPlacement.cpp
+++ b/llvm/lib/CodeGen/MachineBlockPlacement.cpp
@@ -492,9 +492,9 @@ void MachineBlockPlacement::buildChain(
if (TII->AnalyzeBranch(*BB, TBB, FBB, Cond) && BB->canFallThrough()) {
MachineFunction::iterator I(BB), NextI(llvm::next(I));
// Ensure that the layout successor is a viable block, as we know that
- // fallthrough is a possibility.
+ // fallthrough is a possibility. Note that this may not be a valid block
+ // in the loop, but we allow that to cope with degenerate situations.
assert(NextI != BB->getParent()->end());
- assert(!BlockFilter || BlockFilter->count(NextI));
BestSucc = NextI;
}
@@ -594,7 +594,10 @@ void MachineBlockPlacement::buildLoopChains(MachineFunction &F,
for (BlockChain::iterator BCI = LoopChain.begin(), BCE = LoopChain.end();
BCI != BCE; ++BCI)
if (!LoopBlockSet.erase(*BCI)) {
- BadLoop = true;
+ // We don't mark the loop as bad here because there are real situations
+ // where this can occur. For example, with an unanalyzable fallthrough
+ // from a loop block to a non-loop block.
+ // FIXME: Such constructs shouldn't exist. Track them down and fix them.
dbgs() << "Loop chain contains a block not contained by the loop!\n"
<< " Loop header: " << getBlockName(*L.block_begin()) << "\n"
<< " Chain header: " << getBlockName(*LoopChain.begin()) << "\n"
OpenPOWER on IntegriCloud