[PATCH] D147588: [LV] Add a test for register pressure estimation. NFC

Yevgeny Rouban via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Apr 4 21:00:07 PDT 2023


yrouban updated this revision to Diff 510992.
yrouban added a comment.

Updated the test to use opaque pointers as suggested by @fhahn.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D147588/new/

https://reviews.llvm.org/D147588

Files:
  llvm/test/Transforms/LoopVectorize/X86/interleave-count.ll


Index: llvm/test/Transforms/LoopVectorize/X86/interleave-count.ll
===================================================================
--- /dev/null
+++ llvm/test/Transforms/LoopVectorize/X86/interleave-count.ll
@@ -0,0 +1,39 @@
+; REQUIRES: asserts
+;
+; RUN: opt -S -passes=loop-vectorize -debug-only=loop-vectorize \
+; RUN:     -mtriple=x86_64-pc_linux -mcpu=cascadelake \
+; RUN:     -force-target-max-vector-interleave=16 -force-target-num-vector-regs=16 \
+; RUN:     %s 2>&1 | FileCheck %s
+
+define void @test(ptr %dst, i64 %len) {
+; CHECK-LABEL: LV: Checking a loop in 'test'
+; CHECK:       LV: IC is 8
+;
+; CHECK-LABEL: define void @test
+;
+; Number of @llvm.masked.scatter() calls is 8.
+; CHECK:         call void @llvm.masked.scatter.v4f64.v4p0(<4 x double>
+; CHECK-NEXT:    call void @llvm.masked.scatter.v4f64.v4p0(<4 x double>
+; CHECK-NEXT:    call void @llvm.masked.scatter.v4f64.v4p0(<4 x double>
+; CHECK-NEXT:    call void @llvm.masked.scatter.v4f64.v4p0(<4 x double>
+; CHECK-NEXT:    call void @llvm.masked.scatter.v4f64.v4p0(<4 x double>
+; CHECK-NEXT:    call void @llvm.masked.scatter.v4f64.v4p0(<4 x double>
+; CHECK-NEXT:    call void @llvm.masked.scatter.v4f64.v4p0(<4 x double>
+; CHECK-NEXT:    call void @llvm.masked.scatter.v4f64.v4p0(<4 x double>
+; CHECK-NOT:     call void @llvm.masked.scatter.v4f64.v4p0(<4 x double>
+;
+entry:
+  %size = shl i64 %len, 3
+  %p.end = getelementptr inbounds double, ptr %dst, i64 %size
+  br label %loop
+
+loop:
+  %p = phi ptr [%dst, %entry], [%p.next, %loop]
+  store double -1.000000e+00, ptr %p, align 8
+  %p.next = getelementptr inbounds double, ptr %p, i64 8
+  %done = icmp eq ptr %p.next, %p.end
+  br i1 %done, label %exit, label %loop, !prof !{!"branch_weights", i32 1, i32 1000000}
+
+exit:
+  ret void
+}


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D147588.510992.patch
Type: text/x-patch
Size: 1793 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230405/85ed1390/attachment.bin>


More information about the llvm-commits mailing list