diff options
author | Vadzim Dambrouski <pftbest@gmail.com> | 2017-03-20 22:59:57 +0000 |
---|---|---|
committer | Vadzim Dambrouski <pftbest@gmail.com> | 2017-03-20 22:59:57 +0000 |
commit | ba789cbd3da2fac7d46a39f8cef06d0ea51c5049 (patch) | |
tree | 92695c4e5c8e113dc889e0316477a60caae989ce /llvm/lib | |
parent | 5ba576ffe6ab3c81479b29ed8e6bbf90fae8f037 (diff) | |
download | bcm5719-llvm-ba789cbd3da2fac7d46a39f8cef06d0ea51c5049.tar.gz bcm5719-llvm-ba789cbd3da2fac7d46a39f8cef06d0ea51c5049.zip |
[ARM] Fix PR32130: Handle promotion of zero sized constants.
The special case of zero sized values was previously not handled correctly.
This patch handles this by not promoting if the size is zero.
Patch by Tim Neumann.
Differential Revision: https://reviews.llvm.org/D31116
llvm-svn: 298320
Diffstat (limited to 'llvm/lib')
-rw-r--r-- | llvm/lib/Target/ARM/ARMISelLowering.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/llvm/lib/Target/ARM/ARMISelLowering.cpp b/llvm/lib/Target/ARM/ARMISelLowering.cpp index c988e1693f8..47885467d1f 100644 --- a/llvm/lib/Target/ARM/ARMISelLowering.cpp +++ b/llvm/lib/Target/ARM/ARMISelLowering.cpp @@ -3063,7 +3063,8 @@ static SDValue promoteToConstantPool(const GlobalValue *GV, SelectionDAG &DAG, unsigned RequiredPadding = 4 - (Size % 4); bool PaddingPossible = RequiredPadding == 4 || (CDAInit && CDAInit->isString()); - if (!PaddingPossible || Align > 4 || Size > ConstpoolPromotionMaxSize) + if (!PaddingPossible || Align > 4 || Size > ConstpoolPromotionMaxSize || + Size == 0) return SDValue(); unsigned PaddedSize = Size + ((RequiredPadding == 4) ? 0 : RequiredPadding); |