diff --git a/llvm/utils/TableGen/GlobalISelEmitter.cpp b/llvm/utils/TableGen/GlobalISelEmitter.cpp --- a/llvm/utils/TableGen/GlobalISelEmitter.cpp +++ b/llvm/utils/TableGen/GlobalISelEmitter.cpp @@ -3569,6 +3569,11 @@ continue; } + if (Predicate.hasGISelPredicateCode()) { + InsnMatcher.addPredicate(Predicate); + continue; + } + // 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,12 +3710,6 @@ continue; } } - - if (Predicate.hasGISelPredicateCode()) { - InsnMatcher.addPredicate(Predicate); - continue; - } - return failedImport("Src pattern child has predicate (" + explainPredicates(Src) + ")"); }