[llvm] [LV] Return Invalid from getLegacyCost when instruction cost forced. (PR #154543)
Kerry McLaughlin via llvm-commits
llvm-commits at lists.llvm.org
Wed Aug 20 09:44:50 PDT 2025
================
@@ -0,0 +1,24 @@
+; REQUIRES: asserts
+; RUN: opt < %s -passes=loop-vectorize -force-target-instruction-cost=1 -debug-only=loop-vectorize -S -disable-output 2>&1 | FileCheck %s
+target triple = "aarch64-linux-gnu"
+
+define i32 @invalid_legacy_cost(i64 %N) #0 {
+; CHECK: LV: Checking a loop in 'invalid_legacy_cost
+; CHECK: LV: Found an estimated cost of Invalid for VF vscale x 2 For instruction: %0 = alloca i8, i64 0, align 16
+entry:
+ br label %for.body
+
+for.body:
+ %iv = phi i64 [ 0, %entry ], [ %iv.next, %for.body ]
+ %0 = alloca i8, i64 0, align 16
----------------
kmclaughlin-arm wrote:
The alloca came from the original loop in oggenc where I found this issue and it's this instruction which leads to the assert.
I've tried to rewrite the loop using another instruction which will also trigger it, but I haven't found another way.
https://github.com/llvm/llvm-project/pull/154543
More information about the llvm-commits
mailing list