brintos

brintos / llvm-project-archived public Read only

0
0
Text · 3.7 KiB · 8f42995 Raw
69 lines · plain
1// RUN: mlir-translate -mlir-to-llvmir %s | FileCheck %s2 3#int_ty = #llvm.di_basic_type<tag = DW_TAG_base_type, name = "integer",4  sizeInBits = 32, encoding = DW_ATE_signed>5#real_ty = #llvm.di_basic_type<tag = DW_TAG_base_type, name = "real",6  sizeInBits = 32, encoding = DW_ATE_float>7#file = #llvm.di_file<"target.f90" in "">8#di_null_type = #llvm.di_null_type9#cu = #llvm.di_compile_unit<id = distinct[0]<>,10  sourceLanguage = DW_LANG_Fortran95, file = #file, isOptimized = false,11  emissionKind = Full>12#array_ty = #llvm.di_composite_type<tag = DW_TAG_array_type,13  baseType = #int_ty, elements = #llvm.di_subrange<count = 10 : i64>>14#sp_ty = #llvm.di_subroutine_type<callingConvention = DW_CC_program,15  types = #di_null_type>16#g_var = #llvm.di_global_variable<scope = #cu, name = "arr",17  linkageName = "_QFEarr", file = #file, line = 4,18  type = #array_ty, isDefined = true>19#g_var_expr = #llvm.di_global_variable_expression<var = #g_var>20#sp = #llvm.di_subprogram<id = distinct[2]<>, compileUnit = #cu, scope = #file,21  name = "test", file = #file, subprogramFlags = "Definition", type = #sp_ty>22#sp1 = #llvm.di_subprogram<id = distinct[3]<>, compileUnit = #cu, scope = #file,23  name = "target", file = #file, subprogramFlags = "Definition", type = #sp_ty>24#var_arr = #llvm.di_local_variable<scope = #sp1,25  name = "arr", file = #file, line = 4, type = #array_ty>26#var_i = #llvm.di_local_variable<scope = #sp1,27  name = "i", file = #file, line = 13, type = #int_ty>28#var_x = #llvm.di_local_variable<scope = #sp1,29 name = "x", file = #file, line = 12, type = #real_ty>30 31module attributes {dlti.dl_spec = #dlti.dl_spec<#dlti.dl_entry<"dlti.alloca_memory_space", 5 : ui32>>, llvm.target_triple = "amdgcn-amd-amdhsa", omp.is_target_device = true} {32  llvm.func @test() {33    %0 = llvm.mlir.constant(1 : i64) : i6434    %1 = llvm.alloca %0 x f32 : (i64) -> !llvm.ptr<5>35    %4 = llvm.alloca %0 x i32 : (i64) -> !llvm.ptr<5>36    %ascast = llvm.addrspacecast %1 : !llvm.ptr<5> to !llvm.ptr37    %ascast2 = llvm.addrspacecast %4 : !llvm.ptr<5> to !llvm.ptr38    %6 = llvm.mlir.constant(9 : index) : i6439    %7 = llvm.mlir.constant(0 : index) : i6440    %8 = llvm.mlir.constant(1 : index) : i6441    %10 = llvm.mlir.constant(10 : index) : i6442    %11 = llvm.mlir.addressof @_QFEarr : !llvm.ptr43    %14 = omp.map.info var_ptr(%ascast : !llvm.ptr, f32) map_clauses(tofrom) capture(ByRef) -> !llvm.ptr44    %15 = omp.map.bounds lower_bound(%7 : i64) upper_bound(%6 : i64) extent(%10 : i64) stride(%8 : i64) start_idx(%8 : i64)45    %16 = omp.map.info var_ptr(%11 : !llvm.ptr, !llvm.array<10 x i32>) map_clauses(tofrom) capture(ByRef) bounds(%15) -> !llvm.ptr46    %17 = omp.map.info var_ptr(%ascast2 : !llvm.ptr, i32) map_clauses(implicit, exit_release_or_enter_alloc) capture(ByCopy) -> !llvm.ptr47    omp.target map_entries(%14 -> %arg0, %16 -> %arg1, %17 -> %arg2 : !llvm.ptr, !llvm.ptr, !llvm.ptr) {48      llvm.intr.dbg.declare #var_x = %arg0 : !llvm.ptr49      llvm.intr.dbg.declare #var_arr = %arg1 : !llvm.ptr50      llvm.intr.dbg.declare #var_i = %arg2 : !llvm.ptr51      omp.terminator52    } loc(#loc5)53    llvm.return54  } loc(#loc3)55  llvm.mlir.global internal @_QFEarr() {addr_space = 0 : i32, dbg_exprs = [#g_var_expr]} : !llvm.array<10 x i32> {56  } loc(#loc4)57}58#loc1 = loc("target.f90":4:7)59#loc2 = loc("target.f90":11:7)60#loc3 = loc(fused<#sp>[#loc2])61#loc4 = loc(fused<#g_var>[#loc1])62#loc5 = loc(fused<#sp1>[#loc2])63 64// CHECK: ![[SP:[0-9]+]] = distinct !DISubprogram(name: "target"{{.*}})65// CHECK: !DILocalVariable(name: "dyn_ptr", arg: 1, scope: ![[SP]]{{.*}}flags: DIFlagArtificial)66// CHECK: !DILocalVariable(name: "x", arg: 2, scope: ![[SP]]{{.*}})67// CHECK: !DILocalVariable(name: "arr", arg: 3, scope: ![[SP]]{{.*}})68// CHECK: !DILocalVariable(name: "i", arg: 4, scope: ![[SP]]{{.*}})69