[llvm] r294082 - [NVPTX] Add tests that invariant vector loads get lowered to ld.global.nc.
Justin Lebar via llvm-commits
llvm-commits at lists.llvm.org
Fri Feb 3 17:54:56 PST 2017
Author: jlebar
Date: Fri Feb 3 19:54:56 2017
New Revision: 294082
URL: http://llvm.org/viewvc/llvm-project?rev=294082&view=rev
Log:
[NVPTX] Add tests that invariant vector loads get lowered to ld.global.nc.
Modified:
llvm/trunk/test/CodeGen/NVPTX/ldg-invariant.ll
Modified: llvm/trunk/test/CodeGen/NVPTX/ldg-invariant.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/NVPTX/ldg-invariant.ll?rev=294082&r1=294081&r2=294082&view=diff
==============================================================================
--- llvm/trunk/test/CodeGen/NVPTX/ldg-invariant.ll (original)
+++ llvm/trunk/test/CodeGen/NVPTX/ldg-invariant.ll Fri Feb 3 19:54:56 2017
@@ -10,6 +10,30 @@ define i32 @ld_global(i32 addrspace(1)*
ret i32 %a
}
+; CHECK-LABEL: @ld_global_v2i32
+define i32 @ld_global_v2i32(<2 x i32> addrspace(1)* %ptr) {
+; CHECK: ld.global.nc.v2.{{[a-z]}}32
+ %a = load <2 x i32>, <2 x i32> addrspace(1)* %ptr, !invariant.load !0
+ %v1 = extractelement <2 x i32> %a, i32 0
+ %v2 = extractelement <2 x i32> %a, i32 1
+ %sum = add i32 %v1, %v2
+ ret i32 %sum
+}
+
+; CHECK-LABEL: @ld_global_v4i32
+define i32 @ld_global_v4i32(<4 x i32> addrspace(1)* %ptr) {
+; CHECK: ld.global.nc.v4.{{[a-z]}}32
+ %a = load <4 x i32>, <4 x i32> addrspace(1)* %ptr, !invariant.load !0
+ %v1 = extractelement <4 x i32> %a, i32 0
+ %v2 = extractelement <4 x i32> %a, i32 1
+ %v3 = extractelement <4 x i32> %a, i32 2
+ %v4 = extractelement <4 x i32> %a, i32 3
+ %sum1 = add i32 %v1, %v2
+ %sum2 = add i32 %v3, %v4
+ %sum3 = add i32 %sum1, %sum2
+ ret i32 %sum3
+}
+
; CHECK-LABEL: @ld_not_invariant
define i32 @ld_not_invariant(i32 addrspace(1)* %ptr) {
; CHECK: ld.global.{{[a-z]}}32
More information about the llvm-commits
mailing list