[PATCH] D129473: [LV] Make scalable-vectorization not work if there is a specified scalable pragma hint.

Sander de Smalen via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jul 11 05:18:16 PDT 2022


sdesmalen added subscribers: paulwalker-arm, fhahn, reames.
sdesmalen added a comment.

When compiling the following example with your patch applied and passing `-mllvm -scalable-vectorization=off`, the loop still vectorizes using scalable vectors:

  void foo(int * restrict dst, int * src, int N) {
    #pragma clang loop vectorize_width(4, scalable)
    for (int i=0; i<N; ++i)
      dst[i] = src[i] + 42;
  }

The idea behind giving this flag highest priority was to give users the ability to blanket disable scalable VFs in case they find any issues, since they're still a relatively new feature compared to fixed-width vectors. e.g. https://godbolt.org/z/fE8Exjos9.

I guess it's not very common for users to write these pragmas and perhaps we want to change it such that the pragma has priority over the (force) flag. If so, it would mean changing the comment on the lines above.
@paulwalker-arm, @reames, @fhahn any thoughts/opinions on this?

@fakepaper56 Could you add a test case guarding the functional change in this patch?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D129473



More information about the llvm-commits mailing list