diff options
| author | Scott Michel <scottm@aero.org> | 2008-03-10 15:42:14 +0000 |
|---|---|---|
| committer | Scott Michel <scottm@aero.org> | 2008-03-10 15:42:14 +0000 |
| commit | a6729e8666de208c27ed5608689b4336eeff8f8c (patch) | |
| tree | ee374e530dd9b2d3505b5ab389a7080bd7eba8cb /llvm/lib/Target | |
| parent | afa02ed5fb72a6110a658cb45081d730d68a998d (diff) | |
| download | bcm5719-llvm-a6729e8666de208c27ed5608689b4336eeff8f8c.tar.gz bcm5719-llvm-a6729e8666de208c27ed5608689b4336eeff8f8c.zip | |
Give TargetLowering::getSetCCResultType() a parameter so that ISD::SETCC's
return ValueType can depend its operands' ValueType.
This is a cosmetic change, no functionality impacted.
llvm-svn: 48145
Diffstat (limited to 'llvm/lib/Target')
| -rw-r--r-- | llvm/lib/Target/Alpha/AlphaISelLowering.cpp | 6 | ||||
| -rw-r--r-- | llvm/lib/Target/Alpha/AlphaISelLowering.h | 3 | ||||
| -rw-r--r-- | llvm/lib/Target/CellSPU/SPUISelLowering.h | 3 | ||||
| -rw-r--r-- | llvm/lib/Target/IA64/IA64ISelLowering.cpp | 5 | ||||
| -rw-r--r-- | llvm/lib/Target/IA64/IA64ISelLowering.h | 1 | ||||
| -rw-r--r-- | llvm/lib/Target/Mips/MipsISelLowering.cpp | 7 | ||||
| -rw-r--r-- | llvm/lib/Target/Mips/MipsISelLowering.h | 3 | ||||
| -rw-r--r-- | llvm/lib/Target/PowerPC/PPCISelLowering.cpp | 8 | ||||
| -rw-r--r-- | llvm/lib/Target/PowerPC/PPCISelLowering.h | 3 | ||||
| -rw-r--r-- | llvm/lib/Target/X86/X86ISelLowering.cpp | 8 | ||||
| -rw-r--r-- | llvm/lib/Target/X86/X86ISelLowering.h | 3 |
11 files changed, 45 insertions, 5 deletions
diff --git a/llvm/lib/Target/Alpha/AlphaISelLowering.cpp b/llvm/lib/Target/Alpha/AlphaISelLowering.cpp index 368c736a7da..87f1eec1370 100644 --- a/llvm/lib/Target/Alpha/AlphaISelLowering.cpp +++ b/llvm/lib/Target/Alpha/AlphaISelLowering.cpp @@ -40,7 +40,6 @@ AlphaTargetLowering::AlphaTargetLowering(TargetMachine &TM) : TargetLowering(TM) // Set up the TargetLowering object. //I am having problems with shr n ubyte 1 setShiftAmountType(MVT::i64); - setSetCCResultType(MVT::i64); setSetCCResultContents(ZeroOrOneSetCCResult); setUsesGlobalOffsetTable(true); @@ -151,6 +150,11 @@ AlphaTargetLowering::AlphaTargetLowering(TargetMachine &TM) : TargetLowering(TM) computeRegisterProperties(); } +MVT::ValueType +AlphaTargetLowering::getSetCCResultType(const SDOperand &) const { + return MVT::i64; +} + const char *AlphaTargetLowering::getTargetNodeName(unsigned Opcode) const { switch (Opcode) { default: return 0; diff --git a/llvm/lib/Target/Alpha/AlphaISelLowering.h b/llvm/lib/Target/Alpha/AlphaISelLowering.h index 41a4b54c5f9..8738d02f4d3 100644 --- a/llvm/lib/Target/Alpha/AlphaISelLowering.h +++ b/llvm/lib/Target/Alpha/AlphaISelLowering.h @@ -66,6 +66,9 @@ namespace llvm { public: explicit AlphaTargetLowering(TargetMachine &TM); + /// getSetCCResultType - Get the SETCC result ValueType + virtual MVT::ValueType getSetCCResultType(const SDOperand &) const; + /// LowerOperation - Provide custom lowering hooks for some operations. /// virtual SDOperand LowerOperation(SDOperand Op, SelectionDAG &DAG); diff --git a/llvm/lib/Target/CellSPU/SPUISelLowering.h b/llvm/lib/Target/CellSPU/SPUISelLowering.h index a6147bff9b1..b8f6ee3ea5b 100644 --- a/llvm/lib/Target/CellSPU/SPUISelLowering.h +++ b/llvm/lib/Target/CellSPU/SPUISelLowering.h @@ -102,6 +102,9 @@ namespace llvm { /// getTargetNodeName() - This method returns the name of a target specific /// DAG node. virtual const char *getTargetNodeName(unsigned Opcode) const; + + /// getSetCCResultType - Return the ValueType for ISD::SETCC + MVT::ValueType getSetCCResultType(const SDOperand &) const; /// LowerOperation - Provide custom lowering hooks for some operations. /// diff --git a/llvm/lib/Target/IA64/IA64ISelLowering.cpp b/llvm/lib/Target/IA64/IA64ISelLowering.cpp index e4d4867888e..dd330db33e0 100644 --- a/llvm/lib/Target/IA64/IA64ISelLowering.cpp +++ b/llvm/lib/Target/IA64/IA64ISelLowering.cpp @@ -57,7 +57,6 @@ IA64TargetLowering::IA64TargetLowering(TargetMachine &TM) // br.ret insn setOperationAction(ISD::RET, MVT::Other, Custom); - setSetCCResultType(MVT::i1); setShiftAmountType(MVT::i64); setOperationAction(ISD::FREM , MVT::f32 , Expand); @@ -137,6 +136,10 @@ const char *IA64TargetLowering::getTargetNodeName(unsigned Opcode) const { } } +MVT::ValueType +IA64TargetLowering::getSetCCResultType(const SDOperand &) const { + return MVT::i1; +} std::vector<SDOperand> IA64TargetLowering::LowerArguments(Function &F, SelectionDAG &DAG) { diff --git a/llvm/lib/Target/IA64/IA64ISelLowering.h b/llvm/lib/Target/IA64/IA64ISelLowering.h index 4f0630b2983..d0cf2a9fc31 100644 --- a/llvm/lib/Target/IA64/IA64ISelLowering.h +++ b/llvm/lib/Target/IA64/IA64ISelLowering.h @@ -47,6 +47,7 @@ namespace llvm { unsigned VirtGPR; // this is public so it can be accessed in the selector // for ISD::RET. add an accessor instead? FIXME const char *getTargetNodeName(unsigned Opcode) const; + MVT::ValueType getSetCCResultType(const SDOperand &) const; /// LowerArguments - This hook must be implemented to indicate how we should /// lower the arguments for the specified function, into the specified DAG. diff --git a/llvm/lib/Target/Mips/MipsISelLowering.cpp b/llvm/lib/Target/Mips/MipsISelLowering.cpp index 5a0daf87646..6e2a4f7cc85 100644 --- a/llvm/lib/Target/Mips/MipsISelLowering.cpp +++ b/llvm/lib/Target/Mips/MipsISelLowering.cpp @@ -52,7 +52,6 @@ MipsTargetLowering(MipsTargetMachine &TM): TargetLowering(TM) { // Mips does not have i1 type, so use i32 for // setcc operations results (slt, sgt, ...). - setSetCCResultType(MVT::i32); setSetCCResultContents(ZeroOrOneSetCCResult); // JumpTable targets must use GOT when using PIC_ @@ -112,6 +111,12 @@ MipsTargetLowering(MipsTargetMachine &TM): TargetLowering(TM) } +MVT::ValueType +MipsTargetLowering::getSetCCResultType(const SDOperand &) const { + return MVT::i32; +} + + SDOperand MipsTargetLowering:: LowerOperation(SDOperand Op, SelectionDAG &DAG) { diff --git a/llvm/lib/Target/Mips/MipsISelLowering.h b/llvm/lib/Target/Mips/MipsISelLowering.h index 4af41d25ade..e2b4b3f4a89 100644 --- a/llvm/lib/Target/Mips/MipsISelLowering.h +++ b/llvm/lib/Target/Mips/MipsISelLowering.h @@ -62,6 +62,9 @@ namespace llvm { // DAG node. virtual const char *getTargetNodeName(unsigned Opcode) const; + /// getSetCCResultType - get the ISD::SETCC result ValueType + MVT::ValueType getSetCCResultType(const SDOperand &) const; + private: // Lower Operand helpers SDOperand LowerCCCArguments(SDOperand Op, SelectionDAG &DAG); diff --git a/llvm/lib/Target/PowerPC/PPCISelLowering.cpp b/llvm/lib/Target/PowerPC/PPCISelLowering.cpp index 17c28380b3c..56837b9d6be 100644 --- a/llvm/lib/Target/PowerPC/PPCISelLowering.cpp +++ b/llvm/lib/Target/PowerPC/PPCISelLowering.cpp @@ -324,7 +324,6 @@ PPCTargetLowering::PPCTargetLowering(PPCTargetMachine &TM) setOperationAction(ISD::BUILD_VECTOR, MVT::v4f32, Custom); } - setSetCCResultType(MVT::i32); setShiftAmountType(MVT::i32); setSetCCResultContents(ZeroOrOneSetCCResult); @@ -407,6 +406,13 @@ const char *PPCTargetLowering::getTargetNodeName(unsigned Opcode) const { } } + +MVT::ValueType +PPCTargetLowering::getSetCCResultType(const SDOperand &) const { + return MVT::i32; +} + + //===----------------------------------------------------------------------===// // Node matching predicates, for use by the tblgen matching code. //===----------------------------------------------------------------------===// diff --git a/llvm/lib/Target/PowerPC/PPCISelLowering.h b/llvm/lib/Target/PowerPC/PPCISelLowering.h index 816ca8f58d6..5229693e17b 100644 --- a/llvm/lib/Target/PowerPC/PPCISelLowering.h +++ b/llvm/lib/Target/PowerPC/PPCISelLowering.h @@ -213,6 +213,9 @@ namespace llvm { /// DAG node. virtual const char *getTargetNodeName(unsigned Opcode) const; + /// getSetCCResultType - Return the ISD::SETCC ValueType + virtual MVT::ValueType getSetCCResultType(const SDOperand &) const; + /// getPreIndexedAddressParts - returns true by value, base pointer and /// offset pointer and addressing mode by reference if the node's address /// can be legally represented as pre-indexed load / store address. diff --git a/llvm/lib/Target/X86/X86ISelLowering.cpp b/llvm/lib/Target/X86/X86ISelLowering.cpp index 087c981b03f..7b3b98f7436 100644 --- a/llvm/lib/Target/X86/X86ISelLowering.cpp +++ b/llvm/lib/Target/X86/X86ISelLowering.cpp @@ -57,7 +57,6 @@ X86TargetLowering::X86TargetLowering(TargetMachine &TM) // X86 is weird, it always uses i8 for shift amounts and setcc results. setShiftAmountType(MVT::i8); - setSetCCResultType(MVT::i8); setSetCCResultContents(ZeroOrOneSetCCResult); setSchedulingPreference(SchedulingForRegPressure); setShiftAmountFlavor(Mask); // shl X, 32 == shl X, 0 @@ -728,6 +727,13 @@ X86TargetLowering::X86TargetLowering(TargetMachine &TM) setPrefLoopAlignment(16); } + +MVT::ValueType +X86TargetLowering::getSetCCResultType(const SDOperand &) const { + return MVT::i8; +} + + /// getMaxByValAlign - Helper for getByValTypeAlignment to determine /// the desired ByVal argument alignment. static void getMaxByValAlign(const Type *Ty, unsigned &MaxAlign) { diff --git a/llvm/lib/Target/X86/X86ISelLowering.h b/llvm/lib/Target/X86/X86ISelLowering.h index c7bd507411f..cb8d94d73cb 100644 --- a/llvm/lib/Target/X86/X86ISelLowering.h +++ b/llvm/lib/Target/X86/X86ISelLowering.h @@ -375,6 +375,9 @@ namespace llvm { /// DAG node. virtual const char *getTargetNodeName(unsigned Opcode) const; + /// getSetCCResultType - Return the ISD::SETCC ValueType + virtual MVT::ValueType getSetCCResultType(const SDOperand &) const; + /// computeMaskedBitsForTargetNode - Determine which of the bits specified /// in Mask are known to be either zero or one and return them in the /// KnownZero/KnownOne bitsets. |

