summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Target/X86/Utils/X86ShuffleDecode.h
diff options
context:
space:
mode:
authorDavid Majnemer <david.majnemer@gmail.com>2015-01-11 05:08:57 +0000
committerDavid Majnemer <david.majnemer@gmail.com>2015-01-11 05:08:57 +0000
commit292d0c796bf41927109e332903ffdcd83d5e7f25 (patch)
tree8ce555dbffc036cce496dfbfb57bc2aba900ad2b /llvm/lib/Target/X86/Utils/X86ShuffleDecode.h
parent9cf2679d3bb7272e1a398bf0e4fae59970c666b6 (diff)
downloadbcm5719-llvm-292d0c796bf41927109e332903ffdcd83d5e7f25.tar.gz
bcm5719-llvm-292d0c796bf41927109e332903ffdcd83d5e7f25.zip
X86: Properly decode shuffle masks when the constant pool type is weird
It's possible for the constant pool entry for the shuffle mask to come from a completely different operation. This occurs when Constants have the same bit pattern but have different types. Make DecodePSHUFBMask tolerant of types which, after a bitcast, are appropriately sized vector types. This fixes PR22188. llvm-svn: 225597
Diffstat (limited to 'llvm/lib/Target/X86/Utils/X86ShuffleDecode.h')
-rw-r--r--llvm/lib/Target/X86/Utils/X86ShuffleDecode.h4
1 files changed, 3 insertions, 1 deletions
diff --git a/llvm/lib/Target/X86/Utils/X86ShuffleDecode.h b/llvm/lib/Target/X86/Utils/X86ShuffleDecode.h
index 6ba3c64f8ec..48ba32354f9 100644
--- a/llvm/lib/Target/X86/Utils/X86ShuffleDecode.h
+++ b/llvm/lib/Target/X86/Utils/X86ShuffleDecode.h
@@ -24,6 +24,7 @@
namespace llvm {
class Constant;
+class DataLayout;
class MVT;
enum { SM_SentinelUndef = -1, SM_SentinelZero = -2 };
@@ -68,7 +69,8 @@ void DecodeUNPCKHMask(MVT VT, SmallVectorImpl<int> &ShuffleMask);
void DecodeUNPCKLMask(MVT VT, SmallVectorImpl<int> &ShuffleMask);
/// \brief Decode a PSHUFB mask from an IR-level vector constant.
-void DecodePSHUFBMask(const Constant *C, SmallVectorImpl<int> &ShuffleMask);
+void DecodePSHUFBMask(const Constant *C, const DataLayout *TD,
+ SmallVectorImpl<int> &ShuffleMask);
/// \brief Decode a PSHUFB mask from a raw array of constants such as from
/// BUILD_VECTOR.
OpenPOWER on IntegriCloud