[PATCH] D38722: Added Remarks for Loop Versioning LICM Pass

Deepak Porwal via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Nov 27 03:42:27 PST 2017


Deepak_Porwal marked 2 inline comments as done.
Deepak_Porwal added inline comments.


================
Comment at: lib/Transforms/Scalar/LoopVersioningLICM.cpp:438-452
     DEBUG(dbgs()
           << "    Invariant load & store are less then defined threshold\n");
     DEBUG(dbgs() << "    Invariant loads & stores: "
                  << ((InvariantCounter * 100) / LoadAndStoreCounter) << "%\n");
     DEBUG(dbgs() << "    Invariant loads & store threshold: "
                  << InvariantThreshold << "%\n");
+    ORE->emit([&]() {
----------------
eastig wrote:
> The message reported here is quite tricky. What I understand is: per cent of invariant memory operations in less then threshold per cent.
> NV does not support FP values. Maybe it's better to add it instead of truncating 'static_cast<int>(InvariantThreshold)'. Diagnostics in this way do not provide actual information.
I am not sure how to support FP value in NV


================
Comment at: lib/Transforms/Scalar/LoopVersioningLICM.cpp:496-500
+    ORE->emit([&]() {
+      return OptimizationRemarkMissed(DEBUG_TYPE, "IllegalLoopInst",
+                               CurLoop->getStartLoc(), CurLoop->getHeader())
+          << " Loop instructions not suitable for LoopVersioningLICM";
+        });
----------------
eastig wrote:
> Do we need this remark here because remarks related to legality of instructions have already been emitted?
We can keep this as it is informing about current loop location for the instruction.


================
Comment at: lib/Transforms/Scalar/LoopVersioningLICM.cpp:507-511
+    ORE->emit([&]() {
+        return OptimizationRemarkMissed(DEBUG_TYPE, "IllegalLoopMemoryAccess",
+                                 CurLoop->getStartLoc(), CurLoop->getHeader())
+        << " Illegal Loop memory access";
+    });
----------------
eastig wrote:
> Maybe legalLoopMemoryAccesses should emit remarks?
It's difficult to emit remark from legalLoopMemoryAccesses as we don't have current loop info.


Repository:
  rL LLVM

https://reviews.llvm.org/D38722





More information about the llvm-commits mailing list