diff options
| author | Nicolai Haehnle <nhaehnle@gmail.com> | 2018-10-08 16:53:31 +0000 |
|---|---|---|
| committer | Nicolai Haehnle <nhaehnle@gmail.com> | 2018-10-08 16:53:31 +0000 |
| commit | 46c91fd2331daf722bc1eca141e6b81d54734766 (patch) | |
| tree | f18e78a2ad89327bcac0ecd756c142112f411f13 /llvm/utils | |
| parent | 8dd92482cef311312dc238936cdfeb372f68d4f5 (diff) | |
| download | bcm5719-llvm-46c91fd2331daf722bc1eca141e6b81d54734766.tar.gz bcm5719-llvm-46c91fd2331daf722bc1eca141e6b81d54734766.zip | |
TableGen/CodeGenDAGPatterns: addPredicateFn only once
Summary:
The predicate function is added in InlinePatternFragments, no need to
do it here. As a result, all uses of addPredicateFn are located in
InlinePatternFragments.
Test confirmed that there are no changes to generated files when
building all (non-experimental) targets.
Change-Id: I720e42e045ca596eb0aa339fb61adf6fe71034d5
Reviewers: arsenm, rampitec, RKSimon, craig.topper, hfinkel, uweigand
Subscribers: wdng, llvm-commits
Differential Revision: https://reviews.llvm.org/D51993
llvm-svn: 343977
Diffstat (limited to 'llvm/utils')
| -rw-r--r-- | llvm/utils/TableGen/CodeGenDAGPatterns.cpp | 7 | ||||
| -rw-r--r-- | llvm/utils/TableGen/CodeGenDAGPatterns.h | 4 |
2 files changed, 2 insertions, 9 deletions
diff --git a/llvm/utils/TableGen/CodeGenDAGPatterns.cpp b/llvm/utils/TableGen/CodeGenDAGPatterns.cpp index ed68b09c265..9a0fac54db1 100644 --- a/llvm/utils/TableGen/CodeGenDAGPatterns.cpp +++ b/llvm/utils/TableGen/CodeGenDAGPatterns.cpp @@ -3037,13 +3037,6 @@ void CodeGenDAGPatterns::ParsePatternFragments(bool OutFrags) { P->error("Operands list does not contain an entry for operand '" + *OperandsSet.begin() + "'!"); - // If there is a code init for this fragment, keep track of the fact that - // this fragment uses it. - TreePredicateFn PredFn(P); - if (!PredFn.isAlwaysTrue()) - for (auto T : P->getTrees()) - T->addPredicateFn(PredFn); - // If there is a node transformation corresponding to this, keep track of // it. Record *Transform = Frag->getValueAsDef("OperandTransform"); diff --git a/llvm/utils/TableGen/CodeGenDAGPatterns.h b/llvm/utils/TableGen/CodeGenDAGPatterns.h index 104feb90792..4e5eaa09461 100644 --- a/llvm/utils/TableGen/CodeGenDAGPatterns.h +++ b/llvm/utils/TableGen/CodeGenDAGPatterns.h @@ -673,8 +673,8 @@ public: } void addPredicateFn(const TreePredicateFn &Fn) { assert(!Fn.isAlwaysTrue() && "Empty predicate string!"); - if (!is_contained(PredicateFns, Fn)) - PredicateFns.push_back(Fn); + assert(!is_contained(PredicateFns, Fn) && "predicate applied recursively"); + PredicateFns.push_back(Fn); } Record *getTransformFn() const { return TransformFn; } |

