================
@@ -0,0 +1,172 @@
+; NOTE: Assertions have been autogenerated by utils/update_test_checks.py 
UTC_ARGS: --function-signature --check-attributes --check-globals 
--prefix-filecheck-ir-name true
+; RUN: opt -mtriple=nvptx-unknown-unknown -aa-pipeline=basic-aa 
-passes=attributor -attributor-manifest-internal -attributor-annotate-decl-cs 
-S < %s | FileCheck %s --check-prefix=CHECK
+
+; ModuleID = '/app/example.cu'
+target datalayout = 
"e-p6:32:32-i64:64-i128:128-i256:256-v16:16-v32:32-n16:32:64"
+
+@_ZZ27mcasi_digit_counters_kernelE14shared_storage = internal addrspace(3) 
global [256 x i32] undef, align 4
+
+; Function Attrs: convergent mustprogress noinline norecurse nounwind
+;.
+; CHECK: @_ZZ27mcasi_digit_counters_kernelE14shared_storage = internal 
addrspace(3) global [256 x i32] undef, align 4
+;.
+define dso_local ptx_kernel void @mcasi_digit_counters_kernel(ptr nofree 
noundef writeonly captures(none) %0, ptr nofree noundef readonly captures(none) 
%1, i32 noundef %2) local_unnamed_addr #0 {
+; CHECK: Function Attrs: convergent mustprogress noinline norecurse nounwind
+; CHECK-LABEL: define {{[^@]+}}@mcasi_digit_counters_kernel
+; CHECK-SAME: (ptr nofree noundef writeonly captures(none) [[TMP0:%.*]], ptr 
nofree noundef readonly captures(none) [[TMP1:%.*]], i32 noundef [[TMP2:%.*]]) 
local_unnamed_addr #[[ATTR0:[0-9]+]] {
+; CHECK-NEXT:    [[TMP4:%.*]] = alloca [4 x ptr], align 8
+; CHECK-NEXT:    [[TMP5:%.*]] = tail call noundef i32 
@llvm.nvvm.read.ptx.sreg.tid.x() #[[ATTR4:[0-9]+]]
+; CHECK-NEXT:    [[TMP6:%.*]] = icmp samesign ult i32 [[TMP5]], 256
+; CHECK-NEXT:    br i1 [[TMP6]], label [[TMP7:%.*]], label [[TMP14:%.*]]
+; CHECK:       7:
+; CHECK-NEXT:    [[TMP8:%.*]] = zext nneg i32 [[TMP5]] to i64
+; CHECK-NEXT:    [[TMP9:%.*]] = getelementptr inbounds nuw [4 x i8], ptr 
[[TMP1]], i64 [[TMP8]]
+; CHECK-NEXT:    [[TMP10:%.*]] = addrspacecast ptr [[TMP9]] to ptr addrspace(1)
+; CHECK-NEXT:    [[TMP11:%.*]] = load i32, ptr addrspace(1) [[TMP10]], align 4
+; CHECK-NEXT:    [[TMP12:%.*]] = getelementptr inbounds nuw [4 x i8], ptr 
addrspacecast (ptr addrspace(3) 
@_ZZ27mcasi_digit_counters_kernelE14shared_storage to ptr), i64 [[TMP8]]
+; CHECK-NEXT:    [[TMP13:%.*]] = addrspacecast ptr [[TMP12]] to ptr 
addrspace(3)
+; CHECK-NEXT:    store i32 [[TMP11]], ptr addrspace(3) [[TMP13]], align 4
+; CHECK-NEXT:    br label [[TMP14]]
+; CHECK:       14:
+; CHECK-NEXT:    tail call void @llvm.nvvm.barrier.cta.sync.aligned.all(i32 
noundef 0)
+; CHECK-NEXT:    call void @llvm.lifetime.start.p0(ptr noalias nofree noundef 
nonnull align 8 captures(none) dereferenceable(32) [[TMP4]]) #[[ATTR5:[0-9]+]]
+; CHECK-NEXT:    [[TMP15:%.*]] = shl nuw nsw i32 [[TMP5]], 2
+; CHECK-NEXT:    [[TMP16:%.*]] = and i32 [[TMP15]], 124
+; CHECK-NEXT:    [[TMP17:%.*]] = zext nneg i32 [[TMP16]] to i64
+; CHECK-NEXT:    [[TMP18:%.*]] = getelementptr inbounds nuw [4 x i8], ptr 
addrspacecast (ptr addrspace(3) 
@_ZZ27mcasi_digit_counters_kernelE14shared_storage to ptr), i64 [[TMP17]]
+; CHECK-NEXT:    [[TMP19:%.*]] = addrspacecast ptr [[TMP4]] to ptr addrspace(5)
+; CHECK-NEXT:    store ptr [[TMP18]], ptr addrspace(5) [[TMP19]], align 8
+; CHECK-NEXT:    [[TMP20:%.*]] = getelementptr inbounds nuw i8, ptr [[TMP18]], 
i64 4
+; CHECK-NEXT:    [[TMP21:%.*]] = getelementptr inbounds nuw i8, ptr [[TMP4]], 
i64 8
+; CHECK-NEXT:    [[TMP22:%.*]] = addrspacecast ptr [[TMP21]] to ptr 
addrspace(5)
+; CHECK-NEXT:    store ptr [[TMP20]], ptr addrspace(5) [[TMP22]], align 8
+; CHECK-NEXT:    [[TMP23:%.*]] = getelementptr inbounds nuw i8, ptr [[TMP18]], 
i64 8
+; CHECK-NEXT:    [[TMP24:%.*]] = getelementptr inbounds nuw i8, ptr [[TMP4]], 
i64 16
+; CHECK-NEXT:    [[TMP25:%.*]] = addrspacecast ptr [[TMP24]] to ptr 
addrspace(5)
+; CHECK-NEXT:    store ptr [[TMP23]], ptr addrspace(5) [[TMP25]], align 8
+; CHECK-NEXT:    [[TMP26:%.*]] = getelementptr inbounds nuw i8, ptr [[TMP18]], 
i64 12
+; CHECK-NEXT:    [[TMP27:%.*]] = getelementptr inbounds nuw i8, ptr [[TMP4]], 
i64 24
+; CHECK-NEXT:    [[TMP28:%.*]] = addrspacecast ptr [[TMP27]] to ptr 
addrspace(5)
+; CHECK-NEXT:    store ptr [[TMP26]], ptr addrspace(5) [[TMP28]], align 8
+; CHECK-NEXT:    [[TMP29:%.*]] = and i32 [[TMP2]], 3
+; CHECK-NEXT:    [[TMP30:%.*]] = zext nneg i32 [[TMP29]] to i64
+; CHECK-NEXT:    [[TMP31:%.*]] = getelementptr inbounds nuw [8 x i8], ptr 
[[TMP4]], i64 [[TMP30]]
+; CHECK-NEXT:    [[TMP32:%.*]] = addrspacecast ptr [[TMP31]] to ptr 
addrspace(5)
+; CHECK-NEXT:    [[TMP33:%.*]] = load ptr, ptr addrspace(5) [[TMP32]], align 8
+; CHECK-NEXT:    [[TMP34:%.*]] = addrspacecast ptr [[TMP33]] to ptr 
addrspace(3)
+; CHECK-NEXT:    [[TMP35:%.*]] = load i32, ptr addrspace(3) [[TMP34]], align 
4, !invariant.load [[META15:![0-9]+]]
+; CHECK-NEXT:    [[TMP36:%.*]] = add i32 [[TMP35]], [[TMP29]]
+; CHECK-NEXT:    [[TMP37:%.*]] = zext nneg i32 [[TMP5]] to i64
+; CHECK-NEXT:    [[TMP38:%.*]] = getelementptr inbounds nuw [4 x i8], ptr 
[[TMP0]], i64 [[TMP37]]
+; CHECK-NEXT:    [[TMP39:%.*]] = addrspacecast ptr [[TMP38]] to ptr 
addrspace(1)
+; CHECK-NEXT:    store i32 [[TMP36]], ptr addrspace(1) [[TMP39]], align 4
+; CHECK-NEXT:    call void @llvm.lifetime.end.p0(ptr noalias nofree noundef 
nonnull align 8 captures(none) dereferenceable(32) [[TMP4]]) #[[ATTR5]]
+; CHECK-NEXT:    ret void
+;
+  %4 = alloca [4 x ptr], align 8
----------------
arsenm wrote:

Named values 

https://github.com/llvm/llvm-project/pull/207866
_______________________________________________
llvm-branch-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits

Reply via email to