[llvm] [LV] Return Invalid from getLegacyCost when instruction cost forced. (PR #154543)
Florian Hahn via llvm-commits
llvm-commits at lists.llvm.org
Wed Aug 20 07:31:57 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
+ %arrayidx = getelementptr ptr, ptr null, i64 %iv
----------------
fhahn wrote:
please avoid storing to nullptr, with is UB.
https://github.com/llvm/llvm-project/pull/154543
More information about the llvm-commits
mailing list