diff options
author | Simon Pilgrim <llvm-dev@redking.me.uk> | 2017-02-22 15:04:55 +0000 |
---|---|---|
committer | Simon Pilgrim <llvm-dev@redking.me.uk> | 2017-02-22 15:04:55 +0000 |
commit | 3a895c48732ab84b68e2453a8b869cc9c5050e9a (patch) | |
tree | 31a0915edf2018b6379fafc2abaecff61c1c2a1f /llvm/lib/Target/X86/X86ISelLowering.cpp | |
parent | a6f369c7276ede7a0613aff3b5ecb37a22b3d3eb (diff) | |
download | bcm5719-llvm-3a895c48732ab84b68e2453a8b869cc9c5050e9a.tar.gz bcm5719-llvm-3a895c48732ab84b68e2453a8b869cc9c5050e9a.zip |
[X86][SSE] Use APInt::getBitsSet() instead of APInt::getLowBitsSet().shl() separately. NFCI.
llvm-svn: 295845
Diffstat (limited to 'llvm/lib/Target/X86/X86ISelLowering.cpp')
-rw-r--r-- | llvm/lib/Target/X86/X86ISelLowering.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/llvm/lib/Target/X86/X86ISelLowering.cpp b/llvm/lib/Target/X86/X86ISelLowering.cpp index faabe37d4fa..e0aafe3692a 100644 --- a/llvm/lib/Target/X86/X86ISelLowering.cpp +++ b/llvm/lib/Target/X86/X86ISelLowering.cpp @@ -5239,14 +5239,15 @@ static bool getTargetConstantBitsFromNode(SDValue Op, unsigned EltSizeInBits, if (ISD::isBuildVectorOfConstantSDNodes(Op.getNode())) { for (unsigned i = 0, e = Op.getNumOperands(); i != e; ++i) { const SDValue &Src = Op.getOperand(i); + unsigned BitOffset = i * SrcEltSizeInBits; if (Src.isUndef()) { - APInt Undefs = APInt::getLowBitsSet(SizeInBits, SrcEltSizeInBits); - UndefBits |= Undefs.shl(i * SrcEltSizeInBits); + unsigned HiBits = BitOffset + SrcEltSizeInBits; + UndefBits |= APInt::getBitsSet(SizeInBits, BitOffset, HiBits); continue; } auto *Cst = cast<ConstantSDNode>(Src); APInt Bits = Cst->getAPIntValue().zextOrTrunc(SrcEltSizeInBits); - MaskBits |= Bits.zext(SizeInBits).shl(i * SrcEltSizeInBits); + MaskBits |= Bits.zext(SizeInBits).shl(BitOffset); } return SplitBitData(); } |