From: Craig Topper Date: Mon, 27 Feb 2017 16:15:27 +0000 (+0000) Subject: [X86] Fix SmallVector sizes in constant pool shuffle decoding to avoid heap allocation X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=72dbe0cc0e5240838584487791a812107f4c8f3e;p=llvm [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 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@296353 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Target/X86/X86ShuffleDecodeConstantPool.cpp b/lib/Target/X86/X86ShuffleDecodeConstantPool.cpp index 3ce8609267f..df6ddafa717 100644 --- a/lib/Target/X86/X86ShuffleDecodeConstantPool.cpp +++ b/lib/Target/X86/X86ShuffleDecodeConstantPool.cpp @@ -104,7 +104,7 @@ void DecodePSHUFBMask(const Constant *C, SmallVectorImpl &ShuffleMask) { // The shuffle mask requires a byte vector. APInt UndefElts; - SmallVector RawMask; + SmallVector 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 RawMask; + SmallVector RawMask; if (!extractConstantMask(C, ElSize, UndefElts, RawMask)) return; @@ -231,7 +231,7 @@ void DecodeVPPERMMask(const Constant *C, SmallVectorImpl &ShuffleMask) { // The shuffle mask requires a byte vector. APInt UndefElts; - SmallVector RawMask; + SmallVector 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 RawMask; + SmallVector 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 RawMask; + SmallVector RawMask; if (!extractConstantMask(C, ElSize, UndefElts, RawMask)) return;