[llvm] [LV] Fix unsafe canVectorizeWithIfConvert() checks (PR #203273)
David Sherwood via llvm-commits
llvm-commits at lists.llvm.org
Mon Jun 15 07:19:05 PDT 2026
=?utf-8?q?Gaƫtan?= Bossu <gaetan.bossu at arm.com>
Message-ID:
In-Reply-To: <llvm.org/llvm/llvm-project/pull/203273 at github.com>
================
@@ -0,0 +1,34 @@
+; RUN: opt -S -passes=loop-vectorize -pass-remarks-output=%t.yaml < %s | FileCheck %s
+
+; Enabling remarks forces extra legality analysis on loops with unexpected CFG.
+; Ensure LV does not crash due to the loop having multiple latches.
+; A normal branch gets canonicalized to a unique latch before LV runs, so use
+; indirectbr to keep the invalid CFG shape.
+
+; CHECK-LABEL: define void @multiple_latches_indirectbr(
+define void @multiple_latches_indirectbr() {
+entry:
+ indirectbr ptr null, [label %loop]
----------------
david-arm wrote:
It might be worth making these tests more robust by using non-null pointer values, i.e. use a pointer argument?
https://github.com/llvm/llvm-project/pull/203273
More information about the llvm-commits
mailing list