diff options
| author | Chris Lattner <sabre@nondot.org> | 2005-09-02 00:19:37 +0000 |
|---|---|---|
| committer | Chris Lattner <sabre@nondot.org> | 2005-09-02 00:19:37 +0000 |
| commit | a66403dbf74fe3ca3fdfacbf8f083f99da1e33bd (patch) | |
| tree | b0748a0cf876e2c8dcb6d0fcfeadd720b871d852 /llvm/lib/CodeGen | |
| parent | 7753f175e646e250916205fdaf67e8f3fb9b4e92 (diff) | |
| download | bcm5719-llvm-a66403dbf74fe3ca3fdfacbf8f083f99da1e33bd.tar.gz bcm5719-llvm-a66403dbf74fe3ca3fdfacbf8f083f99da1e33bd.zip | |
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.
llvm-svn: 23205
Diffstat (limited to 'llvm/lib/CodeGen')
| -rw-r--r-- | llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp | 15 |
1 files changed, 5 insertions, 10 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp b/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp index 4121e400bc4..3ed7f60ec47 100644 --- a/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp +++ b/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp @@ -491,7 +491,7 @@ void SelectionDAGLowering::visitBinary(User &I, unsigned Opcode, bool isShift) { 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 @@ CopyValueToVirtualRegister(SelectionDAGLowering &SDL, Value *V, unsigned Reg) { 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 @@ LowerArguments(BasicBlock *BB, SelectionDAGLowering &SDL, 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, |

