diff options
| author | Nate Begeman <natebegeman@mac.com> | 2006-01-28 03:14:31 +0000 |
|---|---|---|
| committer | Nate Begeman <natebegeman@mac.com> | 2006-01-28 03:14:31 +0000 |
| commit | 595ec734fc08fe7e72b7c3058ed973e91176f768 (patch) | |
| tree | 0e7af7b73ab564b423ab4ce0a94300f72c840111 /llvm/lib/Target/Alpha | |
| parent | 6c82262289f60b7785bc352d09938df58187d1f8 (diff) | |
| download | bcm5719-llvm-595ec734fc08fe7e72b7c3058ed973e91176f768.tar.gz bcm5719-llvm-595ec734fc08fe7e72b7c3058ed973e91176f768.zip | |
Implement Promote for VAARG, and allow it to be custom promoted for people
who don't want the default behavior (Alpha).
llvm-svn: 25726
Diffstat (limited to 'llvm/lib/Target/Alpha')
| -rw-r--r-- | llvm/lib/Target/Alpha/AlphaISelLowering.cpp | 11 | ||||
| -rw-r--r-- | llvm/lib/Target/Alpha/AlphaISelLowering.h | 1 |
2 files changed, 12 insertions, 0 deletions
diff --git a/llvm/lib/Target/Alpha/AlphaISelLowering.cpp b/llvm/lib/Target/Alpha/AlphaISelLowering.cpp index ac21b563b4b..6779b90bd3a 100644 --- a/llvm/lib/Target/Alpha/AlphaISelLowering.cpp +++ b/llvm/lib/Target/Alpha/AlphaISelLowering.cpp @@ -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); +} diff --git a/llvm/lib/Target/Alpha/AlphaISelLowering.h b/llvm/lib/Target/Alpha/AlphaISelLowering.h index 33f87ce8187..fcbaaac190c 100644 --- a/llvm/lib/Target/Alpha/AlphaISelLowering.h +++ b/llvm/lib/Target/Alpha/AlphaISelLowering.h @@ -62,6 +62,7 @@ namespace llvm { /// LowerOperation - Provide custom lowering hooks for some operations. /// virtual SDOperand LowerOperation(SDOperand Op, SelectionDAG &DAG); + virtual SDOperand CustomPromoteOperation(SDOperand Op, SelectionDAG &DAG); //Friendly names for dumps const char *getTargetNodeName(unsigned Opcode) const; |

