[PATCH] D43796: [GISel]: Print useful remarks when GISelAbort = 1

Aditya Nandakumar via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Feb 26 17:18:07 PST 2018


aditya_nandakumar created this revision.
aditya_nandakumar added reviewers: qcolombet, aemerson, dsanders, bogner, rovka, ab.
Herald added a subscriber: fhahn.

Currently when abort is enabled, we get a diagnostic saying "Fallback path used .... " and the program terminates. To actually figure out what the reason is, we need to run again with another verbose argument "-pass-remarks-missed=gisel".
Because we know we're going to call report_fatal_error(), this patch prints the reason for fallback and this is a lot more useful than the warning diagnostic above. Also, this won't really be a compile time issue.


Repository:
  rL LLVM

https://reviews.llvm.org/D43796

Files:
  lib/CodeGen/GlobalISel/Utils.cpp


Index: lib/CodeGen/GlobalISel/Utils.cpp
===================================================================
--- lib/CodeGen/GlobalISel/Utils.cpp
+++ lib/CodeGen/GlobalISel/Utils.cpp
@@ -168,7 +168,7 @@
                                     MI.getDebugLoc(), MI.getParent());
   R << Msg;
   // Printing MI is expensive;  only do it if expensive remarks are enabled.
-  if (MORE.allowExtraAnalysis(PassName))
+  if (TPC.isGlobalISelAbortEnabled() || MORE.allowExtraAnalysis(PassName))
     R << ": " << ore::MNV("Inst", MI);
   reportGISelFailure(MF, TPC, MORE, R);
 }


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D43796.136011.patch
Type: text/x-patch
Size: 567 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180227/b40e50d3/attachment-0001.bin>


More information about the llvm-commits mailing list