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

Ramkumar Ramachandra via llvm-commits llvm-commits at lists.llvm.org
Tue Dec 19 03:51:16 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
----------------
artagnon wrote:

Actually, since there is a minimal test case for the crash in X86, I think we can remove this file altogether. Note that the X86 test [doesn't vectorize anything](https://github.com/llvm/llvm-project/pull/74456/files#diff-8b1725ba52f1290cb42ea43d60ea58d638a3b14ae3063e6c7e8caa9fda8a3438), since I've disabled the vector extensions in the RUN line.

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


More information about the llvm-commits mailing list