Don't generate silly matching code like this:

if (N1.getOpcode() == ISD::ADD &&
     ...)
   if (... &&
       (N1.getNumOperands() == 1 || !isNonImmUse(N1.Val, N10.Val))) &&
       ...)

TableGen knows N1 must have more than one operand.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@26592 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Evan Cheng 2006-03-07 08:31:27 +00:00
parent 3acbe5d4f0
commit 6f8aaf2cb0

View File

@ -2006,9 +2006,14 @@ public:
PInfo.hasProperty(SDNodeInfo::SDNPHasChain) ||
PInfo.hasProperty(SDNodeInfo::SDNPInFlag) ||
PInfo.hasProperty(SDNodeInfo::SDNPOptInFlag))
emitCheck("(" + ParentName + ".getNumOperands() == 1 || !" +
"isNonImmUse(" + ParentName + ".Val, " + RootName +
".Val))");
if (PInfo.getNumOperands() > 1) {
emitCheck("!isNonImmUse(" + ParentName + ".Val, " + RootName +
".Val)");
} else {
emitCheck("(" + ParentName + ".getNumOperands() == 1 || !" +
"isNonImmUse(" + ParentName + ".Val, " + RootName +
".Val))");
}
}
}