summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Target/ARM/ARMConstantIslandPass.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/lib/Target/ARM/ARMConstantIslandPass.cpp')
-rw-r--r--llvm/lib/Target/ARM/ARMConstantIslandPass.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/llvm/lib/Target/ARM/ARMConstantIslandPass.cpp b/llvm/lib/Target/ARM/ARMConstantIslandPass.cpp
index 46e804ded28..32c88bca186 100644
--- a/llvm/lib/Target/ARM/ARMConstantIslandPass.cpp
+++ b/llvm/lib/Target/ARM/ARMConstantIslandPass.cpp
@@ -1425,6 +1425,10 @@ void ARMConstantIslands::createNewWater(unsigned CPUserIndex,
assert(!isThumb || getITInstrPredicate(*MI, PredReg) == ARMCC::AL));
NewMBB = splitBlockBeforeInstr(&*MI);
+
+ // 4 byte align the next block after the constant pool when the CPE is a
+ // 16-bit value in ARM mode, and 2 byte for Thumb.
+ NewMBB->setAlignment(isThumb ? 1 : 2);
}
/// handleConstantPoolUser - Analyze the specified user, checking to see if it
@@ -1485,8 +1489,6 @@ bool ARMConstantIslands::handleConstantPoolUser(unsigned CPUserIndex,
// We are adding new water. Update NewWaterList.
NewWaterList.insert(NewIsland);
}
- // Always align the new block because CP entries can be smaller than 4 bytes.
- NewMBB->setAlignment(isThumb ? 1 : 2);
// Remove the original WaterList entry; we want subsequent insertions in
// this vicinity to go after the one we're about to insert. This
OpenPOWER on IntegriCloud