Open
Description
$> cat reproducer.mlir
module attributes {omp.is_target_device = false, omp.requires = #omp<clause_requires none>, omp.target_triples = [], omp.version = #om\
p.version<version = 11>} {
llvm.func @free(!llvm.ptr)
llvm.func @malloc(i64) -> !llvm.ptr
omp.private {type = private} @_QFtarget_allocatableEnon_alloc_var_private_box_10xi32 : !llvm.struct<(ptr, i64, i32, i8, i8, i8, i8, \
array<1 x array<3 x i64>>)> init {
^bb0(%arg0: !llvm.ptr, %arg1: !llvm.ptr):
omp.yield(%arg1 : !llvm.ptr)
} dealloc {
^bb0(%arg0: !llvm.ptr):
llvm.br ^bb1
^bb1: // 2 preds: ^bb0, ^bb1
omp.yield
}
llvm.func @target_allocatable_(%arg0: !llvm.ptr {fir.bindc_name = "lb", llvm.nocapture}, %arg1: !llvm.ptr {fir.bindc_name = "ub", ll\
vm.nocapture}) attributes {fir.internal_name = "_QPtarget_allocatable"} {
%2 = llvm.mlir.constant(1 : i64) : i64
%5 = llvm.alloca %2 x !llvm.struct<(ptr, i64, i32, i8, i8, i8, i8, array<1 x array<3 x i64>>)> : (i64) -> !llvm.ptr
omp.target private(@_QFtarget_allocatableEnon_alloc_var_private_box_10xi32 %5 -> %arg2 : !llvm.ptr) {
omp.terminator
}
llvm.return
}
}
Command to reproduce the problem
mlir-translate -mlir-to-llvmir -allow-unregistered-dialect ./reproducer.mlir
Basic Block in function '__omp_offloading_10304_b734e3e_target_allocatable__l16' does not have terminator!
label %omp.region.cont1
This happens because after translating the dealloc
regions of omp.private
in the translation of omp.target
we do not return the corret InsertPoint
Metadata
Metadata
Assignees
Type
Projects
Milestone
Relationships
Development
No branches or pull requests
Activity
llvmbot commentedon Feb 28, 2025
@llvm/issue-subscribers-mlir
Author: Pranav Bhandarkar (bhandarkar-pranav)
Command to reproduce the problem
This happens because after translating the
dealloc
regions ofomp.private
in the translation ofomp.target
we do not return the corretInsertPoint
llvmbot commentedon Feb 28, 2025
@llvm/issue-subscribers-openmp
Author: Pranav Bhandarkar (bhandarkar-pranav)
Command to reproduce the problem
This happens because after translating the
dealloc
regions ofomp.private
in the translation ofomp.target
we do not return the corretInsertPoint
[MLIR][OpenMP] - Fix translation of omp.target when private variables…
[MLIR][OpenMP] - Fix translation of omp.target when private variables…
Automerge: [MLIR][OpenMP] - Fix translation of omp.target when privat…
[MLIR][OpenMP] - Fix translation of omp.target when private variables…