[PATCH] D81345: [LV] Vectorize without versioning-for-unit-stride under -Os/-Oz
Ayal Zaks via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Sat Jun 13 23:26:04 PDT 2020
Ayal marked an inline comment as done.
Ayal added inline comments.
Herald added a subscriber: bmahjour.
================
Comment at: llvm/lib/Analysis/LoopAccessAnalysis.cpp:1821
+ const bool EnableMemAccessVersioningOfLoop =
+ EnableMemAccessVersioning &&
----------------
fhahn wrote:
> I think it might be slightly preferable to let LV drive the decision whether to version or not based on cost estimates (and LAA is used by other passes as well, which might have different requirements).
>
> Did you consider disabling generating the codes for (I think it should happen `emitSCEVChecks`) conditionally on optsize? IIUC we should only need to generate code for predicates, if either we need runtime checks or have symbolic strides. And runtime checks are already rejected in `runtimeChecksRequired`.
Would it be better if LV passes a "only one copy of the loop is allowed" flag to analyzeLoop(), via the constructor of LAI, instead of the latter checking for OptSize? This requirement of OptSize is common to all other passes, right?
Suppressing emitSCEVChecks would appease the assert, but LAI should refrain from collecting Strided Accesses in order (for getPtrStride()) to consider related accesses as non-unit strided accesses. It already does so under a cl::opt flag, for all its users.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D81345/new/
https://reviews.llvm.org/D81345
More information about the llvm-commits
mailing list