summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEvan Cheng <evan.cheng@apple.com>2006-07-27 06:36:49 +0000
committerEvan Cheng <evan.cheng@apple.com>2006-07-27 06:36:49 +0000
commit061aba35c1c125b08d5823e92bf46fda61bce4e5 (patch)
tree6c74a3d026f1e7da301f191a103989daf3152bc8
parent93386e02fec09ab3ece66714970495725f74924b (diff)
downloadbcm5719-llvm-061aba35c1c125b08d5823e92bf46fda61bce4e5.tar.gz
bcm5719-llvm-061aba35c1c125b08d5823e92bf46fda61bce4e5.zip
Let each target specific isel provide routine to check if a chain producing node is foldable by another.
llvm-svn: 29335
-rw-r--r--llvm/include/llvm/CodeGen/SelectionDAGISel.h6
-rw-r--r--llvm/utils/TableGen/DAGISelEmitter.cpp10
2 files changed, 7 insertions, 9 deletions
diff --git a/llvm/include/llvm/CodeGen/SelectionDAGISel.h b/llvm/include/llvm/CodeGen/SelectionDAGISel.h
index 397a5d8043d..790f23ba6b0 100644
--- a/llvm/include/llvm/CodeGen/SelectionDAGISel.h
+++ b/llvm/include/llvm/CodeGen/SelectionDAGISel.h
@@ -62,6 +62,10 @@ public:
SelectionDAG &DAG) {
return true;
}
+
+ /// IsFoldableBy - Returns true if the specific operand node N of U can be
+ /// folded during instruction selection?
+ virtual bool IsFoldableBy(SDNode *N, SDNode *U) { return true; }
/// CreateTargetHazardRecognizer - Return a newly allocated hazard recognizer
/// to use for this target when scheduling the DAG.
@@ -111,7 +115,7 @@ protected:
/// by tblgen. Others should not call it.
void SelectInlineAsmMemoryOperands(std::vector<SDOperand> &Ops,
SelectionDAG &DAG);
-
+
private:
SDOperand CopyValueToVirtualRegister(SelectionDAGLowering &SDL,
Value *V, unsigned Reg);
diff --git a/llvm/utils/TableGen/DAGISelEmitter.cpp b/llvm/utils/TableGen/DAGISelEmitter.cpp
index 8a62ed8bc33..c194c47987d 100644
--- a/llvm/utils/TableGen/DAGISelEmitter.cpp
+++ b/llvm/utils/TableGen/DAGISelEmitter.cpp
@@ -2280,14 +2280,8 @@ public:
PInfo.hasProperty(SDNodeInfo::SDNPHasChain) ||
PInfo.hasProperty(SDNodeInfo::SDNPInFlag) ||
PInfo.hasProperty(SDNodeInfo::SDNPOptInFlag))
- if (PInfo.getNumOperands() > 1) {
- emitCheck("!isNonImmUse(" + ParentName + ".Val, " + RootName +
- ".Val)");
- } else {
- emitCheck("(" + ParentName + ".getNumOperands() == 1 || !" +
- "isNonImmUse(" + ParentName + ".Val, " + RootName +
- ".Val))");
- }
+ emitCheck("IsFoldableBy(" + RootName + ".Val, " + ParentName +
+ ".Val)");
}
}
OpenPOWER on IntegriCloud