CodeQL / Analyze (actions) (push) Canceled after 0s
CodeQL / Analyze (python) (push) Canceled after 0s
pre-commit / pre-commit (push) Canceled after 0s
Multi-Arch CI / setup (push) Canceled after 0s
Publish build_manylinux_x86_64 images / publish_build_manylinux_x86_64 (push) Canceled after 0s
Setup (Multi-Arch) / setup (push) Canceled after 0s
Multi-Arch CI / Linux::${{ fromJSON(needs.setup.outputs.linux_build_config || '{}').build_variant_label || 'skip' }} (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish no_rocm_image_ubi10 image / publish_no_rocm_image_ubi10 (push) Canceled after 0s
Multi-Arch CI / Windows::${{ fromJSON(needs.setup.outputs.windows_build_config || '{}').build_variant_label || 'skip' }} (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Multi-Arch CI / Manifest Diff (push) Canceled after 0s
TheRock Manifest Diff Report / Generate Manifest Diff Report (push) Canceled after 0s
Multi-Arch CI / CI Summary (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04 (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04_ocl_rt images / publish_no_rocm_image_ubuntu24_04_ocl_rt (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_rocgdb (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04_rocgdb images / publish_no_rocm_image_ubuntu24_04_rocgdb (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_ocl_rt (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Unit Tests / Unit Tests :: ubuntu-24.04 (push) Canceled after 0s
Unit Tests / Unit Tests :: windows-2022 (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_media (push) Canceled after 0s
Unit Tests / Unit Tests Summary (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_openmpi (push) Canceled after 0s
122 lines
7.8 KiB
LLVM
122 lines
7.8 KiB
LLVM
; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
|
|
; RUN: opt -S -mtriple=amdgcn-amd-amdhsa -mcpu=gfx1030 -passes=infer-address-spaces < %s | FileCheck %s
|
|
|
|
define void @test_glob(ptr addrspace(1) %global) !dbg !3 {
|
|
; CHECK-LABEL: @test_glob(
|
|
; CHECK-NEXT: [[USE_GLOB_GEN:%.*]] = load i32, ptr addrspace(1) [[GLOBAL:%.*]], align 4
|
|
; CHECK-NEXT: #dbg_value(ptr addrspace(1) [[GLOBAL]], [[META6:![0-9]+]], !DIExpression(DIOpArg(0, ptr addrspace(1)), DIOpConvert(ptr)), [[META8:![0-9]+]])
|
|
; CHECK-NEXT: #dbg_value(ptr addrspace(1) [[GLOBAL]], [[META9:![0-9]+]], !DIExpression(DIOpArg(0, ptr addrspace(1)), DIOpConvert(ptr), DIOpDeref(i32)), [[META8]])
|
|
; CHECK-NEXT: #dbg_value(ptr addrspace(1) [[GLOBAL]], [[META11:![0-9]+]], !DIExpression(DIOpArg(0, ptr addrspace(1)), DIOpConvert(ptr), DIOpReinterpret(i64)), [[META8]])
|
|
; CHECK-NEXT: ret void, !dbg [[META8]]
|
|
;
|
|
%glob_gen = addrspacecast ptr addrspace(1) %global to ptr
|
|
%use_glob_gen = load i32, ptr %glob_gen, align 4
|
|
#dbg_value(ptr %glob_gen, !6, !DIExpression(DIOpArg(0, ptr)), !8)
|
|
#dbg_value(ptr %glob_gen, !9, !DIExpression(DIOpArg(0, ptr), DIOpDeref(i32)), !8)
|
|
#dbg_value(ptr %glob_gen, !11, !DIExpression(DIOpArg(0, ptr), DIOpReinterpret(i64)), !8)
|
|
ret void, !dbg !8
|
|
}
|
|
|
|
define void @test_local(ptr addrspace(3) %local) !dbg !13 {
|
|
; CHECK-LABEL: @test_local(
|
|
; CHECK-NEXT: [[USE_LOC_GEN:%.*]] = load i32, ptr addrspace(3) [[LOCAL:%.*]], align 4
|
|
; CHECK-NEXT: #dbg_value(ptr addrspace(3) [[LOCAL]], [[META14:![0-9]+]], !DIExpression(DIOpArg(0, ptr addrspace(3)), DIOpConvert(ptr)), [[META15:![0-9]+]])
|
|
; CHECK-NEXT: #dbg_value(ptr addrspace(3) [[LOCAL]], [[META16:![0-9]+]], !DIExpression(DIOpArg(0, ptr addrspace(3)), DIOpConvert(ptr), DIOpDeref(i32)), [[META15]])
|
|
; CHECK-NEXT: #dbg_value(ptr addrspace(3) [[LOCAL]], [[META17:![0-9]+]], !DIExpression(DIOpArg(0, ptr addrspace(3)), DIOpConvert(ptr), DIOpReinterpret(i64)), [[META15]])
|
|
; CHECK-NEXT: ret void
|
|
;
|
|
%loc_gen = addrspacecast ptr addrspace(3) %local to ptr
|
|
%use_loc_gen = load i32, ptr %loc_gen, align 4
|
|
#dbg_value(ptr %loc_gen, !14, !DIExpression(DIOpArg(0, ptr)), !15)
|
|
#dbg_value(ptr %loc_gen, !16, !DIExpression(DIOpArg(0, ptr), DIOpDeref(i32)), !15)
|
|
#dbg_value(ptr %loc_gen, !17, !DIExpression(DIOpArg(0, ptr), DIOpReinterpret(i64)), !15)
|
|
ret void
|
|
}
|
|
|
|
define void @test_constant(ptr addrspace(4) %constant) !dbg !18 {
|
|
; CHECK-LABEL: @test_constant(
|
|
; CHECK-NEXT: [[USE_CONST_GEN:%.*]] = load i32, ptr addrspace(4) [[CONSTANT:%.*]], align 4
|
|
; CHECK-NEXT: #dbg_value(ptr addrspace(4) [[CONSTANT]], [[META19:![0-9]+]], !DIExpression(DIOpArg(0, ptr addrspace(4)), DIOpConvert(ptr)), [[META20:![0-9]+]])
|
|
; CHECK-NEXT: #dbg_value(ptr addrspace(4) [[CONSTANT]], [[META21:![0-9]+]], !DIExpression(DIOpArg(0, ptr addrspace(4)), DIOpConvert(ptr), DIOpDeref(i32)), [[META20]])
|
|
; CHECK-NEXT: #dbg_value(ptr addrspace(4) [[CONSTANT]], [[META22:![0-9]+]], !DIExpression(DIOpArg(0, ptr addrspace(4)), DIOpConvert(ptr), DIOpReinterpret(i64)), [[META20]])
|
|
; CHECK-NEXT: ret void
|
|
;
|
|
%const_gen = addrspacecast ptr addrspace(4) %constant to ptr
|
|
%use_const_gen = load i32, ptr %const_gen, align 4
|
|
#dbg_value(ptr %const_gen, !19, !DIExpression(DIOpArg(0, ptr)), !20)
|
|
#dbg_value(ptr %const_gen, !21, !DIExpression(DIOpArg(0, ptr), DIOpDeref(i32)), !20)
|
|
#dbg_value(ptr %const_gen, !22, !DIExpression(DIOpArg(0, ptr), DIOpReinterpret(i64)), !20)
|
|
ret void
|
|
}
|
|
|
|
; Verify that we can update the address space regardless of whether the new
|
|
; instruction gets inserted before or after the old one.
|
|
define void @test_before_and_after(ptr addrspace(4) %constant) !dbg !23 {
|
|
; CHECK-LABEL: @test_before_and_after(
|
|
; CHECK-NEXT: [[TMP1:%.*]] = call ptr addrspace(4) @llvm.ptrmask.p4.i64(ptr addrspace(4) [[CONSTANT:%.*]], i64 -2)
|
|
; CHECK-NEXT: #dbg_value(ptr addrspace(4) [[TMP1]], [[META24:![0-9]+]], !DIExpression(DIOpArg(0, ptr addrspace(4)), DIOpConvert(ptr)), [[META25:![0-9]+]])
|
|
; CHECK-NEXT: [[USE_MASK:%.*]] = load i32, ptr addrspace(4) [[TMP1]], align 4
|
|
; CHECK-NEXT: [[BC:%.*]] = getelementptr i32, ptr addrspace(4) [[CONSTANT]], i32 42
|
|
; CHECK-NEXT: #dbg_value(ptr addrspace(4) [[BC]], [[META26:![0-9]+]], !DIExpression(DIOpArg(0, ptr addrspace(4)), DIOpConvert(ptr)), [[META25]])
|
|
; CHECK-NEXT: [[USE_BC:%.*]] = load i32, ptr addrspace(4) [[BC]], align 4
|
|
; CHECK-NEXT: ret void
|
|
;
|
|
%const_gen = addrspacecast ptr addrspace(4) %constant to ptr
|
|
|
|
%mask = call ptr @llvm.ptrmask.p0.i64(ptr %const_gen, i64 -2)
|
|
#dbg_value(ptr %mask, !24, !DIExpression(DIOpArg(0, ptr)), !26)
|
|
%use_mask = load i32, ptr %mask, align 4
|
|
|
|
%bc = getelementptr i32, ptr %const_gen, i32 42
|
|
#dbg_value(ptr %bc, !25, !DIExpression(DIOpArg(0, ptr)), !26)
|
|
%use_bc = load i32, ptr %bc, align 4
|
|
|
|
ret void
|
|
}
|
|
|
|
define void @test_no_DW_OPs(ptr addrspace(3) %local_ptr) !dbg !27 {
|
|
; CHECK-LABEL: @test_no_DW_OPs(
|
|
; CHECK-NEXT: #dbg_value(ptr poison, [[META28:![0-9]+]], !DIExpression(), [[META29:![0-9]+]])
|
|
; CHECK-NEXT: [[USE_GEN:%.*]] = load i32, ptr addrspace(3) [[LOCAL_PTR:%.*]], align 4
|
|
; CHECK-NEXT: ret void
|
|
;
|
|
%gen = addrspacecast ptr addrspace(3) %local_ptr to ptr
|
|
#dbg_value(ptr %gen, !28, !DIExpression(), !29)
|
|
%use_gen = load i32, ptr %gen, align 4
|
|
ret void
|
|
}
|
|
|
|
!llvm.dbg.cu = !{!0}
|
|
!llvm.module.flags = !{!2}
|
|
|
|
!0 = distinct !DICompileUnit(language: DW_LANG_C, file: !1, producer: "debugify", isOptimized: true, runtimeVersion: 0, emissionKind: FullDebug)
|
|
!1 = !DIFile(filename: "t.c", directory: "/")
|
|
!2 = !{i32 2, !"Debug Info Version", i32 3}
|
|
!3 = distinct !DISubprogram(name: "test_glob", linkageName: "test_glob", scope: null, file: !1, line: 1, type: !4, scopeLine: 1, spFlags: DISPFlagDefinition | DISPFlagOptimized, unit: !0)
|
|
!4 = !DISubroutineType(types: !5)
|
|
!5 = !{}
|
|
!6 = !DILocalVariable(name: "ptr_var", scope: !3, file: !1, line: 1, type: !7)
|
|
!7 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: null, size: 64)
|
|
!8 = !DILocation(line: 1, column: 1, scope: !3)
|
|
!9 = !DILocalVariable(name: "i32_var", scope: !3, file: !1, line: 2, type: !10)
|
|
!10 = !DIBasicType(name: "i32", size: 32, encoding: DW_ATE_signed)
|
|
!11 = !DILocalVariable(name: "i64_var", scope: !3, file: !1, line: 2, type: !12)
|
|
!12 = !DIBasicType(name: "i64", size: 64, encoding: DW_ATE_unsigned)
|
|
!13 = distinct !DISubprogram(name: "test_local", linkageName: "test_local", scope: null, file: !1, line: 1, type: !4, scopeLine: 1, spFlags: DISPFlagDefinition | DISPFlagOptimized, unit: !0)
|
|
!14 = !DILocalVariable(name: "ptr_var", scope: !13, file: !1, line: 1, type: !7)
|
|
!15 = !DILocation(line: 1, column: 1, scope: !13)
|
|
!16 = !DILocalVariable(name: "i32_var", scope: !13, file: !1, line: 2, type: !10)
|
|
!17 = !DILocalVariable(name: "i64_var", scope: !13, file: !1, line: 2, type: !12)
|
|
!18 = distinct !DISubprogram(name: "test_constant", linkageName: "test_constant", scope: null, file: !1, line: 1, type: !4, scopeLine: 1, spFlags: DISPFlagDefinition | DISPFlagOptimized, unit: !0)
|
|
!19 = !DILocalVariable(name: "ptr_var", scope: !18, file: !1, line: 1, type: !7)
|
|
!20 = !DILocation(line: 1, column: 1, scope: !18)
|
|
!21 = !DILocalVariable(name: "i32_var", scope: !18, file: !1, line: 2, type: !10)
|
|
!22 = !DILocalVariable(name: "i64_var", scope: !18, file: !1, line: 2, type: !12)
|
|
!23 = distinct !DISubprogram(name: "test_before_and_after", linkageName: "test_before_and_after", scope: null, file: !1, line: 1, type: !4, scopeLine: 1, spFlags: DISPFlagDefinition | DISPFlagOptimized, unit: !0)
|
|
!24 = !DILocalVariable(name: "p1", scope: !23, file: !1, line: 1, type: !7)
|
|
!25 = !DILocalVariable(name: "p2", scope: !23, file: !1, line: 1, type: !7)
|
|
!26 = !DILocation(line: 1, column: 1, scope: !23)
|
|
!27 = distinct !DISubprogram(name: "test_no_DW_OPs", linkageName: "test_no_DW_OPs", scope: null, file: !1, line: 1, type: !4, scopeLine: 1, spFlags: DISPFlagDefinition | DISPFlagOptimized, unit: !0)
|
|
!28 = !DILocalVariable(name: "t1", scope: !27, file: !1, line: 1, type: !7)
|
|
!29 = !DILocation(line: 1, column: 1, scope: !27)
|