[PATCH] D31116: arm: don't promote too small constants
Tim Neumann via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Sat Mar 18 02:26:49 PDT 2017
TimNN created this revision.
Herald added subscribers: rengolin, aemerson.
Fixes https://bugs.llvm.org/show_bug.cgi?id=32130
As far as I can tell the constant promotion would promote constants with a size < 4, however these constants would later trigger an assertion in the ConstantIslandsPass.
https://reviews.llvm.org/D31116
Files:
lib/Target/ARM/ARMISelLowering.cpp
Index: lib/Target/ARM/ARMISelLowering.cpp
===================================================================
--- lib/Target/ARM/ARMISelLowering.cpp
+++ lib/Target/ARM/ARMISelLowering.cpp
@@ -3066,6 +3066,10 @@
if (!PaddingPossible || Align > 4 || Size > ConstpoolPromotionMaxSize)
return SDValue();
+ // The constant pool can only handle constants with a Size >= 4.
+ if (Size < 4)
+ return SDValue();
+
unsigned PaddedSize = Size + ((RequiredPadding == 4) ? 0 : RequiredPadding);
MachineFunction &MF = DAG.getMachineFunction();
ARMFunctionInfo *AFI = MF.getInfo<ARMFunctionInfo>();
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D31116.92249.patch
Type: text/x-patch
Size: 608 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170318/de593a20/attachment.bin>
More information about the llvm-commits
mailing list