[llvm] r344924 - [X86] getTargetConstantBitsFromNode - handle extraction from larger constant pool entries
Simon Pilgrim via llvm-commits
llvm-commits at lists.llvm.org
Mon Oct 22 10:43:33 PDT 2018
Author: rksimon
Date: Mon Oct 22 10:43:33 2018
New Revision: 344924
URL: http://llvm.org/viewvc/llvm-project?rev=344924&view=rev
Log:
[X86] getTargetConstantBitsFromNode - handle extraction from larger constant pool entries
First step towards removing X86ShuffleDecodeConstantPool usage from X86ISelLowering.cpp
Modified:
llvm/trunk/lib/Target/X86/X86ISelLowering.cpp
Modified: llvm/trunk/lib/Target/X86/X86ISelLowering.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86ISelLowering.cpp?rev=344924&r1=344923&r2=344924&view=diff
==============================================================================
--- llvm/trunk/lib/Target/X86/X86ISelLowering.cpp (original)
+++ llvm/trunk/lib/Target/X86/X86ISelLowering.cpp Mon Oct 22 10:43:33 2018
@@ -5694,11 +5694,12 @@ static bool getTargetConstantBitsFromNod
// Extract constant bits from constant pool vector.
if (auto *Cst = getTargetConstantFromNode(Op)) {
Type *CstTy = Cst->getType();
- if (!CstTy->isVectorTy() || (SizeInBits != CstTy->getPrimitiveSizeInBits()))
+ unsigned CstSizeInBits = CstTy->getPrimitiveSizeInBits();
+ if (!CstTy->isVectorTy() || (CstSizeInBits % SizeInBits) != 0)
return false;
unsigned SrcEltSizeInBits = CstTy->getScalarSizeInBits();
- unsigned NumSrcElts = CstTy->getVectorNumElements();
+ unsigned NumSrcElts = SizeInBits / SrcEltSizeInBits;
APInt UndefSrcElts(NumSrcElts, 0);
SmallVector<APInt, 64> SrcEltBits(NumSrcElts, APInt(SrcEltSizeInBits, 0));
More information about the llvm-commits
mailing list