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 | 5b8f82e35b51bf007de07a7ca9347d804084ddf8 (patch) | |
tree | 64c14c0f5887248e27ce10d793b5530b6eedb91c /lib/Target | |
parent | 0404cd97e4f6ebfe4f8057d4e21119d77654dff2 (diff) |
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.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@48145 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Target')
-rw-r--r-- | lib/Target/Alpha/AlphaISelLowering.cpp | 6 | ||||
-rw-r--r-- | lib/Target/Alpha/AlphaISelLowering.h | 3 | ||||
-rw-r--r-- | lib/Target/CellSPU/SPUISelLowering.h | 3 | ||||
-rw-r--r-- | lib/Target/IA64/IA64ISelLowering.cpp | 5 | ||||
-rw-r--r-- | lib/Target/IA64/IA64ISelLowering.h | 1 | ||||
-rw-r--r-- | lib/Target/Mips/MipsISelLowering.cpp | 7 | ||||
-rw-r--r-- | lib/Target/Mips/MipsISelLowering.h | 3 | ||||
-rw-r--r-- | lib/Target/PowerPC/PPCISelLowering.cpp | 8 | ||||
-rw-r--r-- | lib/Target/PowerPC/PPCISelLowering.h | 3 | ||||
-rw-r--r-- | lib/Target/X86/X86ISelLowering.cpp | 8 | ||||
-rw-r--r-- | lib/Target/X86/X86ISelLowering.h | 3 |
11 files changed, 45 insertions, 5 deletions
diff --git a/lib/Target/Alpha/AlphaISelLowering.cpp b/lib/Target/Alpha/AlphaISelLowering.cpp index 368c736a7d..87f1eec137 100644 --- a/lib/Target/Alpha/AlphaISelLowering.cpp +++ b/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/lib/Target/Alpha/AlphaISelLowering.h b/lib/Target/Alpha/AlphaISelLowering.h index 41a4b54c5f..8738d02f4d 100644 --- a/lib/Target/Alpha/AlphaISelLowering.h +++ b/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/lib/Target/CellSPU/SPUISelLowering.h b/lib/Target/CellSPU/SPUISelLowering.h index a6147bff9b..b8f6ee3ea5 100644 --- a/lib/Target/CellSPU/SPUISelLowering.h +++ b/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/lib/Target/IA64/IA64ISelLowering.cpp b/lib/Target/IA64/IA64ISelLowering.cpp index e4d4867888..dd330db33e 100644 --- a/lib/Target/IA64/IA64ISelLowering.cpp +++ b/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/lib/Target/IA64/IA64ISelLowering.h b/lib/Target/IA64/IA64ISelLowering.h index 4f0630b298..d0cf2a9fc3 100644 --- a/lib/Target/IA64/IA64ISelLowering.h +++ b/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/lib/Target/Mips/MipsISelLowering.cpp b/lib/Target/Mips/MipsISelLowering.cpp index 5a0daf8764..6e2a4f7cc8 100644 --- a/lib/Target/Mips/MipsISelLowering.cpp +++ b/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/lib/Target/Mips/MipsISelLowering.h b/lib/Target/Mips/MipsISelLowering.h index 4af41d25ad..e2b4b3f4a8 100644 --- a/lib/Target/Mips/MipsISelLowering.h +++ b/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/lib/Target/PowerPC/PPCISelLowering.cpp b/lib/Target/PowerPC/PPCISelLowering.cpp index 17c28380b3..56837b9d6b 100644 --- a/lib/Target/PowerPC/PPCISelLowering.cpp +++ b/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/lib/Target/PowerPC/PPCISelLowering.h b/lib/Target/PowerPC/PPCISelLowering.h index 816ca8f58d..5229693e17 100644 --- a/lib/Target/PowerPC/PPCISelLowering.h +++ b/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/lib/Target/X86/X86ISelLowering.cpp b/lib/Target/X86/X86ISelLowering.cpp index 087c981b03..7b3b98f743 100644 --- a/lib/Target/X86/X86ISelLowering.cpp +++ b/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/lib/Target/X86/X86ISelLowering.h b/lib/Target/X86/X86ISelLowering.h index c7bd507411..cb8d94d73c 100644 --- a/lib/Target/X86/X86ISelLowering.h +++ b/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. |