Fix a minor bug in the dag combiner that broke pcompress2 and some other
authorChris Lattner <sabre@nondot.org>
Thu, 13 Oct 2005 18:16:34 +0000 (18:16 +0000)
committerChris Lattner <sabre@nondot.org>
Thu, 13 Oct 2005 18:16:34 +0000 (18:16 +0000)
tests.

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

lib/CodeGen/SelectionDAG/DAGCombiner.cpp

index 547bee1bb8eae380303aaaf59e03abd2045e614c..0a20d9c3a8babb7fbd94e8d705d6800d39b799c7 100644 (file)
@@ -805,13 +805,12 @@ SDOperand DAGCombiner::visitAND(SDNode *N) {
     // before Legalize, or the resulting zextload is legal on the target, then
     // go ahead and do the fold.
     if ((N1C->getValue() == (1ULL << MVT::getSizeInBits(EVT))-1) &&
-        (!AfterLegalize || 
-         TargetLowering::Legal == TLI.getOperationAction(ISD::ZEXTLOAD, EVT))) {
+        (!AfterLegalize || TLI.isOperationLegal(ISD::ZEXTLOAD, EVT))) {
       SDOperand ExtLoad = DAG.getExtLoad(ISD::ZEXTLOAD, VT, N0.getOperand(0),
                                          N0.getOperand(1), N0.getOperand(2),
                                          EVT);
-      CombineTo(N0.Val, ExtLoad, ExtLoad.getOperand(0));
       WorkList.push_back(N);
+      CombineTo(N0.Val, ExtLoad, ExtLoad.getValue(1));
       return SDOperand();
     }
   }
@@ -827,8 +826,8 @@ SDOperand DAGCombiner::visitAND(SDNode *N) {
       SDOperand ExtLoad = DAG.getExtLoad(ISD::ZEXTLOAD, VT, N0.getOperand(0),
                                          N0.getOperand(1), N0.getOperand(2),
                                          EVT);
-      CombineTo(N0.Val, ExtLoad, ExtLoad.getOperand(0));
       WorkList.push_back(N);
+      CombineTo(N0.Val, ExtLoad, ExtLoad.getValue(1));
       return SDOperand();
     }
   }