summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCraig Topper <craig.topper@gmail.com>2017-02-27 16:15:27 +0000
committerCraig Topper <craig.topper@gmail.com>2017-02-27 16:15:27 +0000
commite1be95c3d069f7b1a133671e1823d280ec66928e (patch)
treec7d518f8452ed6832648433bf21baad15fe247e7
parent53e5a38da93a114f72d2996003757b5852ea3f12 (diff)
downloadbcm5719-llvm-e1be95c3d069f7b1a133671e1823d280ec66928e.tar.gz
bcm5719-llvm-e1be95c3d069f7b1a133671e1823d280ec66928e.zip
[X86] Fix SmallVector sizes in constant pool shuffle decoding to avoid heap allocation
Some of the vectors are under sized to avoid heap allocation. In one case the vector was oversized. Differential Revision: https://reviews.llvm.org/D30387 llvm-svn: 296353
-rw-r--r--llvm/lib/Target/X86/X86ShuffleDecodeConstantPool.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/llvm/lib/Target/X86/X86ShuffleDecodeConstantPool.cpp b/llvm/lib/Target/X86/X86ShuffleDecodeConstantPool.cpp
index 3ce8609267f..df6ddafa717 100644
--- a/llvm/lib/Target/X86/X86ShuffleDecodeConstantPool.cpp
+++ b/llvm/lib/Target/X86/X86ShuffleDecodeConstantPool.cpp
@@ -104,7 +104,7 @@ void DecodePSHUFBMask(const Constant *C, SmallVectorImpl<int> &ShuffleMask) {
// The shuffle mask requires a byte vector.
APInt UndefElts;
- SmallVector<uint64_t, 32> RawMask;
+ SmallVector<uint64_t, 64> RawMask;
if (!extractConstantMask(C, 8, UndefElts, RawMask))
return;
@@ -145,7 +145,7 @@ void DecodeVPERMILPMask(const Constant *C, unsigned ElSize,
// The shuffle mask requires elements the same size as the target.
APInt UndefElts;
- SmallVector<uint64_t, 8> RawMask;
+ SmallVector<uint64_t, 16> RawMask;
if (!extractConstantMask(C, ElSize, UndefElts, RawMask))
return;
@@ -231,7 +231,7 @@ void DecodeVPPERMMask(const Constant *C, SmallVectorImpl<int> &ShuffleMask) {
// The shuffle mask requires a byte vector.
APInt UndefElts;
- SmallVector<uint64_t, 32> RawMask;
+ SmallVector<uint64_t, 16> RawMask;
if (!extractConstantMask(C, 8, UndefElts, RawMask))
return;
@@ -286,7 +286,7 @@ void DecodeVPERMVMask(const Constant *C, unsigned ElSize,
// The shuffle mask requires elements the same size as the target.
APInt UndefElts;
- SmallVector<uint64_t, 8> RawMask;
+ SmallVector<uint64_t, 64> RawMask;
if (!extractConstantMask(C, ElSize, UndefElts, RawMask))
return;
@@ -314,7 +314,7 @@ void DecodeVPERMV3Mask(const Constant *C, unsigned ElSize,
// The shuffle mask requires elements the same size as the target.
APInt UndefElts;
- SmallVector<uint64_t, 8> RawMask;
+ SmallVector<uint64_t, 64> RawMask;
if (!extractConstantMask(C, ElSize, UndefElts, RawMask))
return;
OpenPOWER on IntegriCloud