diff options
author | Evan Cheng <evan.cheng@apple.com> | 2006-03-07 08:31:27 +0000 |
---|---|---|
committer | Evan Cheng <evan.cheng@apple.com> | 2006-03-07 08:31:27 +0000 |
commit | 6f8aaf2cb0f2e4d01680e67d365137cf731ad809 (patch) | |
tree | 35aac2298637e1f96142c71d8a6bcdfe2d2f9d42 | |
parent | 3acbe5d4f0d6163cb761368692c830c1a4f27e31 (diff) |
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
-rw-r--r-- | utils/TableGen/DAGISelEmitter.cpp | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/utils/TableGen/DAGISelEmitter.cpp b/utils/TableGen/DAGISelEmitter.cpp index 872f08cc3b..a50827e735 100644 --- a/utils/TableGen/DAGISelEmitter.cpp +++ b/utils/TableGen/DAGISelEmitter.cpp @@ -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))"); + } } } |