Remove alignment from deserted constant islands.
authorJakob Stoklund Olesen <stoklund@2pi.dk>
Tue, 6 Dec 2011 21:55:35 +0000 (21:55 +0000)
committerJakob Stoklund Olesen <stoklund@2pi.dk>
Tue, 6 Dec 2011 21:55:35 +0000 (21:55 +0000)
ARMConstantIslandPass may sometimes leave empty constant islands behind
(it really shouldn't). Remove the alignment from the empty islands so
the size calculations are still correct.

This should fix the many Thumb1 assembler errors in the nightly test
suite.

The reduced test case for this problem is way too big. That is to be
expected for ARMConstantIslandPass bugs.

<rdar://problem/10534709>

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@145970 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Target/ARM/ARMConstantIslandPass.cpp

index 017e908206565da989b258b590809fbab15dd833..c8b2fc11bece96beed7d059d8d6a2ea7eeb3300c 100644 (file)
@@ -1355,6 +1355,9 @@ void ARMConstantIslands::RemoveDeadCPEMI(MachineInstr *CPEMI) {
       Size += BBSizes[CPEBB->getNumber()];
       BBSizes[CPEBB->getNumber()] = 0;
     }
       Size += BBSizes[CPEBB->getNumber()];
       BBSizes[CPEBB->getNumber()] = 0;
     }
+
+    // This block no longer needs to be aligned. <rdar://problem/10534709>.
+    CPEBB->setAlignment(0);
   }
   AdjustBBOffsetsAfter(CPEBB, -Size);
   // An island has only one predecessor BB and one successor BB. Check if
   }
   AdjustBBOffsetsAfter(CPEBB, -Size);
   // An island has only one predecessor BB and one successor BB. Check if