|
| 1 | +; RUN: opt < %s -debugify -LowerWGScope -S | FileCheck %s |
| 2 | +; |
| 3 | +; Check that debug info is not lost after LowerWGScope pass. |
| 4 | +; Case with private_mem usage. |
| 5 | + |
| 6 | +%struct.snork = type { i8 } |
| 7 | +%struct.wobble = type { %struct.spam, %struct.spam, %struct.spam, %struct.snork.0 } |
| 8 | +%struct.spam = type { %struct.foo } |
| 9 | +%struct.foo = type { [2 x i64] } |
| 10 | +%struct.snork.0 = type { %struct.foo } |
| 11 | +%struct.ham = type { %struct.pluto } |
| 12 | +%struct.pluto = type { i32, i32 } |
| 13 | +%struct.wibble = type { %struct.ham addrspace(4)* } |
| 14 | + |
| 15 | +define internal spir_func void @wibble(%struct.snork addrspace(4)* dereferenceable_or_null(1) %arg, %struct.wobble* byval(%struct.wobble) align 8 %arg1) align 2 !work_group_scope !0 { |
| 16 | +; CHECK-LABEL: define {{[^@]+}}@wibble |
| 17 | +; CHECK-SAME: (%struct.snork addrspace(4)* dereferenceable_or_null(1) [[ARG:%.*]], %struct.wobble* byval(%struct.wobble) align 8 [[ARG1:%.*]]) |
| 18 | +; |
| 19 | +bb: |
| 20 | + %tmp = alloca %struct.snork addrspace(4)*, align 8 |
| 21 | +; CHECK: [[TMP:%.*]] = alloca %struct.snork addrspace(4)*, align 8 |
| 22 | +; CHECK: call void @llvm.dbg.value(metadata %struct.snork addrspace(4)** [[TMP]], [[META9:metadata !.*]], metadata !DIExpression()) |
| 23 | + %tmp2 = addrspacecast %struct.snork addrspace(4)** %tmp to %struct.snork addrspace(4)* addrspace(4)* |
| 24 | +; CHECK: [[TMP2:%.*]] = addrspacecast %struct.snork addrspace(4)** [[TMP]] to %struct.snork addrspace(4)* addrspace(4)* |
| 25 | +; CHECK: call void @llvm.dbg.value(metadata %struct.snork addrspace(4)* addrspace(4)* [[TMP2]], [[META11:metadata !.*]], metadata !DIExpression()) |
| 26 | + %tmp3 = alloca %struct.ham, align 4, !work_item_scope !0 |
| 27 | +; CHECK: [[TMP3:%.*]] = alloca %struct.ham, align 4, [[DBG24:!dbg !.*]], !work_item_scope !2 |
| 28 | +; CHECK: call void @llvm.dbg.value(metadata %struct.ham* [[TMP3]], [[META12:metadata !.*]], metadata !DIExpression()) |
| 29 | + %tmp4 = addrspacecast %struct.ham* %tmp3 to %struct.ham addrspace(4)* |
| 30 | +; CHECK: [[TMP4:%.*]] = addrspacecast %struct.ham* [[TMP3]] to %struct.ham addrspace(4)* |
| 31 | +; CHECK: call void @llvm.dbg.value(metadata %struct.ham addrspace(4)* [[TMP4]], [[META13:metadata !.*]], metadata !DIExpression()) |
| 32 | + %tmp5 = alloca %struct.spam, align 8 |
| 33 | +; CHECK: [[TMP5:%.*]] = alloca %struct.spam, align 8 |
| 34 | +; CHECK: call void @llvm.dbg.value(metadata %struct.spam* [[TMP5]], [[META14:metadata !.*]], metadata !DIExpression()) |
| 35 | + %tmp6 = addrspacecast %struct.spam* %tmp5 to %struct.spam addrspace(4)* |
| 36 | +; CHECK: [[TMP6:%.*]] = addrspacecast %struct.spam* [[TMP5]] to %struct.spam addrspace(4)* |
| 37 | +; CHECK: call void @llvm.dbg.value(metadata %struct.spam addrspace(4)* [[TMP6]], [[META15:metadata !.*]], metadata !DIExpression()) |
| 38 | + %tmp7 = alloca %struct.wibble, align 8 |
| 39 | +; CHECK: [[TMP7:%.*]] = alloca %struct.wibble, align 8 |
| 40 | +; CHECK: call void @llvm.dbg.value(metadata %struct.wibble* [[TMP7]], [[META16:metadata !.*]], metadata !DIExpression()) |
| 41 | + %tmp8 = addrspacecast %struct.wibble* %tmp7 to %struct.wibble addrspace(4)* |
| 42 | +; CHECK: [[TMP8:%.*]] = addrspacecast %struct.wibble* [[TMP7]] to %struct.wibble addrspace(4)* |
| 43 | +; CHECK: call void @llvm.dbg.value(metadata %struct.wibble addrspace(4)* [[TMP8]], [[META17:metadata !.*]], metadata !DIExpression()) |
| 44 | + store %struct.snork addrspace(4)* %arg, %struct.snork addrspace(4)* addrspace(4)* %tmp2, align 8 |
| 45 | + %tmp9 = addrspacecast %struct.wobble* %arg1 to %struct.wobble addrspace(4)* |
| 46 | +; CHECK: [[TMP9:%.*]] = addrspacecast %struct.wobble* [[ARG1]] to %struct.wobble addrspace(4)* |
| 47 | +; CHECK: call void @llvm.dbg.value(metadata %struct.wobble addrspace(4)* [[TMP9]], [[META18:metadata !.*]], metadata !DIExpression()) |
| 48 | + call spir_func void @eggs(%struct.ham addrspace(4)* dereferenceable_or_null(8) %tmp4, %struct.wobble addrspace(4)* align 8 dereferenceable(64) %tmp9) |
| 49 | + call spir_func void @snork(%struct.spam addrspace(4)* dereferenceable_or_null(16) %tmp6, i64 7, i64 3) |
| 50 | + %tmp10 = getelementptr inbounds %struct.wibble, %struct.wibble addrspace(4)* %tmp8, i32 0, i32 0 |
| 51 | +; CHECK: [[TMP10:%.*]] = getelementptr inbounds %struct.wibble, %struct.wibble addrspace(4)* [[TMP8]], i32 0, i32 0 |
| 52 | +; CHECK: call void @llvm.dbg.value(metadata %struct.ham addrspace(4)* addrspace(4)* [[TMP10]], [[META19:metadata !.*]], metadata !DIExpression()) |
| 53 | + store %struct.ham addrspace(4)* %tmp4, %struct.ham addrspace(4)* addrspace(4)* %tmp10, align 8 |
| 54 | + %tmp11 = addrspacecast %struct.spam addrspace(4)* %tmp6 to %struct.spam* |
| 55 | +; CHECK: [[TMP11:%.*]] = addrspacecast %struct.spam addrspace(4)* [[TMP6]] to %struct.spam* |
| 56 | +; CHECK: call void @llvm.dbg.value(metadata %struct.spam* [[TMP11]], [[META20:metadata !.*]], metadata !DIExpression()) |
| 57 | + %tmp12 = addrspacecast %struct.wibble addrspace(4)* %tmp8 to %struct.wibble* |
| 58 | + call spir_func void @wombat(%struct.wobble addrspace(4)* dereferenceable_or_null(64) %tmp9, %struct.spam* byval(%struct.spam) align 8 %tmp11, %struct.wibble* byval(%struct.wibble) align 8 %tmp12) |
| 59 | +; CHECK: [[TMP12:%.*]] = addrspacecast %struct.wibble addrspace(4)* [[TMP8]] to %struct.wibble* |
| 60 | +; CHECK: call void @llvm.dbg.value(metadata %struct.wibble* [[TMP12]], [[META21:metadata !.*]], metadata !DIExpression()) |
| 61 | + ret void |
| 62 | +} |
| 63 | + |
| 64 | +define linkonce_odr dso_local spir_func void @eggs(%struct.ham addrspace(4)* dereferenceable_or_null(8) %arg, %struct.wobble addrspace(4)* align 8 dereferenceable(64) %arg1) align 2 { |
| 65 | +bb: |
| 66 | + ret void |
| 67 | +} |
| 68 | + |
| 69 | +define internal spir_func void @wombat(%struct.wobble addrspace(4)* dereferenceable_or_null(64) %arg, %struct.spam* byval(%struct.spam) align 8 %arg1, %struct.wibble* byval(%struct.wibble) align 8 %arg2) align 2 !work_item_scope !0 !parallel_for_work_item !0 { |
| 70 | +bb: |
| 71 | +; CHECK: call void @llvm.dbg.value(metadata i32 0, [[META42:metadata !.*]], metadata !DIExpression()) |
| 72 | + ret void |
| 73 | +} |
| 74 | + |
| 75 | +define linkonce_odr dso_local spir_func void @snork(%struct.spam addrspace(4)* dereferenceable_or_null(16) %arg, i64 %arg1, i64 %arg2) align 2 { |
| 76 | +bb: |
| 77 | + ret void |
| 78 | +} |
| 79 | + |
| 80 | +!0 = !{} |
0 commit comments