llvm.org GIT mirror llvm / c6588e6
[DAGCombine] Reduce scope of ShAmtVal variable. NFCI. Fixes cppcheck warning. Use the more capable getAPIntVal() instead of getZExtValue() as well since I'm here. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@363921 91177308-0d34-0410-b5e6-96231b3b80d8 Simon Pilgrim 26 days ago
1 changed file(s) with 1 addition(s) and 2 deletion(s). Raw diff Collapse all Expand all
98399839 N0.getOperand(0).getOpcode() == ISD::ZERO_EXTEND &&
98409840 N0.hasOneUse()) {
98419841 SDValue ShAmt = N0.getOperand(1);
9842 unsigned ShAmtVal = cast(ShAmt)->getZExtValue();
98439842 if (N0.getOpcode() == ISD::SHL) {
98449843 SDValue InnerZExt = N0.getOperand(0);
98459844 // If the original shl may be shifting out bits, do not perform this
98469845 // transformation.
98479846 unsigned KnownZeroBits = InnerZExt.getValueSizeInBits() -
98489847 InnerZExt.getOperand(0).getValueSizeInBits();
9849 if (ShAmtVal > KnownZeroBits)
9848 if (cast(ShAmt)->getAPIntValue().ugt(KnownZeroBits))
98509849 return SDValue();
98519850 }
98529851