diff options
Diffstat (limited to 'llvm/lib/Target/X86/X86ISelLowering.cpp')
-rw-r--r-- | llvm/lib/Target/X86/X86ISelLowering.cpp | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/llvm/lib/Target/X86/X86ISelLowering.cpp b/llvm/lib/Target/X86/X86ISelLowering.cpp index 533ee7c6a43..872f3d5d12a 100644 --- a/llvm/lib/Target/X86/X86ISelLowering.cpp +++ b/llvm/lib/Target/X86/X86ISelLowering.cpp @@ -5318,12 +5318,11 @@ static bool getTargetConstantBitsFromNode(SDValue Op, unsigned EltSizeInBits, return true; } if (auto *CInt = dyn_cast<ConstantInt>(Cst)) { - Mask |= CInt->getValue().zextOrTrunc(SizeInBits).shl(BitOffset); + Mask.insertBits(CInt->getValue(), BitOffset); return true; } if (auto *CFP = dyn_cast<ConstantFP>(Cst)) { - APInt CstBits = CFP->getValueAPF().bitcastToAPInt(); - Mask |= CstBits.zextOrTrunc(SizeInBits).shl(BitOffset); + Mask.insertBits(CFP->getValueAPF().bitcastToAPInt(), BitOffset); return true; } return false; @@ -5340,7 +5339,7 @@ static bool getTargetConstantBitsFromNode(SDValue Op, unsigned EltSizeInBits, } auto *Cst = cast<ConstantSDNode>(Src); APInt Bits = Cst->getAPIntValue().zextOrTrunc(SrcEltSizeInBits); - MaskBits |= Bits.zext(SizeInBits).shl(BitOffset); + MaskBits.insertBits(Bits, BitOffset); } return SplitBitData(); } |