[PATCH] D157484: [VPlan] Support scalable vectors in outer-loop vectorization

Lou via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Aug 31 02:21:51 PDT 2023


iamlouk marked an inline comment as done.
iamlouk added a comment.

In D157484#4628634 <https://reviews.llvm.org/D157484#4628634>, @fhahn wrote:

> Looks reasonable overall, my only concern is that this adds another codepath to the native path which is already lacking test coverage in general. Do you have any idea/suggestion on how to improve end-to-end test coverage, e.g. in `llvm-test-suite` (could be adding some `SingleSource` tests with loop nests and ` #pragma clang loop vectorize_width(4)`?

Thank you very much for your reply @fhahn! I have a private fork of the llvm-test-suite where I have something similar to this: A subdirectory `VPlanNativePath` in `llvm-test-suite/SingleSource/UnitTests/Vectorizer/` that is only added to the CMake build if the compiler is clang. In that directory, I also add `-mllvm -enable-vplan-native-path` to the CMAKE_C_FLAGS and it contains simple tests that initialise some 1d and 2d arrays, does some operations on them (with loops that have `#pragma clang loop vectorize(enable)` in front of them), and prints the result arrays to stdout (for checking against a reference). If this general approach would be fine with you, I will happily submit patches with the tests that already outer-loop-vectorize with the current upstream functionality!

Might I assume your judgement on D157371 <https://reviews.llvm.org/D157371> (`#pragma [...] interleave_count(2)` for the VPlan-native path) is similar to the comment here?



================
Comment at: llvm/lib/Transforms/Vectorize/LoopVectorize.cpp:7384
+                        << "not supported by the target.\n");
+      reportVectorizationFailure(
+          "Scalable vectorization requested but not supported by the target",
----------------
fhahn wrote:
> Can a test be added for this case?
Thank you for the feedback, I added a second `RUN:` line to `llvm/test/Transforms/LoopVectorize/outer_loop_scalable.ll` where scalable vectors are not enabled and added CHECK lines for the optimization remarks.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D157484



More information about the llvm-commits mailing list