aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2006-01-29 06:24:40 +0000
committerChris Lattner <sabre@nondot.org>2006-01-29 06:24:40 +0000
commitac0d7238258defe72b1aad53d7f48201b91df795 (patch)
tree782abe36b0aad113d1d06a77a6eaa147839c6dd4
parent2128a2f76c07632451eb996aed9fdc256ada3951 (diff)
Make ConstantFP legalize into TargetConstantFP like other leaf nodes do. Allow
targets to register custom legalizers for ConstantFP in case there isn't a fixed list of constants that can be generated. On some architectures (ia64?) all fp immediates are legal. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25769 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--include/llvm/CodeGen/LiveIntervalAnalysis.h6
-rw-r--r--include/llvm/CodeGen/SelectionDAG.h2
-rw-r--r--include/llvm/CodeGen/SelectionDAGNodes.h14
3 files changed, 16 insertions, 6 deletions
diff --git a/include/llvm/CodeGen/LiveIntervalAnalysis.h b/include/llvm/CodeGen/LiveIntervalAnalysis.h
index a313c4b9f4..42e04e156f 100644
--- a/include/llvm/CodeGen/LiveIntervalAnalysis.h
+++ b/include/llvm/CodeGen/LiveIntervalAnalysis.h
@@ -148,7 +148,9 @@ namespace llvm {
/// handleVirtualRegisterDef)
void handleRegisterDef(MachineBasicBlock* mbb,
MachineBasicBlock::iterator mi,
- unsigned reg);
+ unsigned reg,
+ std::map<std::pair<unsigned,unsigned>,
+ unsigned> &PhysRegValueMap);
/// handleVirtualRegisterDef - update intervals for a virtual
/// register def
@@ -165,6 +167,8 @@ namespace llvm {
MachineBasicBlock::iterator mi,
LiveInterval& interval,
unsigned SrcReg, unsigned DestReg,
+ std::map<std::pair<unsigned,unsigned>,
+ unsigned> *PhysRegValueMap,
bool isLiveIn = false);
/// Return true if the two specified registers belong to different
diff --git a/include/llvm/CodeGen/SelectionDAG.h b/include/llvm/CodeGen/SelectionDAG.h
index 929fe1ff7e..5c954609eb 100644
--- a/include/llvm/CodeGen/SelectionDAG.h
+++ b/include/llvm/CodeGen/SelectionDAG.h
@@ -113,6 +113,7 @@ public:
SDOperand getConstant(uint64_t Val, MVT::ValueType VT);
SDOperand getTargetConstant(uint64_t Val, MVT::ValueType VT);
SDOperand getConstantFP(double Val, MVT::ValueType VT);
+ SDOperand getTargetConstantFP(double Val, MVT::ValueType VT);
SDOperand getGlobalAddress(const GlobalValue *GV, MVT::ValueType VT,
int offset = 0);
SDOperand getTargetGlobalAddress(const GlobalValue *GV, MVT::ValueType VT,
@@ -587,6 +588,7 @@ private:
std::map<std::pair<uint64_t, MVT::ValueType>, SDNode*> Constants;
std::map<std::pair<uint64_t, MVT::ValueType>, SDNode*> TargetConstants;
std::map<std::pair<uint64_t, MVT::ValueType>, SDNode*> ConstantFPs;
+ std::map<std::pair<uint64_t, MVT::ValueType>, SDNode*> TargetConstantFPs;
std::map<int, SDNode*> FrameIndices, TargetFrameIndices;
std::map<Constant *, SDNode*> ConstantPoolIndices;
std::map<Constant *, SDNode*> TargetConstantPoolIndices;
diff --git a/include/llvm/CodeGen/SelectionDAGNodes.h b/include/llvm/CodeGen/SelectionDAGNodes.h
index d0549030fb..8bb03c6c51 100644
--- a/include/llvm/CodeGen/SelectionDAGNodes.h
+++ b/include/llvm/CodeGen/SelectionDAGNodes.h
@@ -71,9 +71,11 @@ namespace ISD {
// leaf node. All operands are either Constant or ConstantFP nodes.
ConstantVec,
- // TargetConstant - Like Constant, but the DAG does not do any folding or
- // simplification of the constant. This is used by the DAG->DAG selector.
+ // TargetConstant* - Like Constant*, but the DAG does not do any folding or
+ // simplification of the constant.
TargetConstant,
+ TargetConstantFP,
+ TargetConstantVec,
// TargetGlobalAddress - Like GlobalAddress, but the DAG does no folding or
// anything else with this node, and this is valid in the target-specific
@@ -997,8 +999,9 @@ class ConstantFPSDNode : public SDNode {
double Value;
protected:
friend class SelectionDAG;
- ConstantFPSDNode(double val, MVT::ValueType VT)
- : SDNode(ISD::ConstantFP, VT), Value(val) {
+ ConstantFPSDNode(bool isTarget, double val, MVT::ValueType VT)
+ : SDNode(isTarget ? ISD::TargetConstantFP : ISD::ConstantFP, VT),
+ Value(val) {
}
public:
@@ -1012,7 +1015,8 @@ public:
static bool classof(const ConstantFPSDNode *) { return true; }
static bool classof(const SDNode *N) {
- return N->getOpcode() == ISD::ConstantFP;
+ return N->getOpcode() == ISD::ConstantFP ||
+ N->getOpcode() == ISD::TargetConstantFP;
}
};