[llvm] [LoopVectorize] Check for vector-to-scalar casts in legalizer (PR #106244)

via llvm-commits llvm-commits at lists.llvm.org
Tue Aug 27 12:32:16 PDT 2024


================
@@ -0,0 +1,32 @@
+; RUN: opt --force-widen-divrem-via-safe-divisor=false -passes=loop-vectorize -S --debug-only=loop-vectorize < %s 2>&1 | FileCheck %s
----------------
ErikHogeman wrote:

> Missing REQUIRES: asserts, since we're checking debug strings.

Thanks, I will take a look.

> Would be good to wrap this line like:
> 
> ```
> RUN: opt ... \
> RUN:   ... | Filecheck %s
> ```

Will try to rewrite.

> Is the `--force-widen-divrem-via-safe-divisor=false` needed?

Kind of, the assert triggered by the test I wrote happens in the "computePredInstDiscount" code path, which depends on the result of "isScalarWithPredication", and there it has some target specific heuristics. I was able to reproduce it without this flag on some targets, but it seemed more robust to just force the code path that triggers the assert rather than depend on the target specific heuristics which I assume could be changed at any time.

https://github.com/llvm/llvm-project/pull/106244


More information about the llvm-commits mailing list