Skip to content

Commit

Permalink
Adjust SYCLLowerIR tests to account for the new debug format
Browse files Browse the repository at this point in the history
Calls to llvm.debug.value were changed to debug_value with different syntax
  • Loading branch information
calebwat committed Jun 27, 2024
1 parent 6f707a4 commit 0378786
Show file tree
Hide file tree
Showing 4 changed files with 48 additions and 47 deletions.
10 changes: 5 additions & 5 deletions llvm/test/SYCLLowerIR/ESIMD/lower_debug_info.ll
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ declare spir_func <16 x float> @_Z26__esimd_oword_ld_unalignedIfLi16EjLi0EEN2cl4
define spir_func void @func1(ptr addrspace(1) %arg1, i32 %arg2){
; CHECK-LABEL: @func1(
; CHECK-NEXT: [[CALL1_I_I_ESIMD:%.*]] = call <16 x float> @llvm.genx.oword.ld.unaligned.v16f32(i32 0, i32 0, i32 [[ARG2:%.*]]), !dbg [[DBG2:![0-9]+]]
; CHECK-NEXT: call void @llvm.dbg.value(metadata <16 x float> [[CALL1_I_I_ESIMD]], metadata !{{[0-9]+}}, metadata !DIExpression()), !dbg [[DBG2]]
; CHECK-NEXT: #dbg_value(<16 x float> [[CALL1_I_I_ESIMD]], !{{[0-9]+}}, !DIExpression(), [[DBG2]])
; CHECK-NEXT: ret void, !dbg !{{[0-9]+}}

%res = call spir_func <16 x float> @_Z26__esimd_oword_ld_unalignedIfLi16EjLi0EEN2cl4sycl3ext5intel12experimental5esimd6detail11vector_typeIT_XT0_EE4typeET1_j(i32 0, i32 %arg2)
Expand All @@ -22,13 +22,13 @@ define spir_func void @func1(ptr addrspace(1) %arg1, i32 %arg2){
define spir_func void @func2(ptr addrspace(1) %arg1) {
; CHECK-LABEL: @func2(
; CHECK-NEXT: [[V1:%.*]] = load <3 x i64>, ptr addrspace(4) addrspacecast (ptr addrspace(1) @__spirv_BuiltInGlobalInvocationId to ptr addrspace(4)), align 32, !dbg !21
; CHECK-NEXT: call void @llvm.dbg.value(metadata <3 x i64> [[V1]], metadata !15, metadata !DIExpression()), !dbg [[DBG21:![0-9]+]]
; CHECK-NEXT: #dbg_value(<3 x i64> [[V1]], !15, !DIExpression(), [[DBG21:![0-9]+]])
; CHECK-NEXT: [[V2:%.*]] = extractelement <3 x i64> [[V1]], i64 0, !dbg [[DBG22:![0-9]+]]
; CHECK-NEXT: call void @llvm.dbg.value(metadata i64 [[V2]], metadata !17, metadata !DIExpression()), !dbg [[DBG22]]
; CHECK-NEXT: #dbg_value(i64 [[V2]], !17, !DIExpression(), [[DBG22]])
; CHECK-NEXT: [[PTRIDX:%.*]] = getelementptr inbounds i64, ptr addrspace(1) %arg1, i64 2, !dbg [[DBG23:![0-9]+]]
; CHECK-NEXT: call void @llvm.dbg.value(metadata ptr addrspace(1) [[PTRIDX]], metadata !19, metadata !DIExpression()), !dbg [[DBG23]]
; CHECK-NEXT: #dbg_value(ptr addrspace(1) [[PTRIDX]], !19, !DIExpression(), [[DBG23]])
; CHECK-NEXT: [[PTRIDXCAST:%.*]] = addrspacecast ptr addrspace(1) [[PTRIDX]] to ptr addrspace(4), !dbg [[DBG24:![0-9]+]]
; CHECK-NEXT: call void @llvm.dbg.value(metadata ptr addrspace(4) [[PTRIDXCAST]], metadata !20, metadata !DIExpression()), !dbg [[DBG24]]
; CHECK-NEXT: #dbg_value(ptr addrspace(4) [[PTRIDXCAST]], !20, !DIExpression(), [[DBG24]])
; CHECK-NEXT: store i64 [[V2]], ptr addrspace(4) [[PTRIDXCAST]], align 4, !dbg [[DBG25:![0-9]+]]
; CHECK-NEXT: ret void, !dbg [[DBG26:![0-9]+]]
%1 = load <3 x i64>, ptr addrspace(4) addrspacecast (ptr addrspace(1) @__spirv_BuiltInGlobalInvocationId to ptr addrspace(4))
Expand Down
18 changes: 9 additions & 9 deletions llvm/test/SYCLLowerIR/hier_par_debug1.ll
Original file line number Diff line number Diff line change
Expand Up @@ -15,25 +15,25 @@ define internal spir_func void @wibble(ptr addrspace(4) %arg, ptr byval(%struct.
; CHECK-SAME: (ptr addrspace(4) [[ARG:%.*]], ptr byval(%struct.zot) align 8 [[ARG1:%.*]])
bb:
%tmp = alloca ptr addrspace(4), align 8
; CHECK: [[TMP:%.*]] = alloca ptr addrspace(4), align 8
; CHECK: call void @llvm.dbg.value(metadata ptr [[TMP]], [[META9:metadata !.*]], metadata !DIExpression())
; CHECK: [[TMP:%.*]] = alloca ptr addrspace(4), align 8, !dbg [[DBG1:!.*]]
; CHECK: #dbg_value(ptr [[TMP]], [[META9:!.*]], !DIExpression(), [[DBG1]])
%tmp1 = alloca %struct.foo.0, align 1
; CHECK: [[TMP1:%.*]] = alloca %struct.foo.0, align 1
; CHECK: call void @llvm.dbg.value(metadata ptr [[TMP1]], [[META11:metadata !.*]], metadata !DIExpression())
; CHECK: [[TMP1:%.*]] = alloca %struct.foo.0, align 1, !dbg [[DBG2:!.*]]
; CHECK: #dbg_value(ptr [[TMP1]], [[META11:!.*]], !DIExpression(), [[DBG2]])
store ptr addrspace(4) %arg, ptr %tmp, align 8
%tmp3 = load ptr addrspace(4), ptr %tmp, align 8
; CHECK: [[TMP3:%.*]] = load ptr addrspace(4), ptr [[TMP]], align 8
; CHECK: call void @llvm.dbg.value(metadata ptr addrspace(4) [[TMP3]], [[META12:metadata !.*]], metadata !DIExpression())
; CHECK: [[TMP3:%.*]] = load ptr addrspace(4), ptr [[TMP]], align 8, !dbg [[DBG3:!.*]]
; CHECK: #dbg_value(ptr addrspace(4) [[TMP3]], [[META12:!.*]], !DIExpression(), [[DBG3]])
%tmp4 = addrspacecast ptr %arg1 to ptr addrspace(4)
; CHECK: [[TMP4:%.*]] = addrspacecast ptr [[ARG1]] to ptr addrspace(4)
; CHECK: call void @llvm.dbg.value(metadata ptr addrspace(4) [[TMP4]], [[META13:metadata !.*]], metadata !DIExpression())
; CHECK: [[TMP4:%.*]] = addrspacecast ptr [[ARG1]] to ptr addrspace(4), !dbg [[DBG4:!.*]]
; CHECK: #dbg_value(ptr addrspace(4) [[TMP4]], [[META13:!.*]], !DIExpression(), [[DBG4]])
call spir_func void @bar(ptr addrspace(4) %tmp4, ptr byval(%struct.foo.0) align 1 %tmp1)
ret void
}

define internal spir_func void @bar(ptr addrspace(4) %arg, ptr byval(%struct.foo.0) align 1 %arg1) align 2 !work_item_scope !0 !parallel_for_work_item !0 {
; CHECK-LABEL: define {{[^@]+}}@bar
; CHECK: call void @llvm.dbg.value(metadata i32 0, [[META23:metadata !.*]], metadata !DIExpression())
; CHECK-SAME: !dbg [[DBGBAR:!.*]]
bb:
ret void
}
Expand Down
47 changes: 24 additions & 23 deletions llvm/test/SYCLLowerIR/hier_par_debug2.ll
Original file line number Diff line number Diff line change
Expand Up @@ -18,43 +18,43 @@ define internal spir_func void @wibble(ptr addrspace(4) dereferenceable_or_null(
;
bb:
%tmp = alloca ptr addrspace(4), align 8
; CHECK: [[TMP:%.*]] = alloca ptr addrspace(4), align 8
; CHECK: call void @llvm.dbg.value(metadata ptr [[TMP]], [[META9:metadata !.*]], metadata !DIExpression())
; CHECK: [[TMP:%.*]] = alloca ptr addrspace(4), align 8, !dbg [[DBG1:!.*]]
; CHECK: #dbg_value(ptr [[TMP]], [[META9:!.*]], !DIExpression(), [[DBG1]])
%tmp2 = addrspacecast ptr %tmp to ptr addrspace(4)
; CHECK: [[TMP2:%.*]] = addrspacecast ptr [[TMP]] to ptr addrspace(4)
; CHECK: call void @llvm.dbg.value(metadata ptr addrspace(4) [[TMP2]], [[META11:metadata !.*]], metadata !DIExpression())
; CHECK: [[TMP2:%.*]] = addrspacecast ptr [[TMP]] to ptr addrspace(4), !dbg [[DBG2:!.*]]
; CHECK: #dbg_value(ptr addrspace(4) [[TMP2]], [[META11:!.*]], !DIExpression(), [[DBG2]])
%tmp3 = alloca %struct.ham, align 4, !work_item_scope !0
; CHECK: [[TMP3:%.*]] = alloca %struct.ham, align 4, [[DBG24:!dbg !.*]], !work_item_scope ![[#]]
; CHECK: call void @llvm.dbg.value(metadata ptr [[TMP3]], [[META12:metadata !.*]], metadata !DIExpression())
; CHECK: [[TMP3:%.*]] = alloca %struct.ham, align 4, !dbg [[DBG3:!.*]], !work_item_scope ![[#]]
; CHECK: #dbg_value(ptr [[TMP3]], [[META12:!.*]], !DIExpression(), [[DBG3]])
%tmp4 = addrspacecast ptr %tmp3 to ptr addrspace(4)
; CHECK: [[TMP4:%.*]] = addrspacecast ptr [[TMP3]] to ptr addrspace(4)
; CHECK: call void @llvm.dbg.value(metadata ptr addrspace(4) [[TMP4]], [[META13:metadata !.*]], metadata !DIExpression())
; CHECK: [[TMP4:%.*]] = addrspacecast ptr [[TMP3]] to ptr addrspace(4), !dbg [[DBG4:!.*]]
; CHECK: #dbg_value(ptr addrspace(4) [[TMP4]], [[META13:!.*]], !DIExpression(), [[DBG4]])
%tmp5 = alloca %struct.spam, align 8
; CHECK: [[TMP5:%.*]] = alloca %struct.spam, align 8
; CHECK: call void @llvm.dbg.value(metadata ptr [[TMP5]], [[META14:metadata !.*]], metadata !DIExpression())
; CHECK: [[TMP5:%.*]] = alloca %struct.spam, align 8, !dbg [[DBG5:!.*]]
; CHECK: #dbg_value(ptr [[TMP5]], [[META14:!.*]], !DIExpression(), [[DBG5]])
%tmp6 = addrspacecast ptr %tmp5 to ptr addrspace(4)
; CHECK: [[TMP6:%.*]] = addrspacecast ptr [[TMP5]] to ptr addrspace(4)
; CHECK: call void @llvm.dbg.value(metadata ptr addrspace(4) [[TMP6]], [[META15:metadata !.*]], metadata !DIExpression())
; CHECK: [[TMP6:%.*]] = addrspacecast ptr [[TMP5]] to ptr addrspace(4), !dbg [[DBG6:!.*]]
; CHECK: #dbg_value(ptr addrspace(4) [[TMP6]], [[META15:!.*]], !DIExpression(), [[DBG6]])
%tmp7 = alloca %struct.wibble, align 8
; CHECK: [[TMP7:%.*]] = alloca %struct.wibble, align 8
; CHECK: call void @llvm.dbg.value(metadata ptr [[TMP7]], [[META16:metadata !.*]], metadata !DIExpression())
; CHECK: [[TMP7:%.*]] = alloca %struct.wibble, align 8, !dbg [[DBG7:!.*]]
; CHECK: #dbg_value(ptr [[TMP7]], [[META16:!.*]], !DIExpression(), [[DBG7]])
%tmp8 = addrspacecast ptr %tmp7 to ptr addrspace(4)
; CHECK: [[TMP8:%.*]] = addrspacecast ptr [[TMP7]] to ptr addrspace(4)
; CHECK: call void @llvm.dbg.value(metadata ptr addrspace(4) [[TMP8]], [[META17:metadata !.*]], metadata !DIExpression())
; CHECK: [[TMP8:%.*]] = addrspacecast ptr [[TMP7]] to ptr addrspace(4), !dbg [[DBG8:!.*]]
; CHECK: #dbg_value(ptr addrspace(4) [[TMP8]], [[META17:!.*]], !DIExpression(), [[DBG8]])
store ptr addrspace(4) %arg, ptr addrspace(4) %tmp2, align 8
%tmp9 = addrspacecast ptr %arg1 to ptr addrspace(4)
; CHECK: [[TMP9:%.*]] = addrspacecast ptr [[ARG1]] to ptr addrspace(4)
; CHECK: call void @llvm.dbg.value(metadata ptr addrspace(4) [[TMP9]], [[META18:metadata !.*]], metadata !DIExpression())
; CHECK: [[TMP9:%.*]] = addrspacecast ptr [[ARG1]] to ptr addrspace(4), !dbg [[DBG9:!.*]]
; CHECK: #dbg_value(ptr addrspace(4) [[TMP9]], [[META18:!.*]], !DIExpression(), [[DBG9]])
call spir_func void @eggs(ptr addrspace(4) dereferenceable_or_null(8) %tmp4, ptr addrspace(4) align 8 dereferenceable(64) %tmp9)
call spir_func void @snork(ptr addrspace(4) dereferenceable_or_null(16) %tmp6, i64 7, i64 3)
store ptr addrspace(4) %tmp4, ptr addrspace(4) %tmp8, align 8
%tmp11 = addrspacecast ptr addrspace(4) %tmp6 to ptr
; CHECK: [[TMP11:%.*]] = addrspacecast ptr addrspace(4) [[TMP6]] to ptr
; CHECK: call void @llvm.dbg.value(metadata ptr [[TMP11]], [[META20:metadata !.*]], metadata !DIExpression())
; CHECK: [[TMP11:%.*]] = addrspacecast ptr addrspace(4) [[TMP6]] to ptr, !dbg [[DBG11:!.*]]
; CHECK: #dbg_value(ptr [[TMP11]], [[META20:!.*]], !DIExpression(), [[DBG11]])
%tmp12 = addrspacecast ptr addrspace(4) %tmp8 to ptr
call spir_func void @wombat(ptr addrspace(4) dereferenceable_or_null(64) %tmp9, ptr byval(%struct.spam) align 8 %tmp11, ptr byval(%struct.wibble) align 8 %tmp12)
; CHECK: [[TMP12:%.*]] = addrspacecast ptr addrspace(4) [[TMP8]] to ptr
; CHECK: call void @llvm.dbg.value(metadata ptr [[TMP12]], [[META21:metadata !.*]], metadata !DIExpression())
; CHECK: [[TMP12:%.*]] = addrspacecast ptr addrspace(4) [[TMP8]] to ptr, !dbg [[DBG12:!.*]]
; CHECK: #dbg_value(ptr [[TMP12]], [[META21:!.*]], !DIExpression(), [[DBG12]])
ret void
}

Expand All @@ -65,7 +65,8 @@ bb:

define internal spir_func void @wombat(ptr addrspace(4) dereferenceable_or_null(64) %arg, ptr byval(%struct.spam) align 8 %arg1, ptr byval(%struct.wibble) align 8 %arg2) align 2 !work_item_scope !0 !parallel_for_work_item !0 {
bb:
; CHECK: call void @llvm.dbg.value(metadata i32 0, [[META42:metadata !.*]], metadata !DIExpression())
; CHECK-LABEL: define {{[^@]+}}@wombat
; CHECK: !dbg [[DBGWOMBAT:!.*]]
ret void
}

Expand Down
20 changes: 10 additions & 10 deletions llvm/test/SYCLLowerIR/hier_par_debug3.ll
Original file line number Diff line number Diff line change
Expand Up @@ -18,24 +18,24 @@ define internal spir_func void @spam(ptr addrspace(4) %arg, ptr byval(%struct.sn
; CHECK-SAME: (ptr addrspace(4) [[ARG:%.*]], ptr byval(%struct.snork.0) align 8 [[ARG1:%.*]])
entry:
%tmp = alloca ptr addrspace(4), align 8
; CHECK: [[TMP:%.*]] = alloca ptr addrspace(4), align 8
; CHECK: call void @llvm.dbg.value(metadata ptr [[TMP]], [[META9:metadata !.*]], metadata !DIExpression())
; CHECK: [[TMP:%.*]] = alloca ptr addrspace(4), align 8, !dbg [[DBG1:!.*]]
; CHECK: #dbg_value(ptr [[TMP]], [[META9:!.*]], !DIExpression(), [[DBG1]])
store ptr addrspace(4) %arg, ptr %tmp, align 8
%tmp2 = load ptr addrspace(4), ptr %tmp, align 8
; CHECK: [[TMP2:%.*]] = load ptr addrspace(4), ptr [[TMP]], align 8
; CHECK: call void @llvm.dbg.value(metadata ptr addrspace(4) [[TMP2]], [[META11:metadata !.*]], metadata !DIExpression())
; CHECK: [[TMP2:%.*]] = load ptr addrspace(4), ptr [[TMP]], align 8, !dbg [[DBG2:!.*]]
; CHECK: #dbg_value(ptr addrspace(4) [[TMP2]], [[META11:!.*]], !DIExpression(), [[DBG2]])
br label %arrayctor.loop
arrayctor.loop: ; preds = %arrayctor.loop, %entry
%arrayctor.cur = phi ptr addrspace(4) [ addrspacecast (ptr addrspace(3) @global to ptr addrspace(4)), %entry ], [ %arrayctor.next, %arrayctor.loop ]
; CHECK: [[ARRAYCTOR_CUR:%.*]] = phi ptr addrspace(4) [ addrspacecast (ptr addrspace(3) @global to ptr addrspace(4)), [[ENTRY:%.*]] ], [ [[ARRAYCTOR_NEXT:%.*]], [[ARRAYCTOR_LOOP:%.*]] ]
; CHECK: call void @llvm.dbg.value(metadata ptr addrspace(4) [[ARRAYCTOR_CUR]], [[META12:metadata !.*]], metadata !DIExpression())
; CHECK: [[ARRAYCTOR_CUR:%.*]] = phi ptr addrspace(4) [ addrspacecast (ptr addrspace(3) @global to ptr addrspace(4)), [[ENTRY:%.*]] ], [ [[ARRAYCTOR_NEXT:%.*]], [[ARRAYCTOR_LOOP:%.*]] ], !dbg [[DBGCUR:!.*]]
; CHECK: #dbg_value(ptr addrspace(4) [[ARRAYCTOR_CUR]], [[META12:!.*]], !DIExpression(), [[DBGCUR]])
call spir_func void @bar(ptr addrspace(4) %arrayctor.cur)
%arrayctor.next = getelementptr inbounds %struct.snork, ptr addrspace(4) %arrayctor.cur, i64 1
; CHECK: [[GEP_VAL:%.*]] = getelementptr inbounds %struct.snork, ptr addrspace(4) [[ARRAYCTOR_CUR]], i64 1
; CHECK: call void @llvm.dbg.value(metadata ptr addrspace(4) [[GEP_VAL]], [[META13:metadata !.*]], metadata !DIExpression())
; CHECK: [[GEP_VAL:%.*]] = getelementptr inbounds %struct.snork, ptr addrspace(4) [[ARRAYCTOR_CUR]], i64 1, !dbg [[DBGGEP:!.*]]
; CHECK: #dbg_value(ptr addrspace(4) [[GEP_VAL]], [[META13:!.*]], !DIExpression(), [[DBGGEP]])
%arrayctor.done = icmp eq ptr addrspace(4) %arrayctor.next, getelementptr inbounds (%struct.snork, ptr addrspace(4) addrspacecast (ptr addrspace(3) @global to ptr addrspace(4)), i64 12)
; CHECK: [[ARRAYCTOR_DONE:%.*]] = icmp eq ptr addrspace(4) [[WG_VAL_ARRAYCTOR_NEXT:%.*]], getelementptr inbounds (%struct.snork, ptr addrspace(4) addrspacecast (ptr addrspace(3) @global to ptr addrspace(4)), i64 12)
; CHECK: call void @llvm.dbg.value(metadata i1 [[ARRAYCTOR_DONE]], [[META14:metadata !.*]], metadata !DIExpression())
; CHECK: [[ARRAYCTOR_DONE:%.*]] = icmp eq ptr addrspace(4) [[WG_VAL_ARRAYCTOR_NEXT:%.*]], getelementptr inbounds (%struct.snork, ptr addrspace(4) addrspacecast (ptr addrspace(3) @global to ptr addrspace(4)), i64 12), !dbg [[DBGDONE:!.*]]
; CHECK: #dbg_value(i1 [[ARRAYCTOR_DONE]], [[META14:!.*]], !DIExpression(), [[DBGDONE]])
br i1 %arrayctor.done, label %arrayctor.cont, label %arrayctor.loop

arrayctor.cont: ; preds = %arrayctor.loop
Expand Down

0 comments on commit 0378786

Please sign in to comment.