[PATCH] D51993: TableGen/CodeGenDAGPatterns: addPredicateFn only once
Nicolai Hähnle via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed Sep 12 09:52:58 PDT 2018
nhaehnle created this revision.
nhaehnle added reviewers: arsenm, rampitec, RKSimon, craig.topper, hfinkel, uweigand.
Herald added a subscriber: wdng.
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
Repository:
rL LLVM
https://reviews.llvm.org/D51993
Files:
utils/TableGen/CodeGenDAGPatterns.cpp
utils/TableGen/CodeGenDAGPatterns.h
Index: utils/TableGen/CodeGenDAGPatterns.h
===================================================================
--- utils/TableGen/CodeGenDAGPatterns.h
+++ utils/TableGen/CodeGenDAGPatterns.h
@@ -673,8 +673,8 @@
}
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; }
Index: utils/TableGen/CodeGenDAGPatterns.cpp
===================================================================
--- utils/TableGen/CodeGenDAGPatterns.cpp
+++ utils/TableGen/CodeGenDAGPatterns.cpp
@@ -3037,13 +3037,6 @@
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");
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D51993.165107.patch
Type: text/x-patch
Size: 1334 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180912/e22646dc/attachment.bin>
More information about the llvm-commits
mailing list