[llvm-commits] CVS: llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp

Chris Lattner lattner at cs.uiuc.edu
Fri Jan 21 16:20:55 PST 2005



Changes in directory llvm/lib/CodeGen/SelectionDAG:

SelectionDAG.cpp updated: 1.47 -> 1.48
---
Log message:

Add a nasty hack to fix Alpha/IA64 multiplies by a power of two.


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

 SelectionDAG.cpp |   13 +++++++++----
 1 files changed, 9 insertions(+), 4 deletions(-)


Index: llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
diff -u llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp:1.47 llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp:1.48
--- llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp:1.47	Fri Jan 21 17:43:12 2005
+++ llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp	Fri Jan 21 18:20:42 2005
@@ -446,6 +446,7 @@
         else {
           assert(N1.getOpcode() == ISD::SUB && "Unexpected operation!");
           // (Z-X) == X  --> Z == X<<1
+          if (N2.getValueType() != MVT::i64)   // FIXME: HACK HACK HACK!
           return getSetCC(Cond, VT, N1.getOperand(0),
                           getNode(ISD::SHL, N2.getValueType(), 
                                   N2, getConstant(1, MVT::i8)));
@@ -654,8 +655,10 @@
       // FIXME: This should only be done if the target supports shift
       // operations.
       if ((C2 & C2-1) == 0) {
-        SDOperand ShAmt = getConstant(ExactLog2(C2), MVT::i8);
-        return getNode(ISD::SHL, VT, N1, ShAmt);
+        if (N2.getValueType() != MVT::i64) {  // FIXME: HACK HACK HACK!
+          SDOperand ShAmt = getConstant(ExactLog2(C2), MVT::i8);
+          return getNode(ISD::SHL, VT, N1, ShAmt);
+        }
       }
       break;
 
@@ -663,8 +666,10 @@
       // FIXME: This should only be done if the target supports shift
       // operations.
       if ((C2 & C2-1) == 0 && C2) {
-        SDOperand ShAmt = getConstant(ExactLog2(C2), MVT::i8);
-        return getNode(ISD::SRL, VT, N1, ShAmt);
+        if (N2.getValueType() != MVT::i64) {   // FIXME: HACK HACK HACK!
+          SDOperand ShAmt = getConstant(ExactLog2(C2), MVT::i8);
+          return getNode(ISD::SRL, VT, N1, ShAmt);
+        }
       }
       break;
 






More information about the llvm-commits mailing list