[llvm] LoopVectorize: fix phi cost when it is scalar after vectorization (PR #74456)

Florian Hahn via llvm-commits llvm-commits at lists.llvm.org
Tue Dec 12 09:54:40 PST 2023


================
@@ -0,0 +1,99 @@
+; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --version 4
+; RUN: opt -mtriple=aarch64 -mattr=-sve,+neon -passes=loop-vectorize -S < %s | FileCheck %s
+
+ at h = global i32 0, align 4
+
+define void @test(ptr %p) {
+; CHECK-LABEL: define void @test(
+; CHECK-SAME: ptr [[P:%.*]]) #[[ATTR0:[0-9]+]] {
+; CHECK-NEXT:  entry:
+; CHECK-NEXT:    [[P1:%.*]] = ptrtoint ptr [[P]] to i64
+; CHECK-NEXT:    [[TMP0:%.*]] = add i64 [[P1]], 8
+; CHECK-NEXT:    [[UMAX2:%.*]] = call i64 @llvm.umax.i64(i64 [[TMP0]], i64 add (i64 ptrtoint (ptr @h to i64), i64 1))
+; CHECK-NEXT:    [[TMP1:%.*]] = add i64 [[UMAX2]], -5
----------------
fhahn wrote:

Is it possible to adjust the test so that no SCEV checks are neede?

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


More information about the llvm-commits mailing list