summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Target/ARM
diff options
context:
space:
mode:
authorJakob Stoklund Olesen <stoklund@2pi.dk>2012-01-06 21:40:15 +0000
committerJakob Stoklund Olesen <stoklund@2pi.dk>2012-01-06 21:40:15 +0000
commit690511137cc5b809c39bd00823326e7802868002 (patch)
treee569c79bd4d4574e05039b902181162e4e5f988e /llvm/lib/Target/ARM
parent600b23b22530e31b508ec0b96c73e24171ea0dab (diff)
downloadbcm5719-llvm-690511137cc5b809c39bd00823326e7802868002.tar.gz
bcm5719-llvm-690511137cc5b809c39bd00823326e7802868002.zip
Abort AdjustBBOffsetsAfter early when possible.
llvm-svn: 147685
Diffstat (limited to 'llvm/lib/Target/ARM')
-rw-r--r--llvm/lib/Target/ARM/ARMConstantIslandPass.cpp12
1 files changed, 10 insertions, 2 deletions
diff --git a/llvm/lib/Target/ARM/ARMConstantIslandPass.cpp b/llvm/lib/Target/ARM/ARMConstantIslandPass.cpp
index 2a7721bc74c..b73acd184c6 100644
--- a/llvm/lib/Target/ARM/ARMConstantIslandPass.cpp
+++ b/llvm/lib/Target/ARM/ARMConstantIslandPass.cpp
@@ -1035,14 +1035,22 @@ static bool BBIsJumpedOver(MachineBasicBlock *MBB) {
#endif // NDEBUG
void ARMConstantIslands::AdjustBBOffsetsAfter(MachineBasicBlock *BB) {
- for(unsigned i = BB->getNumber() + 1, e = MF->getNumBlockIDs(); i < e; ++i) {
+ unsigned BBNum = BB->getNumber();
+ for(unsigned i = BBNum + 1, e = MF->getNumBlockIDs(); i < e; ++i) {
// Get the offset and known bits at the end of the layout predecessor.
// Include the alignment of the current block.
unsigned LogAlign = MF->getBlockNumbered(i)->getAlignment();
unsigned Offset = BBInfo[i - 1].postOffset(LogAlign);
unsigned KnownBits = BBInfo[i - 1].postKnownBits(LogAlign);
- // This is where block i begins.
+ // This is where block i begins. Stop if the offset is already correct,
+ // and we have updated 2 blocks. This is the maximum number of blocks
+ // changed before calling this function.
+ if (i > BBNum + 2 &&
+ BBInfo[i].Offset == Offset &&
+ BBInfo[i].KnownBits == KnownBits)
+ break;
+
BBInfo[i].Offset = Offset;
BBInfo[i].KnownBits = KnownBits;
}
OpenPOWER on IntegriCloud