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

Adam Nemet via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jul 12 16:42:11 PDT 2017


anemet added inline comments.


================
Comment at: lib/Transforms/Scalar/LoopInterchange.cpp:929-934
+    ORE->emit(OptimizationRemarkMissed(DEBUG_TYPE,
+                                       "CurrentLimitations",
+                                       InnerLoop->getStartLoc(),
+                                       InnerLoop->getHeader())
+              << "Found unsupported instruction between induction variable "
+                 "increment and branch.");
----------------
Indentation seems off, you may want to clang-format the diff.


================
Comment at: lib/Transforms/Scalar/LoopInterchange.cpp:596-600
+      ORE->emit(OptimizationRemarkMissed("loop-interchange",
+                                         "InterchangeNotProfitable",
+                                         InnerLoop->getStartLoc(),
+                                         InnerLoop->getHeader())
+                << "Interchanging loops is not profitable.");
----------------
anemet wrote:
> 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.
Are you planning to address this too?


================
Comment at: test/Transforms/LoopInterchange/loop-interchange-optimization-remarks.ll:58
+
+; MISSED: remark: {{.*}}: Interchanging loops is not profitable.
+
----------------
anemet wrote:
> 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.
This is actually easier to read if you include the full YAML record verbatim rather than just part of the line/record.



https://reviews.llvm.org/D35122





More information about the llvm-commits mailing list