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

Evan Cheng evan.cheng at apple.com
Sat Feb 4 00:51:02 PST 2006



Changes in directory llvm/lib/Target/X86:

X86ISelDAGToDAG.cpp updated: 1.38 -> 1.39
---
Log message:

Complex pattern's custom matcher should not call Select() on any operands.
Select them afterwards if it returns true.


---
Diffs of the changes:  (+7 -13)

 X86ISelDAGToDAG.cpp |   20 +++++++-------------
 1 files changed, 7 insertions(+), 13 deletions(-)


Index: llvm/lib/Target/X86/X86ISelDAGToDAG.cpp
diff -u llvm/lib/Target/X86/X86ISelDAGToDAG.cpp:1.38 llvm/lib/Target/X86/X86ISelDAGToDAG.cpp:1.39
--- llvm/lib/Target/X86/X86ISelDAGToDAG.cpp:1.38	Tue Jan 31 16:28:30 2006
+++ llvm/lib/Target/X86/X86ISelDAGToDAG.cpp	Sat Feb  4 02:50:49 2006
@@ -369,17 +369,11 @@
     return false;
 
   if (AM.BaseType == X86ISelAddressMode::RegBase) {
-    if (AM.Base.Reg.Val) {
-      if (AM.Base.Reg.getOpcode() != ISD::Register)
-        AM.Base.Reg = Select(AM.Base.Reg);
-    } else {
+    if (!AM.Base.Reg.Val)
       AM.Base.Reg = CurDAG->getRegister(0, MVT::i32);
-    }
   }
 
-  if (AM.IndexReg.Val)
-    AM.IndexReg = Select(AM.IndexReg);
-  else
+  if (!AM.IndexReg.Val)
     AM.IndexReg = CurDAG->getRegister(0, MVT::i32);
 
   getAddressOperands(AM, Base, Scale, Index, Disp);
@@ -441,11 +435,6 @@
         return false;
     }
 
-    if (SelectBase)
-      AM.Base.Reg = Select(AM.Base.Reg);
-    if (SelectIndex)
-      AM.IndexReg = Select(AM.IndexReg);
-
     getAddressOperands(AM, Base, Scale, Index, Disp);
     return true;
   }
@@ -461,6 +450,11 @@
   if (Opcode >= ISD::BUILTIN_OP_END && Opcode < X86ISD::FIRST_NUMBER)
     return N;   // Already selected.
 
+  // These are probably emitted by SelectAddr().
+  if (Opcode == ISD::TargetConstant || Opcode == ISD::TargetConstantPool ||
+      Opcode == ISD::TargetFrameIndex || Opcode == ISD::TargetGlobalAddress)
+    return N;
+
   std::map<SDOperand, SDOperand>::iterator CGMI = CodeGenMap.find(N);
   if (CGMI != CodeGenMap.end()) return CGMI->second;
   






More information about the llvm-commits mailing list