[PATCH] D83034: [GlobalISel] Don't skip adding predicate matcher
Madhur Amilkanthwar via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu Jul 2 05:52:48 PDT 2020
madhur13490 updated this revision to Diff 275077.
madhur13490 added a comment.
Fix test failures
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D83034/new/
https://reviews.llvm.org/D83034
Files:
llvm/utils/TableGen/GlobalISelEmitter.cpp
Index: llvm/utils/TableGen/GlobalISelEmitter.cpp
===================================================================
--- llvm/utils/TableGen/GlobalISelEmitter.cpp
+++ llvm/utils/TableGen/GlobalISelEmitter.cpp
@@ -3561,6 +3561,7 @@
for (const TreePredicateCall &Call : Src->getPredicateCalls()) {
const TreePredicateFn &Predicate = Call.Fn;
+ bool HasPredicateCode = false;
if (Predicate.isAlwaysTrue())
continue;
@@ -3569,6 +3570,11 @@
continue;
}
+ if (Predicate.hasGISelPredicateCode()) {
+ HasPredicateCode = true;
+ InsnMatcher.addPredicate<GenericInstructionPredicateMatcher>(Predicate);
+ }
+
// An address space check is needed in all contexts if there is one.
if (Predicate.isLoad() || Predicate.isStore() || Predicate.isAtomic()) {
if (const ListInit *AddrSpaces = Predicate.getAddressSpaces()) {
@@ -3705,14 +3711,9 @@
continue;
}
}
-
- if (Predicate.hasGISelPredicateCode()) {
- InsnMatcher.addPredicate<GenericInstructionPredicateMatcher>(Predicate);
- continue;
- }
-
- return failedImport("Src pattern child has predicate (" +
- explainPredicates(Src) + ")");
+ if (!HasPredicateCode)
+ return failedImport("Src pattern child has predicate (" +
+ explainPredicates(Src) + ")");
}
if (SrcGIEquivOrNull && SrcGIEquivOrNull->getValueAsBit("CheckMMOIsNonAtomic"))
InsnMatcher.addPredicate<AtomicOrderingMMOPredicateMatcher>("NotAtomic");
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D83034.275077.patch
Type: text/x-patch
Size: 1529 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200702/0be77d79/attachment.bin>
More information about the llvm-commits
mailing list