[PATCH] D122126: [LoopVectorize] Don't interleave when the number of runtime checks exceeds the threshold

Dave Green via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Mar 23 02:22:01 PDT 2022


dmgreen added a reviewer: fhahn.
dmgreen added inline comments.


================
Comment at: llvm/lib/Transforms/Vectorize/LoopVectorize.cpp:7594
 
+bool LoopVectorizationPlanner::isTooManyRuntimeChecks() {
+  unsigned NumRuntimePointerChecks = Requirements.getNumRuntimePointerChecks();
----------------
isTooManyRuntimeChecks -> hasTooManyRuntimeChecks ?


================
Comment at: llvm/lib/Transforms/Vectorize/LoopVectorize.cpp:7675
   unsigned NumRuntimePointerChecks = Requirements.getNumRuntimePointerChecks();
   if (SelectedVF.Width.getKnownMinValue() > 1 && NumRuntimePointerChecks) {
     bool PragmaThresholdReached =
----------------
Why does this check SelectedVF.Width > 1? Can we just remove it or does that not help?


================
Comment at: llvm/test/Transforms/LoopVectorize/interleaved-pointer-runtime-check-unprofitable.ll:1
+; RUN: opt -mtriple=powerpc64-unknown-linux-gnu -mcpu=a2 -S -loop-vectorize -debug-only=loop-vectorize < %s 2>&1 | FileCheck %s
+
----------------
If you use -debug, it needs to REQUIRES: asserts
It may be a simpler test to just show that the codegen is not vectorized/interleaved though, with a comment explaining that it would be too much overhead.


================
Comment at: llvm/test/Transforms/LoopVectorize/interleaved-pointer-runtime-check-unprofitable.ll:3
+
+; CHECK-LABLE: LV: Checking a loop in "eddy_diff_caleddy_"
+; CHECK: LV: Interleaving is not beneficial.
----------------
CHECK-LABEL


================
Comment at: llvm/test/Transforms/LoopVectorize/interleaved-pointer-runtime-check-unprofitable.ll:10
+
+L.LB7_2232:                                       ; preds = %L.LB7_3015, %L.LB7_2232.preheader
+  br label %vector.ph
----------------
There are quite a lot of extra blocks in this test. Can a lot of them be removed?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D122126



More information about the llvm-commits mailing list