mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-02-07 14:33:15 +00:00
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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23205 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
13c78e2e5f
commit
fab08875b7
@ -491,7 +491,7 @@ void SelectionDAGLowering::visitBinary(User &I, unsigned Opcode, bool isShift) {
|
|||||||
SDOperand Op2 = getValue(I.getOperand(1));
|
SDOperand Op2 = getValue(I.getOperand(1));
|
||||||
|
|
||||||
if (isShift)
|
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));
|
setValue(&I, DAG.getNode(Opcode, Op1.getValueType(), Op1, Op2));
|
||||||
}
|
}
|
||||||
@ -1025,7 +1025,7 @@ CopyValueToVirtualRegister(SelectionDAGLowering &SDL, Value *V, unsigned Reg) {
|
|||||||
if (MVT::isFloatingPoint(SrcVT))
|
if (MVT::isFloatingPoint(SrcVT))
|
||||||
Op = DAG.getNode(ISD::FP_EXTEND, DestVT, Op);
|
Op = DAG.getNode(ISD::FP_EXTEND, DestVT, Op);
|
||||||
else
|
else
|
||||||
Op = DAG.getNode(ISD::ZERO_EXTEND, DestVT, Op);
|
Op = DAG.getNode(ISD::ANY_EXTEND, DestVT, Op);
|
||||||
return DAG.getCopyToReg(SDL.getRoot(), Reg, Op);
|
return DAG.getCopyToReg(SDL.getRoot(), Reg, Op);
|
||||||
} else {
|
} else {
|
||||||
// The src value is expanded into multiple registers.
|
// The src value is expanded into multiple registers.
|
||||||
@ -1078,14 +1078,9 @@ LowerArguments(BasicBlock *BB, SelectionDAGLowering &SDL,
|
|||||||
if (!AI->use_empty()) {
|
if (!AI->use_empty()) {
|
||||||
SDL.setValue(AI, Args[a]);
|
SDL.setValue(AI, Args[a]);
|
||||||
|
|
||||||
if (0 && IsOnlyUsedInOneBasicBlock(AI) == F.begin()) {
|
SDOperand Copy =
|
||||||
// Only used in the entry block, no need to copy it to a vreg for
|
CopyValueToVirtualRegister(SDL, AI, FuncInfo.ValueMap[AI]);
|
||||||
// other blocks.
|
UnorderedChains.push_back(Copy);
|
||||||
} else {
|
|
||||||
SDOperand Copy =
|
|
||||||
CopyValueToVirtualRegister(SDL, AI, FuncInfo.ValueMap[AI]);
|
|
||||||
UnorderedChains.push_back(Copy);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
// Otherwise, if any argument is only accessed in a single basic block,
|
// Otherwise, if any argument is only accessed in a single basic block,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user