diff --git a/llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp b/llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp index 0ce8b3faeb5ab5d43690688235f9df2cf2e98b50..30ada12bc73d2de40013f8603992b1ca40b08f1a 100644 --- a/llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp +++ b/llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp @@ -587,7 +587,7 @@ bool TargetLowering::SimplifyDemandedBits(SDOperand Op, uint64_t DemandedMask, } SDOperand NewSA = - TLO.DAG.getConstant(ShAmt-C1, Op.getOperand(1).getValueType()); + TLO.DAG.getConstant(Diff, Op.getOperand(1).getValueType()); MVT::ValueType VT = Op.getValueType(); return TLO.CombineTo(Op, TLO.DAG.getNode(Opc, VT, InOp.getOperand(0), NewSA));