[PATCH] D29743: [GlobalISel] Separate the SelectionDAG importer from the emitter. NFC: alternative using Expected<>

Daniel Sanders via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Feb 9 02:39:22 PST 2017


dsanders accepted this revision.
dsanders added a comment.
This revision is now accepted and ready to land.

This will LGTM with the emitted separated from the importer like https://reviews.llvm.org/D29709 was.

I mentioned it on https://reviews.llvm.org/D29709 but just to mention it here. I'm not completely sure that runOnPattern() doesn't need to produce multiple rules for a single pattern at the moment but the original use case (commutativity) looks like it will be better handled in InstructionMatcher.



================
Comment at: utils/TableGen/GlobalISelEmitter.cpp:409
   if (!P.getPredicates()->getValues().empty())
-    return SkipReason{"Pattern has a predicate"};
+    return skipBecause("Pattern has a predicate");
 
----------------
Would this make more sense as ImportError()?


================
Comment at: utils/TableGen/GlobalISelEmitter.cpp:548-550
+
+    MatcherOrErr->emit(OS);
+    ++NumPatternEmitted;
----------------
The main aim of D29709 was to separate the importer from the emitter so that there can be a sort inserted between them. As such, this needs to be in a separate loop that iterates over the whole rule-set.


https://reviews.llvm.org/D29743





More information about the llvm-commits mailing list