fhahn accepted this revision.
fhahn added a comment.

LGTM with additional suggestions inline, thanks!



================
Comment at: llvm/lib/Transforms/Vectorize/LoopVectorize.cpp:10462
+    } else {
+      ORE->emit([&]() {
+        return OptimizationRemarkAnalysisAliasing(
----------------
I think we usually try to use early exits to reduce the indentation, so it 
might be worth doing something like 

```
if (LVP.requiresTooManyRuntimeChecks()) {
 ORE->emit([&]() {
        return OptimizationRemarkAnalysisAliasing(
                   DEBUG_TYPE, "CantReorderMemOps", L->getStartLoc(),
                   L->getHeader())
               << "loop not vectorized: cannot prove it is safe to reorder "
                  "memory operations";
      });
      LLVM_DEBUG(dbgs() << "LV: Too many memory checks needed.\n");
      Hints.emitRemarkWithHints();
      return false;
}

// Select the interleave count.
 IC = CM.selectInterleaveCount(VF.Width, *VF.Cost.getValue());
```

(this has the added benefit of not checking for 
`!LVP.requiresTooManyRuntimeChecks()` but the unnegated version, which is 
slightly more straight forward)


================
Comment at: 
llvm/test/Transforms/LoopVectorize/PowerPC/interleaved-pointer-runtime-check-unprofitable.ll:3
+ 
+; The case will do aggressive interleave on PowerPC, resulting in a lot of 
memory checks.
+; (On the A2, always unroll aggressively. In fact, if aggressive interleaving 
is enabled,
----------------
Might be good to precommit the test case and then just show the difference in 
this diff (without the fix `; CHECK: vector.memcheck`) 


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D122126

_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to