Implement Promote for VAARG, and allow it to be custom promoted for people

who don't want the default behavior (Alpha).


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25726 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Nate Begeman
2006-01-28 03:14:31 +00:00
parent eb20ed6c86
commit 0aed7840ec
6 changed files with 51 additions and 3 deletions

View File

@@ -141,6 +141,7 @@ AlphaTargetLowering::AlphaTargetLowering(TargetMachine &TM) : TargetLowering(TM)
setOperationAction(ISD::VAEND, MVT::Other, Expand);
setOperationAction(ISD::VACOPY, MVT::Other, Custom);
setOperationAction(ISD::VAARG, MVT::Other, Custom);
setOperationAction(ISD::VAARG, MVT::i32, Custom);
setStackPointerRegisterToSaveRestore(Alpha::R30);
@@ -691,3 +692,13 @@ SDOperand AlphaTargetLowering::LowerOperation(SDOperand Op, SelectionDAG &DAG) {
return SDOperand();
}
SDOperand AlphaTargetLowering::CustomPromoteOperation(SDOperand Op,
SelectionDAG &DAG) {
assert(Op.getValueType() == MVT::i32 &&
Op.getOpcode() == ISD::VAARG &&
"Unknown node to custom promote!");
// The code in LowerOperation already handles i32 vaarg
return LowerOperation(Op, DAG);
}