[llvm-commits] CVS: llvm/lib/Target/Alpha/AlphaISelPattern.cpp

Andrew Lenharth alenhar2 at cs.uiuc.edu
Fri Jan 28 06:07:02 PST 2005



Changes in directory llvm/lib/Target/Alpha:

AlphaISelPattern.cpp updated: 1.14 -> 1.15
---
Log message:

fix ExprMap and constant check in setcc

---
Diffs of the changes:  (+5 -4)

 AlphaISelPattern.cpp |    9 +++++----
 1 files changed, 5 insertions(+), 4 deletions(-)


Index: llvm/lib/Target/Alpha/AlphaISelPattern.cpp
diff -u llvm/lib/Target/Alpha/AlphaISelPattern.cpp:1.14 llvm/lib/Target/Alpha/AlphaISelPattern.cpp:1.15
--- llvm/lib/Target/Alpha/AlphaISelPattern.cpp:1.14	Fri Jan 28 00:57:18 2005
+++ llvm/lib/Target/Alpha/AlphaISelPattern.cpp	Fri Jan 28 08:06:46 2005
@@ -653,7 +653,7 @@
             }
           } else if (dir == 2) {
             Tmp1 = SelectExpr(N.getOperand(1));
-            if (isConst2) {
+            if (isConst1) {
               Tmp2 = cast<ConstantSDNode>(N.getOperand(0))->getValue();
               BuildMI(BB, Opc, 2, Result).addReg(Tmp1).addImm(Tmp2);
             } else {
@@ -866,9 +866,9 @@
 void ISel::Select(SDOperand N) {
   unsigned Tmp1, Tmp2, Opc;
 
-  if(ExprMap[N])
-    return; //alread selected
-  ExprMap[N] = 1;
+  // FIXME: Disable for our current expansion model!
+  if (/*!N->hasOneUse() &&*/ !ExprMap.insert(std::make_pair(N, 1)).second)
+    return;  // Already selected.
 
   SDNode *Node = N.Val;
 
@@ -977,6 +977,7 @@
   case ISD::CopyFromReg:
   case ISD::CALL:
 //   case ISD::DYNAMIC_STACKALLOC:
+    ExprMap.erase(N);
     SelectExpr(N);
     return;
 






More information about the llvm-commits mailing list