diff options
author | Sjoerd Meijer <sjoerd.meijer@arm.com> | 2018-02-27 19:26:02 +0000 |
---|---|---|
committer | Sjoerd Meijer <sjoerd.meijer@arm.com> | 2018-02-27 19:26:02 +0000 |
commit | fc0d02cbbfaaa91bf09666bffb2c2f64342bdd07 (patch) | |
tree | 78e630f29b1e2ab2e24fc486d052b08fd44de984 /llvm/lib/Target/ARM/ARMConstantIslandPass.cpp | |
parent | de979bfe58a27d7d228b87ac32aeb17dd502c7bc (diff) | |
download | bcm5719-llvm-fc0d02cbbfaaa91bf09666bffb2c2f64342bdd07.tar.gz bcm5719-llvm-fc0d02cbbfaaa91bf09666bffb2c2f64342bdd07.zip |
[ARM] Another f16 litpool fix
We were always setting the block alignment to 2 bytes in Thumb mode
and 4-bytes in ARM mode (r325754, and r325012), but this could cause
reducing the block alignment when it already had been aligned (e.g.
in Thumb mode when the block is a CPE that was already 4-byte aligned).
Patch by Momchil Velikov, I've only added a test.
Differential Revision: https://reviews.llvm.org/D43777
llvm-svn: 326232
Diffstat (limited to 'llvm/lib/Target/ARM/ARMConstantIslandPass.cpp')
-rw-r--r-- | llvm/lib/Target/ARM/ARMConstantIslandPass.cpp | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/llvm/lib/Target/ARM/ARMConstantIslandPass.cpp b/llvm/lib/Target/ARM/ARMConstantIslandPass.cpp index 46e804ded28..fc32fe86829 100644 --- a/llvm/lib/Target/ARM/ARMConstantIslandPass.cpp +++ b/llvm/lib/Target/ARM/ARMConstantIslandPass.cpp @@ -1485,8 +1485,12 @@ 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); + // Always align the new block because CP entries can be smaller than 4 + // bytes. Be careful not to decrease the existing alignment, e.g. NewMBB may + // be an already aligned constant pool block. + const unsigned Align = isThumb ? 1 : 2; + if (NewMBB->getAlignment() < Align) + NewMBB->setAlignment(Align); // Remove the original WaterList entry; we want subsequent insertions in // this vicinity to go after the one we're about to insert. This |