[llvm] [LV] Add test for tail fold by masking with external IV users. (PR #82329)

Florian Hahn via llvm-commits llvm-commits at lists.llvm.org
Tue Feb 27 08:28:05 PST 2024


================
@@ -0,0 +1,159 @@
+; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --version 4
+; RUN: opt < %s -passes=loop-vectorize -force-vector-width=4 -force-vector-interleave=1 -S | FileCheck %s
+
+; The vectorizer should refuse to fold the tail by masking because
+; %conv is used outside of the loop. Test for this by checking that
+; %n.vec, the vector trip count, is rounded down to the next multiple of
+; 4. If folding the tail, it would have been rounded up instead.
+; Test case for #76069.
+define i32 @test(ptr %arr, i64 %n) {
----------------
fhahn wrote:

Could you add a FIXME here to make clear that this currently gets miscompiled?

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


More information about the llvm-commits mailing list