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

Chris Lattner lattner at cs.uiuc.edu
Thu Sep 1 17:19:49 PDT 2005



Changes in directory llvm/lib/CodeGen/SelectionDAG:

SelectionDAGISel.cpp updated: 1.78 -> 1.79
---
Log message:

For values that are live across basic blocks and need promotion, use ANY_EXTEND
instead of ZERO_EXTEND to eliminate extraneous extensions.  This eliminates
dead zero extensions on formal arguments and other cases on PPC, implementing
the newly tightened up test/Regression/CodeGen/PowerPC/small-arguments.ll test.


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

 SelectionDAGISel.cpp |   15 +++++----------
 1 files changed, 5 insertions(+), 10 deletions(-)


Index: llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
diff -u llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp:1.78 llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp:1.79
--- llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp:1.78	Thu Sep  1 13:44:10 2005
+++ llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp	Thu Sep  1 19:19:37 2005
@@ -491,7 +491,7 @@
   SDOperand Op2 = getValue(I.getOperand(1));
 
   if (isShift)
-    Op2 = DAG.getNode(ISD::ZERO_EXTEND, TLI.getShiftAmountTy(), Op2);
+    Op2 = DAG.getNode(ISD::ANY_EXTEND, TLI.getShiftAmountTy(), Op2);
 
   setValue(&I, DAG.getNode(Opcode, Op1.getValueType(), Op1, Op2));
 }
@@ -1025,7 +1025,7 @@
     if (MVT::isFloatingPoint(SrcVT))
       Op = DAG.getNode(ISD::FP_EXTEND, DestVT, Op);
     else
-      Op = DAG.getNode(ISD::ZERO_EXTEND, DestVT, Op);
+      Op = DAG.getNode(ISD::ANY_EXTEND, DestVT, Op);
     return DAG.getCopyToReg(SDL.getRoot(), Reg, Op);
   } else  {
     // The src value is expanded into multiple registers.
@@ -1078,14 +1078,9 @@
         if (!AI->use_empty()) {
           SDL.setValue(AI, Args[a]);
           
-          if (0 && IsOnlyUsedInOneBasicBlock(AI) == F.begin()) {
-            // Only used in the entry block, no need to copy it to a vreg for
-            // other blocks.
-          } else {
-            SDOperand Copy =
-              CopyValueToVirtualRegister(SDL, AI, FuncInfo.ValueMap[AI]);
-            UnorderedChains.push_back(Copy);
-          }
+          SDOperand Copy =
+            CopyValueToVirtualRegister(SDL, AI, FuncInfo.ValueMap[AI]);
+          UnorderedChains.push_back(Copy);
         }
     } else {
       // Otherwise, if any argument is only accessed in a single basic block,






More information about the llvm-commits mailing list