[PATCH] D147539: [LV] Enable stride versioning to support Fortran IR

Philip Reames via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Apr 5 07:43:57 PDT 2023


reames added a comment.

JFYI, I find the description on this patch confusing.  I think I've managed to understand it, but let me confirm.

Given an induction variable with a loop invariant (but not constant) stride, LAA currently speculates the stride is 1.  In the case where the access type and the index type differ, this results in a meaningless speculation.  Instead of unconditionally speculating 1, we can speculate that the stride is the constant required to stride sizeof(element-type) on each iteration.

Is that a correct understanding?

Also, why does this depend on the prior patch?  This seems like an independent change.



================
Comment at: llvm/test/Transforms/LoopVectorize/stride-accesses-unit-check-fix.ll:34
+
+; CHECK-LABEL: define void @test_
+; CHECK: vector.scevcheck:
----------------
Please use update_test_checks.py


================
Comment at: llvm/test/Transforms/LoopVectorize/stride-accesses-unit-check-fix.ll:56
+
+.lr.ph:                                           ; preds = %4
+  %7 = zext i32 %5 to i64
----------------
Please reduce this test further.


================
Comment at: llvm/test/Transforms/LoopVectorize/stride-accesses-unit-check-fix.ll:96
+
+!1 = !{!2, !2, i64 0}
+!2 = !{!"any data access", !3, i64 0}
----------------
Please remove stray metadata.


================
Comment at: llvm/test/Transforms/LoopVectorize/stride-accesses-unit-check-fix.ll:102
+!6 = !{!"descriptor member", !3, i64 0}
+
----------------
You definitely need more than one test here.  A few cornercases to consider:
* element type == index type
* element type < index type
* gep with multiple uses


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D147539



More information about the llvm-commits mailing list