[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 20:49:57 PDT 2023


yrouban created this revision.
yrouban added reviewers: hfinkel, reames, craig.topper, fhahn.
Herald added a subscriber: StephenFan.
Herald added a project: All.
yrouban requested review of this revision.
Herald added a subscriber: pcwang-thead.
Herald added a project: LLVM.

The test shows that the interleave count is limited even if there is no local users other than one induction variable.

This test will be changed in the subsequent change D147434 <https://reviews.llvm.org/D147434>.


Repository:
  rG LLVM Github Monorepo

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(double *%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 double * [%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.510990.patch
Type: text/x-patch
Size: 1802 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230405/452f4c6b/attachment.bin>


More information about the llvm-commits mailing list