OSDN Git Service

Fix a bug in my previous patch, grabbing the shift amount width from the
authorChris Lattner <sabre@nondot.org>
Tue, 17 Apr 2007 22:53:02 +0000 (22:53 +0000)
committerChris Lattner <sabre@nondot.org>
Tue, 17 Apr 2007 22:53:02 +0000 (22:53 +0000)
wrong operand.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36223 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/SelectionDAG/TargetLowering.cpp

index 3da06f9..ff27b12 100644 (file)
@@ -581,7 +581,7 @@ bool TargetLowering::SimplifyDemandedBits(SDOperand Op, uint64_t DemandedMask,
           }          
           
           SDOperand NewSA = 
-            TLO.DAG.getConstant(ShAmt-C1, Op.getOperand(0).getValueType());
+            TLO.DAG.getConstant(ShAmt-C1, Op.getOperand(1).getValueType());
           MVT::ValueType VT = Op.getValueType();
           return TLO.CombineTo(Op, TLO.DAG.getNode(ISD::SRL, VT,
                                                    InOp.getOperand(0), NewSA));
@@ -619,7 +619,7 @@ bool TargetLowering::SimplifyDemandedBits(SDOperand Op, uint64_t DemandedMask,
           }          
           
           SDOperand NewSA =
-            TLO.DAG.getConstant(Diff, Op.getOperand(0).getValueType());
+            TLO.DAG.getConstant(Diff, Op.getOperand(1).getValueType());
           return TLO.CombineTo(Op, TLO.DAG.getNode(Opc, VT,
                                                    InOp.getOperand(0), NewSA));
         }