|
| 1 | +; RUN: opt -enable-new-pm=0 -localaccessortosharedmemory -sycl-enable-local-accessor %s -S -o - | FileCheck %s |
| 2 | +; ModuleID = 'multiple-annotations.bc' |
| 3 | +source_filename = "multiple-annotations.ll" |
| 4 | +target datalayout = "e-i64:64-i128:128-v16:16-v32:32-n16:32:64" |
| 5 | +target triple = "nvptx64-nvidia-cuda" |
| 6 | + |
| 7 | +; This test checks that the transformation is applied in the basic case with multiple identical annotations nodes. |
| 8 | + |
| 9 | +; CHECK: @_ZTS14example_kernel_shared_mem = external addrspace(3) global [0 x i8], align 4 |
| 10 | + |
| 11 | +; Function Attrs: noinline |
| 12 | +define weak_odr dso_local void @_ZTS14example_kernel(i32 addrspace(3)* %a, i32 addrspace(1)* %b, i32 %c) { |
| 13 | +; CHECK: define weak_odr dso_local void @_ZTS14example_kernel(i32 %0, i32 addrspace(1)* %b, i32 %c) { |
| 14 | +entry: |
| 15 | +; CHECK: %1 = getelementptr inbounds [0 x i8], [0 x i8] addrspace(3)* @_ZTS14example_kernel_shared_mem, i32 0, i32 %0 |
| 16 | +; CHECK: %a = bitcast i8 addrspace(3)* %1 to i32 addrspace(3)* |
| 17 | + %0 = load i32, i32 addrspace(3)* %a |
| 18 | +; CHECK: %2 = load i32, i32 addrspace(3)* %a |
| 19 | + %1 = load i32, i32 addrspace(1)* %b |
| 20 | +; CHECK: %3 = load i32, i32 addrspace(1)* %b |
| 21 | + %2 = add i32 %c, %c |
| 22 | +; CHECK: %4 = add i32 %c, %c |
| 23 | + ret void |
| 24 | +} |
| 25 | + |
| 26 | +!nvvm.annotations = !{!0, !0} |
| 27 | +!nvvmir.version = !{!5} |
| 28 | + |
| 29 | +!0 = distinct !{void (i32 addrspace(3)*, i32 addrspace(1)*, i32)* @_ZTS14example_kernel, !"kernel", i32 1} |
| 30 | +; CHECK: !0 = distinct !{void (i32, i32 addrspace(1)*, i32)* @_ZTS14example_kernel, !"kernel", i32 1} |
| 31 | +!1 = !{null, !"align", i32 8} |
| 32 | +!2 = !{null, !"align", i32 8, !"align", i32 65544, !"align", i32 131080} |
| 33 | +!3 = !{null, !"align", i32 16} |
| 34 | +!4 = !{null, !"align", i32 16, !"align", i32 65552, !"align", i32 131088} |
| 35 | +!5 = !{i32 1, i32 4} |
0 commit comments