summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Target/ARM/ARMConstantIslandPass.cpp
diff options
context:
space:
mode:
authorSjoerd Meijer <sjoerd.meijer@arm.com>2018-02-22 08:16:05 +0000
committerSjoerd Meijer <sjoerd.meijer@arm.com>2018-02-22 08:16:05 +0000
commit7d5909eb0f89fcca9ea081062d53639da3fe0c72 (patch)
tree0d967547aeaade08f5890691510c722d303a5c55 /llvm/lib/Target/ARM/ARMConstantIslandPass.cpp
parent971514dd3e28426617b1a38600889299649a7c72 (diff)
downloadbcm5719-llvm-7d5909eb0f89fcca9ea081062d53639da3fe0c72.tar.gz
bcm5719-llvm-7d5909eb0f89fcca9ea081062d53639da3fe0c72.zip
[ARM] f16 constant pool fix
This is a follow up of r325012, that allowed half types in constant pools. Proper alignment was enforced when a big basic block was split up, but not when a CPE was placed before/after a block; the successor block had the wrong alignment. Differential Revision: https://reviews.llvm.org/D43580 llvm-svn: 325754
Diffstat (limited to 'llvm/lib/Target/ARM/ARMConstantIslandPass.cpp')
-rw-r--r--llvm/lib/Target/ARM/ARMConstantIslandPass.cpp6
1 files changed, 2 insertions, 4 deletions
diff --git a/llvm/lib/Target/ARM/ARMConstantIslandPass.cpp b/llvm/lib/Target/ARM/ARMConstantIslandPass.cpp
index 32c88bca186..46e804ded28 100644
--- a/llvm/lib/Target/ARM/ARMConstantIslandPass.cpp
+++ b/llvm/lib/Target/ARM/ARMConstantIslandPass.cpp
@@ -1425,10 +1425,6 @@ 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
@@ -1489,6 +1485,8 @@ 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