Let each target specific isel provide routine to check if a chain producing node is foldable by another.

llvm-svn: 29335
This commit is contained in:
Evan Cheng 2006-07-27 06:36:49 +00:00
parent 93386e02fe
commit 061aba35c1
2 changed files with 7 additions and 9 deletions

View File

@ -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);

View File

@ -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)");
}
}