[llvm] [LV] Fix crash when vectorizing function calls with linear args. (PR #76274)

Maciej Gabka via llvm-commits llvm-commits at lists.llvm.org
Thu Dec 28 03:00:35 PST 2023


================
@@ -0,0 +1,31 @@
+; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --filter "call.*foo" --version 4
+; RUN: opt -passes=loop-vectorize,simplifycfg -force-vector-interleave=1 -force-vector-width=2 -S < %s | FileCheck %s
+
+; Make sure the vectorizer does not crash.
----------------
mgabka wrote:

maybe, better to write:
"Test if loop vectorizer can correctly vectorize function calls which do not return a value."

As that is the actual reason for the LV crash.

I am not against having a generic LV test (although I do not think that they are necessary), the TLI mappings are target specific, so either X86 or AArch64, the original tests were added as AArhc64 tests by @huntergr-arm in https://github.com/llvm/llvm-project/pull/73941/files#diff-9e8f66d7297707a074a06db9f068f2bd0cff25d12e4fc07def062d224416aff4
so having a similar test in that file (or moving this test there) could be worth it.

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


More information about the llvm-commits mailing list