[llvm-commits] CVS: llvm/include/llvm/CodeGen/LiveIntervalAnalysis.h SelectionDAG.h SelectionDAGNodes.h
Chris Lattner
lattner at cs.uiuc.edu
Sat Jan 28 22:24:52 PST 2006
Changes in directory llvm/include/llvm/CodeGen:
LiveIntervalAnalysis.h updated: 1.48 -> 1.49
SelectionDAG.h updated: 1.92 -> 1.93
SelectionDAGNodes.h updated: 1.96 -> 1.97
---
Log message:
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.
---
Diffs of the changes: (+16 -6)
LiveIntervalAnalysis.h | 6 +++++-
SelectionDAG.h | 2 ++
SelectionDAGNodes.h | 14 +++++++++-----
3 files changed, 16 insertions(+), 6 deletions(-)
Index: llvm/include/llvm/CodeGen/LiveIntervalAnalysis.h
diff -u llvm/include/llvm/CodeGen/LiveIntervalAnalysis.h:1.48 llvm/include/llvm/CodeGen/LiveIntervalAnalysis.h:1.49
--- llvm/include/llvm/CodeGen/LiveIntervalAnalysis.h:1.48 Fri Oct 21 10:49:28 2005
+++ llvm/include/llvm/CodeGen/LiveIntervalAnalysis.h Sun Jan 29 00:24:40 2006
@@ -148,7 +148,9 @@
/// 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 @@
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
Index: llvm/include/llvm/CodeGen/SelectionDAG.h
diff -u llvm/include/llvm/CodeGen/SelectionDAG.h:1.92 llvm/include/llvm/CodeGen/SelectionDAG.h:1.93
--- llvm/include/llvm/CodeGen/SelectionDAG.h:1.92 Sun Jan 29 00:01:13 2006
+++ llvm/include/llvm/CodeGen/SelectionDAG.h Sun Jan 29 00:24:40 2006
@@ -113,6 +113,7 @@
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 @@
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;
Index: llvm/include/llvm/CodeGen/SelectionDAGNodes.h
diff -u llvm/include/llvm/CodeGen/SelectionDAGNodes.h:1.96 llvm/include/llvm/CodeGen/SelectionDAGNodes.h:1.97
--- llvm/include/llvm/CodeGen/SelectionDAGNodes.h:1.96 Fri Jan 27 18:18:27 2006
+++ llvm/include/llvm/CodeGen/SelectionDAGNodes.h Sun Jan 29 00:24:40 2006
@@ -71,9 +71,11 @@
// 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 @@
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 @@
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;
}
};
More information about the llvm-commits
mailing list