diff options
author | Dimitry Andric <dim@FreeBSD.org> | 2020-07-26 19:36:28 +0000 |
---|---|---|
committer | Dimitry Andric <dim@FreeBSD.org> | 2020-07-26 19:36:28 +0000 |
commit | cfca06d7963fa0909f90483b42a6d7d194d01e08 (patch) | |
tree | 209fb2a2d68f8f277793fc8df46c753d31bc853b /llvm/lib/Target/X86/X86ShuffleDecodeConstantPool.cpp | |
parent | 706b4fc47bbc608932d3b491ae19a3b9cde9497b (diff) |
Notes
Diffstat (limited to 'llvm/lib/Target/X86/X86ShuffleDecodeConstantPool.cpp')
-rw-r--r-- | llvm/lib/Target/X86/X86ShuffleDecodeConstantPool.cpp | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/llvm/lib/Target/X86/X86ShuffleDecodeConstantPool.cpp b/llvm/lib/Target/X86/X86ShuffleDecodeConstantPool.cpp index a202fc63637b9..de528299654c1 100644 --- a/llvm/lib/Target/X86/X86ShuffleDecodeConstantPool.cpp +++ b/llvm/lib/Target/X86/X86ShuffleDecodeConstantPool.cpp @@ -11,8 +11,10 @@ // //===----------------------------------------------------------------------===// -#include "Utils/X86ShuffleDecode.h" +#include "X86ShuffleDecodeConstantPool.h" +#include "MCTargetDesc/X86ShuffleDecode.h" #include "llvm/ADT/APInt.h" +#include "llvm/ADT/SmallVector.h" #include "llvm/IR/Constants.h" //===----------------------------------------------------------------------===// @@ -34,17 +36,17 @@ static bool extractConstantMask(const Constant *C, unsigned MaskEltSizeInBits, // // <4 x i32> <i32 -2147483648, i32 -2147483648, // i32 -2147483648, i32 -2147483648> - Type *CstTy = C->getType(); - if (!CstTy->isVectorTy()) + auto *CstTy = dyn_cast<FixedVectorType>(C->getType()); + if (!CstTy) return false; - Type *CstEltTy = CstTy->getVectorElementType(); + Type *CstEltTy = CstTy->getElementType(); if (!CstEltTy->isIntegerTy()) return false; unsigned CstSizeInBits = CstTy->getPrimitiveSizeInBits(); unsigned CstEltSizeInBits = CstTy->getScalarSizeInBits(); - unsigned NumCstElts = CstTy->getVectorNumElements(); + unsigned NumCstElts = CstTy->getNumElements(); assert((CstSizeInBits % MaskEltSizeInBits) == 0 && "Unaligned shuffle mask size"); @@ -185,13 +187,12 @@ void DecodeVPERMILPMask(const Constant *C, unsigned ElSize, unsigned Width, } void DecodeVPERMIL2PMask(const Constant *C, unsigned M2Z, unsigned ElSize, - unsigned Width, - SmallVectorImpl<int> &ShuffleMask) { + unsigned Width, SmallVectorImpl<int> &ShuffleMask) { Type *MaskTy = C->getType(); unsigned MaskTySize = MaskTy->getPrimitiveSizeInBits(); (void)MaskTySize; - assert((MaskTySize == 128 || MaskTySize == 256) && - Width >= MaskTySize && "Unexpected vector size."); + assert((MaskTySize == 128 || MaskTySize == 256) && Width >= MaskTySize && + "Unexpected vector size."); // The shuffle mask requires elements the same size as the target. APInt UndefElts; |