[PATCH] D105473: [LV] Ignore candidate VFs with invalid costs.

Dave Green via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jul 7 02:16:15 PDT 2021


dmgreen added inline comments.


================
Comment at: llvm/lib/Transforms/Vectorize/LoopVectorize.cpp:6094-6096
     // Notice that the vector loop needs to be executed less times, so
     // we need to divide the cost of the vector loops by the width of
     // the vector elements.
----------------
Is this comment still useful? It doesn't seem to relate to the code here.


================
Comment at: llvm/lib/Transforms/Vectorize/LoopVectorize.cpp:6105-6106
+         << " because of instructions with invalid cost:\n";
+      for (const auto *I : InvalidCosts)
+        OS << "\t" << *I << "\n";
+      OS.flush();
----------------
Do we usually add llvm instructions to optimization reports? Or do they usually use debug info for anything they print?


================
Comment at: llvm/lib/Transforms/Vectorize/LoopVectorize.cpp:8040-8041
+    if (!CM.hasInvalidCosts(UserVF)) {
+      LLVM_DEBUG(dbgs() << "LV: Using "
+                        << "user VF " << UserVF << ".\n");
+      CM.collectInLoopReductions();
----------------
Reflow comment.

Will this work for reductions if it's placed here? Can an inloop reduction have an invalid cost? Or are they OK because there is a target hook for them?


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D105473/new/

https://reviews.llvm.org/D105473



More information about the llvm-commits mailing list