[PATCH] D35122: [LoopInterchange] Add some optimization remarks.

Adam Nemet via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Jul 7 08:18:02 PDT 2017


anemet added a comment.

Thanks for adding this!



================
Comment at: lib/Transforms/Scalar/LoopInterchange.cpp:596-600
+      ORE->emit(OptimizationRemarkMissed("loop-interchange",
+                                         "InterchangeNotProfitable",
+                                         InnerLoop->getStartLoc(),
+                                         InnerLoop->getHeader())
+                << "Interchanging loops is not profitable.");
----------------
Based on the experience in the inliner, it's helpful to emit the estimated cost and the threshold for such remarks.  Then the user would know how much to lower the threshold, etc.   You may want to issue this in inProfitable.


================
Comment at: lib/Transforms/Scalar/LoopInterchange.cpp:937
+                                       InnerLoop->getHeader())
+              << "Cannot interchange loops due to current limitations.");
     return false;
----------------
"Unable to analyze loop" is probably a better wording.  Alternatively you could emit the specific reasons under currentLimitations().


================
Comment at: test/Transforms/LoopInterchange/loop-interchange-optimization-remarks.ll:58
+
+; MISSED: remark: {{.*}}: Interchanging loops is not profitable.
+
----------------
Either have some minimal source line debug info or use the YAML output (-pass-remarks-output) rather than -pass-remarks= which would have the function name in the remark record.  You should be able to find some examples for both of these approaches in the testsuite.


https://reviews.llvm.org/D35122





More information about the llvm-commits mailing list