[llvm] r344506 - AMDGPU: Test showing a scalar buffer load deficiency
Nicolai Haehnle via llvm-commits
llvm-commits at lists.llvm.org
Mon Oct 15 04:37:04 PDT 2018
Author: nha
Date: Mon Oct 15 04:37:04 2018
New Revision: 344506
URL: http://llvm.org/viewvc/llvm-project?rev=344506&view=rev
Log:
AMDGPU: Test showing a scalar buffer load deficiency
Change-Id: I5b64a565f22a8482aa0712488d85e45163ac3d12
Modified:
llvm/trunk/test/CodeGen/AMDGPU/smrd.ll
Modified: llvm/trunk/test/CodeGen/AMDGPU/smrd.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/AMDGPU/smrd.ll?rev=344506&r1=344505&r2=344506&view=diff
==============================================================================
--- llvm/trunk/test/CodeGen/AMDGPU/smrd.ll (original)
+++ llvm/trunk/test/CodeGen/AMDGPU/smrd.ll Mon Oct 15 04:37:04 2018
@@ -511,6 +511,29 @@ main_body:
ret void
}
+; GCN-LABEL: {{^}}smrd_uniform_loop:
+;
+; TODO: this should use an s_buffer_load
+;
+; GCN: buffer_load_dword
+define amdgpu_ps float @smrd_uniform_loop(<4 x i32> inreg %desc, i32 %bound) #0 {
+main_body:
+ br label %loop
+
+loop:
+ %counter = phi i32 [ 0, %main_body ], [ %counter.next, %loop ]
+ %sum = phi float [ 0.0, %main_body ], [ %sum.next, %loop ]
+ %offset = shl i32 %counter, 2
+ %v = call float @llvm.SI.load.const.v4i32(<4 x i32> %desc, i32 %offset)
+ %sum.next = fadd float %sum, %v
+ %counter.next = add i32 %counter, 1
+ %cc = icmp uge i32 %counter.next, %bound
+ br i1 %cc, label %exit, label %loop
+
+exit:
+ ret float %sum.next
+}
+
declare void @llvm.amdgcn.exp.f32(i32, i32, float, float, float, float, i1, i1) #0
declare float @llvm.SI.load.const.v4i32(<4 x i32>, i32) #1
More information about the llvm-commits
mailing list