[llvm-commits] CVS: llvm/lib/Target/X86/X86ISelDAGToDAG.cpp

Evan Cheng evan.cheng at apple.com
Sat May 20 23:29:03 PDT 2006



Changes in directory llvm/lib/Target/X86:

X86ISelDAGToDAG.cpp updated: 1.65 -> 1.66
---
Log message:

Back out indirect branch load folding hack. It broke some tests.

---
Diffs of the changes:  (+0 -63)

 X86ISelDAGToDAG.cpp |   63 ----------------------------------------------------
 1 files changed, 63 deletions(-)


Index: llvm/lib/Target/X86/X86ISelDAGToDAG.cpp
diff -u llvm/lib/Target/X86/X86ISelDAGToDAG.cpp:1.65 llvm/lib/Target/X86/X86ISelDAGToDAG.cpp:1.66
--- llvm/lib/Target/X86/X86ISelDAGToDAG.cpp:1.65	Sat May 20 04:21:39 2006
+++ llvm/lib/Target/X86/X86ISelDAGToDAG.cpp	Sun May 21 01:28:50 2006
@@ -835,69 +835,6 @@
 
       break;
     }
-
-    case X86ISD::CALL:
-    case X86ISD::TAILCALL: {
-      // Handle indirect call which folds a load here. This never matches by
-      // the TableGen generated code since the load's chain result is read by
-      // the callseq_start node or by a TokenFactor which feeds into the
-      // callseq_start.
-      SDOperand N1 = Node->getOperand(1);
-      if (N1.getOpcode() == ISD::LOAD && N1.hasOneUse() &&
-          !CodeGenMap.count(N1.getValue(0))) {
-        SDOperand Chain = Node->getOperand(0);
-        SDNode *CallStart = FindCallStartFromCall(Chain.Val);
-        if (!CallStart) break;
-        SDNode *CSOp0 = CallStart->getOperand(0).Val;
-        if (! (CSOp0 == N1.Val ||
-               (CSOp0->getOpcode() == ISD::TokenFactor &&
-                N1.Val->isOperand(CSOp0))))
-          break;
-        SDOperand Base, Scale, Index, Disp;
-        if (SelectAddr(N1.getOperand(1), Base, Scale, Index, Disp)) {
-          Select(Base,  Base);
-          Select(Scale, Scale);
-          Select(Index, Index);
-          Select(Disp,  Disp);
-          Select(Chain, Chain);
-          bool HasOptInFlag = false;
-          SDOperand InFlag;
-          if (N.getNumOperands() == 3) {
-            Select(InFlag, N.getOperand(2));
-            HasOptInFlag = true;
-          }
-          SDNode *ResNode;
-          if (HasOptInFlag)
-            ResNode = CurDAG->getTargetNode(X86::CALL32m, MVT::Other, MVT::Flag,
-                                            Base, Scale, Index, Disp, Chain,
-                                            InFlag);
-          else
-            ResNode = CurDAG->getTargetNode(X86::CALL32m, MVT::Other, MVT::Flag,
-                                            Base, Scale, Index, Disp, Chain);
-
-          SelectionDAG::InsertISelMapEntry(CodeGenMap, N.Val,  0, Chain.Val,
-                                           Chain.ResNo);
-          SelectionDAG::InsertISelMapEntry(CodeGenMap, N.Val,  1, ResNode, 1);
-          // CALLSEQ_START needs a chain! It can't be ResNode, that would cause
-          // a cycle. It should be the chain of the load.
-          Select(Chain, N1.getOperand(0));
-          SelectionDAG::InsertISelMapEntry(CodeGenMap, N1.Val, 1, Chain.Val,
-                                           Chain.ResNo);
-          AddHandleReplacement(N1.Val, 1, Chain.Val, Chain.ResNo);
-          Result = SDOperand(ResNode, 0);
-
-#ifndef NDEBUG
-          DEBUG(std::cerr << std::string(Indent-2, ' '));
-          DEBUG(std::cerr << "== ");
-          DEBUG(Result.Val->dump(CurDAG));
-          DEBUG(std::cerr << "\n");
-          Indent -= 2;
-#endif
-          return;
-        }
-      }
-      break;
-    }
   }
 
   SelectCode(Result, N);






More information about the llvm-commits mailing list