forked from llvm/llvm-project
-
Notifications
You must be signed in to change notification settings - Fork 16
[OpenMP][Flang]Add support for modifiers monotonic and non-monotonic #791
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
schweitzpgi
merged 5 commits into
flang-compiler:fir-dev
from
Leporacanthicus:modifiers
Jul 23, 2021
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
235e0f5
[OpenMP IRBuilder, MLIR] Add support for OpenMP do schedule dynamic
Leporacanthicus a4473cb
[OpenMP][MLIR]Add support for guided, auto and runtime scheduling
Leporacanthicus b80f391
[OpenMP]Add support for workshare loop modifier in lowering
Leporacanthicus 9054e8a
[Flang][OpenMP]Support for modifiers in workshare loops
Leporacanthicus cba7222
[Flang][OpenMP] Add support for SIMD modifier
Leporacanthicus File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -336,6 +336,67 @@ genOMP(Fortran::lower::AbstractConverter &converter, | |
} | ||
} | ||
|
||
static mlir::omp::ScheduleModifier | ||
translateModifier(const Fortran::parser::OmpScheduleModifierType &m) { | ||
switch (m.v) { | ||
case Fortran::parser::OmpScheduleModifierType::ModType::Monotonic: | ||
return mlir::omp::ScheduleModifier::monotonic; | ||
case Fortran::parser::OmpScheduleModifierType::ModType::Nonmonotonic: | ||
return mlir::omp::ScheduleModifier::nonmonotonic; | ||
case Fortran::parser::OmpScheduleModifierType::ModType::Simd: | ||
return mlir::omp::ScheduleModifier::simd; | ||
} | ||
return mlir::omp::ScheduleModifier::none; | ||
} | ||
|
||
static mlir::omp::ScheduleModifier | ||
getScheduleModifiers(const Fortran::parser::OmpScheduleClause &x) { | ||
const auto &modifier = | ||
std::get<std::optional<Fortran::parser::OmpScheduleModifier>>(x.t); | ||
// The input may have the modifier any order, so we look for one that isn't | ||
// SIMD. If modifier is not set at all, fall down to the bottom and return | ||
// "none". | ||
if (modifier) { | ||
const auto &modType1 = | ||
std::get<Fortran::parser::OmpScheduleModifier::Modifier1>(modifier->t); | ||
if (modType1.v.v == | ||
Fortran::parser::OmpScheduleModifierType::ModType::Simd) { | ||
const auto &modType2 = std::get< | ||
std::optional<Fortran::parser::OmpScheduleModifier::Modifier2>>( | ||
modifier->t); | ||
if (modType2->v.v != | ||
Fortran::parser::OmpScheduleModifierType::ModType::Simd) | ||
return translateModifier(modType2->v); | ||
} | ||
|
||
return translateModifier(modType1.v); | ||
} | ||
return mlir::omp::ScheduleModifier::none; | ||
} | ||
|
||
static mlir::omp::ScheduleModifier | ||
getSIMDModifier(const Fortran::parser::OmpScheduleClause &x) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can this function be combined with getScheduleModifier? |
||
const auto &modifier = | ||
std::get<std::optional<Fortran::parser::OmpScheduleModifier>>(x.t); | ||
// Either of the two possible modifiers in the input can be the SIMD modifier, | ||
// so look in either one, and return simd if we find one. Not found = return | ||
// "none". | ||
if (modifier) { | ||
const auto &modType1 = | ||
std::get<Fortran::parser::OmpScheduleModifier::Modifier1>(modifier->t); | ||
if (modType1.v.v == Fortran::parser::OmpScheduleModifierType::ModType::Simd) | ||
return mlir::omp::ScheduleModifier::simd; | ||
|
||
const auto &modType2 = std::get< | ||
std::optional<Fortran::parser::OmpScheduleModifier::Modifier2>>( | ||
modifier->t); | ||
if (modType2->v.v == | ||
Fortran::parser::OmpScheduleModifierType::ModType::Simd) | ||
return mlir::omp::ScheduleModifier::simd; | ||
} | ||
return mlir::omp::ScheduleModifier::none; | ||
} | ||
|
||
static void genOMP(Fortran::lower::AbstractConverter &converter, | ||
Fortran::lower::pft::Evaluation &eval, | ||
const Fortran::parser::OpenMPLoopConstruct &loopConstruct) { | ||
|
@@ -479,6 +540,11 @@ static void genOMP(Fortran::lower::AbstractConverter &converter, | |
omp::ClauseScheduleKind::Runtime))); | ||
break; | ||
} | ||
wsLoopOp.schedule_modifiersAttr( | ||
firOpBuilder.getStringAttr(omp::stringifyScheduleModifier( | ||
getScheduleModifiers(scheduleClause->v)))); | ||
wsLoopOp.simd_modifierAttr(firOpBuilder.getStringAttr( | ||
omp::stringifyScheduleModifier(getSIMDModifier(scheduleClause->v)))); | ||
} | ||
} | ||
// In FORTRAN `nowait` clause occur at the end of `omp do` directive. | ||
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,102 @@ | ||
! This test checks lowering of OpenMP DO Directive(Worksharing). | ||
|
||
! RUN: bbc -fopenmp -emit-fir %s -o - | \ | ||
! RUN: FileCheck %s --check-prefix=FIRDialect | ||
! RUN: bbc -fopenmp -emit-fir %s -o - | \ | ||
! RUN: tco --disable-llvm --print-ir-after=fir-to-llvm-ir 2>&1 | \ | ||
! RUN: FileCheck %s --check-prefix=LLVMIRDialect | ||
! RUN: bbc -fopenmp -emit-fir %s -o - | \ | ||
! RUN: tco | FileCheck %s --check-prefix=LLVMIR | ||
|
||
program wsloop_dynamic | ||
integer :: i | ||
!FIRDialect: func @_QQmain() | ||
!LLVMIRDialect: func @_QQmain() | ||
|
||
!LLVMIR: define void @_QQmain() | ||
!LLVMIR:call i32 @__kmpc_global_thread_num{{.*}} | ||
!LLVMIR: br label %omp_parallel | ||
|
||
!$OMP PARALLEL | ||
!FIRDialect-LABLEL: omp.parallel { | ||
!LLVMIRDialect-LABLEL: omp.parallel { | ||
|
||
!LLVMIR: omp_parallel: ; preds = %0 | ||
!LLVMIR: @__kmpc_fork_call | ||
!$OMP DO SCHEDULE(dynamic) | ||
!FIRDialect: %[[WS_LB:.*]] = constant 1 : i32 | ||
!FIRDialect: %[[WS_UB:.*]] = constant 9 : i32 | ||
!FIRDialect: %[[WS_STEP:.*]] = constant 1 : i32 | ||
!FIRDialect: omp.wsloop (%[[I:.*]]) : i32 = (%[[WS_LB]]) to (%[[WS_UB]]) step (%[[WS_STEP]]) schedule(dynamic, none) nowait inclusive | ||
|
||
!LLVMIRDialect: %[[WS_UB:.*]] = llvm.mlir.constant(9 : i32) : i32 | ||
!LLVMIRDialect: %[[WS_LB_STEP:.*]] = llvm.mlir.constant(1 : i32) : i32 | ||
!LLVMIRDialect: omp.wsloop (%[[I:.*]]) : i32 = (%[[WS_LB_STEP]]) to (%[[WS_UB]]) step (%[[WS_LB_STEP]]) schedule(dynamic, none) nowait inclusive | ||
|
||
!LLVMIR: define internal void @_QQmain..omp_par | ||
!LLVMIR: omp.par.entry: | ||
!LLVMIR: br label %omp.par.region | ||
!LLVMIR: omp.par.outlined.exit.exitStub: ; preds = %omp.par.pre_finalize | ||
!LLVMIR: ret void | ||
!LLVMIR: omp.par.region: ; preds = %omp.par.entry | ||
!LLVMIR: br label %omp.par.region1 | ||
!LLVMIR: omp.par.region1: ; preds = %omp.par.region | ||
!LLVMIR: br label %omp_loop.preheader | ||
!LLVMIR: omp_loop.preheader: ; preds = %omp.par.region1 | ||
!LLVMIR: @__kmpc_global_thread_num | ||
!LLVMIR: @__kmpc_dispatch_init_4u(%struct.ident_t* @{{.*}}, i32 %omp_global_thread_num{{.*}}, i32 35, i32 {{.*}}, i32 {{.*}}, i32 {{.*}}, i32 {{.*}}) | ||
!LLVMIR: br label %omp_loop.preheader.outer.cond | ||
!LLVMIR: omp_loop.preheader.outer.cond: | ||
!LLVMIR: @__kmpc_dispatch_next_4u | ||
!LLVMIR: %{{.*}} = icmp ne i32 %{{.*}}, 0 | ||
!LLVMIR: %{{.*}} = load i32, i32* %p.lowerbound, align 4 | ||
!LLVMIR: %{{.*}} = sub i32 %{{.*}}, 1 | ||
!LLVMIR: br i1 %{{.*}}, label %omp_loop.header, label %omp_loop.exit | ||
!LLVMIR: omp_loop.exit: ; preds = %omp_loop.preheader.outer.cond | ||
!LLVMIR: br label %omp_loop.after | ||
!LLVMIR: omp_loop.header: ; preds = %omp_loop.preheader.outer.cond, %omp_loop.inc | ||
!LLVMIR: %omp_loop.iv = phi i32 [ %lb, %omp_loop.preheader.outer.cond ], [ %omp_loop.next, %omp_loop.inc ] | ||
|
||
do i=1, 9 | ||
print*, i | ||
!FIRDialect: %[[RTBEGIN:.*]] = fir.call @_FortranAioBeginExternalListOutput | ||
!FIRDialect: %[[CONVERTED:.*]] = fir.convert %[[I]] : (i32) -> i64 | ||
!FIRDialect: fir.call @_FortranAioOutputInteger64(%[[RTBEGIN]], %[[CONVERTED]]) : (!fir.ref<i8>, i64) -> i1 | ||
!FIRDialect: fir.call @_FortranAioEndIoStatement(%[[RTBEGIN]]) : (!fir.ref<i8>) -> i32 | ||
|
||
|
||
!LLVMIRDialect: llvm.call @_FortranAioBeginExternalListOutput(%{{.*}}, %{{.*}}, %{{.*}}) : (i32, !llvm.ptr<i8>, i32) -> !llvm.ptr<i8> | ||
!LLVMIRDialect: %{{.*}} = llvm.sext %arg0 : i32 to i64 | ||
!LLVMIRDialect: llvm.call @_FortranAioOutputInteger64(%{{.*}}, %{{.*}}) : (!llvm.ptr<i8>, i64) -> i1 | ||
!LLVMIRDialect: llvm.call @_FortranAioEndIoStatement(%{{.*}}) : (!llvm.ptr<i8>) -> i32 | ||
|
||
!LLVMIR: br label %omp_loop.cond | ||
!LLVMIR: omp_loop.cond: ; preds = %omp_loop.header | ||
!LLVMIR %{{.*}} = load i32, i32* %{{.*}}, aling {{.*}} | ||
!LLVMIR: %omp_loop.cmp = icmp ult i32 %{{.*}}, %{{.*}} | ||
!LLVMIR: br i1 %omp_loop.cmp, label %omp_loop.body, label %omp_loop.preheader.outer.cond | ||
!LLVMIR: omp_loop.body: ; preds = %omp_loop.cond | ||
!LLVMIR: %{{.*}} = mul i32 %{{.*}}, 1 | ||
!LLVMIR: %{{.*}} = add i32 %{{.*}}, 1 | ||
!LLVMIR: br label %omp.wsloop.region | ||
!LLVMIR: omp.wsloop.region: ; preds = %omp_loop.body | ||
!LLVMIR: %{{.*}} = call i8* @_FortranAioBeginExternalListOutput | ||
!LLVMIR: %{{.*}} = sext i32 %{{.*}} to i64 | ||
!LLVMIR: %{{.*}} = call i1 @_FortranAioOutputInteger64 | ||
!LLVMIR: %{{.*}} = call i32 @_FortranAioEndIoStatement | ||
|
||
end do | ||
!FIRDialect: omp.yield | ||
!FIRDialect: } | ||
!FIRDialect: omp.terminator | ||
!FIRDialect: } | ||
|
||
!LLVMIRDialect: omp.yield | ||
!LLVMIRDialect: } | ||
!LLVMIRDialect: omp.terminator | ||
!LLVMIRDialect: } | ||
!LLVMIRDialect: llvm.return | ||
!LLVMIRDialect: } | ||
!$OMP END DO NOWAIT | ||
!$OMP END PARALLEL | ||
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,100 @@ | ||
! This test checks lowering of OpenMP DO Directive(Worksharing). | ||
|
||
! RUN: bbc -fopenmp -emit-fir %s -o - | \ | ||
! RUN: FileCheck %s --check-prefix=FIRDialect | ||
! RUN: bbc -fopenmp -emit-fir %s -o - | \ | ||
! RUN: tco --disable-llvm --print-ir-after=fir-to-llvm-ir 2>&1 | \ | ||
! RUN: FileCheck %s --check-prefix=LLVMIRDialect | ||
! RUN: bbc -fopenmp -emit-fir %s -o - | \ | ||
! RUN: tco | FileCheck %s --check-prefix=LLVMIR | ||
|
||
program wsloop_dynamic | ||
integer :: i | ||
!FIRDialect: func @_QQmain() | ||
!LLVMIRDialect: func @_QQmain() | ||
|
||
!LLVMIR: define void @_QQmain() | ||
!LLVMIR:call i32 @__kmpc_global_thread_num{{.*}} | ||
!LLVMIR: br label %omp_parallel | ||
|
||
!$OMP PARALLEL | ||
!FIRDialect-LABLEL: omp.parallel { | ||
!LLVMIRDialect-LABLEL: omp.parallel { | ||
|
||
!LLVMIR: omp_parallel: ; preds = %0 | ||
!LLVMIR: @__kmpc_fork_call | ||
!$OMP DO SCHEDULE(monotonic:dynamic) | ||
!FIRDialect: %[[WS_LB:.*]] = constant 1 : i32 | ||
!FIRDialect: %[[WS_UB:.*]] = constant 9 : i32 | ||
!FIRDialect: %[[WS_STEP:.*]] = constant 1 : i32 | ||
!FIRDialect: omp.wsloop (%[[I:.*]]) : i32 = (%[[WS_LB]]) to (%[[WS_UB]]) step (%[[WS_STEP]]) schedule(dynamic, monotonic) nowait inclusive | ||
|
||
!LLVMIRDialect: %[[WS_UB:.*]] = llvm.mlir.constant(9 : i32) : i32 | ||
!LLVMIRDialect: %[[WS_LB_STEP:.*]] = llvm.mlir.constant(1 : i32) : i32 | ||
!LLVMIRDialect: omp.wsloop (%[[I:.*]]) : i32 = (%[[WS_LB_STEP]]) to (%[[WS_UB]]) step (%[[WS_LB_STEP]]) schedule(dynamic, monotonic) nowait inclusive | ||
|
||
!LLVMIR: define internal void @_QQmain..omp_par | ||
!LLVMIR: omp.par.entry: | ||
!LLVMIR: br label %omp.par.region | ||
!LLVMIR: omp.par.outlined.exit.exitStub: ; preds = %omp.par.pre_finalize | ||
!LLVMIR: ret void | ||
!LLVMIR: omp.par.region: ; preds = %omp.par.entry | ||
!LLVMIR: br label %omp.par.region1 | ||
!LLVMIR: omp.par.region1: ; preds = %omp.par.region | ||
!LLVMIR: br label %omp_loop.preheader | ||
!LLVMIR: omp_loop.preheader: ; preds = %omp.par.region1 | ||
!LLVMIR: @__kmpc_global_thread_num | ||
!LLVMIR: @__kmpc_dispatch_init_4u(%struct.ident_t* @{{.*}}, i32 %omp_global_thread_num{{.*}}, i32 536870947, i32 {{.*}}, i32 {{.*}}, i32 {{.*}}, i32 {{.*}}) | ||
!LLVMIR: br label %omp_loop.preheader.outer.cond | ||
!LLVMIR: omp_loop.preheader.outer.cond: | ||
!LLVMIR: @__kmpc_dispatch_next_4u | ||
!LLVMIR: %{{.*}} = icmp ne i32 %{{.*}}, 0 | ||
!LLVMIR: %{{.*}} = load i32, i32* %p.lowerbound, align 4 | ||
!LLVMIR: %{{.*}} = sub i32 %{{.*}}, 1 | ||
!LLVMIR: br i1 %{{.*}}, label %omp_loop.header, label %omp_loop.exit | ||
!LLVMIR: omp_loop.exit: ; preds = %omp_loop.preheader.outer.cond | ||
!LLVMIR: br label %omp_loop.after | ||
!LLVMIR: omp_loop.header: ; preds = %omp_loop.preheader.outer.cond, %omp_loop.inc | ||
!LLVMIR: %omp_loop.iv = phi i32 [ %lb, %omp_loop.preheader.outer.cond ], [ %omp_loop.next, %omp_loop.inc ] | ||
|
||
do i=1, 9 | ||
print*, i | ||
!FIRDialect: %[[RTBEGIN:.*]] = fir.call @_FortranAioBeginExternalListOutput | ||
!FIRDialect: %[[CONVERTED:.*]] = fir.convert %[[I]] : (i32) -> i64 | ||
!FIRDialect: fir.call @_FortranAioOutputInteger64(%[[RTBEGIN]], %[[CONVERTED]]) : (!fir.ref<i8>, i64) -> i1 | ||
!FIRDialect: fir.call @_FortranAioEndIoStatement(%[[RTBEGIN]]) : (!fir.ref<i8>) -> i32 | ||
|
||
|
||
!LLVMIRDialect: llvm.call @_FortranAioBeginExternalListOutput(%{{.*}}, %{{.*}}, %{{.*}}) : (i32, !llvm.ptr<i8>, i32) -> !llvm.ptr<i8> | ||
!LLVMIRDialect: %{{.*}} = llvm.sext %[[I]] : i32 to i64 | ||
!LLVMIRDialect: llvm.call @_FortranAioOutputInteger64(%{{.*}}, %{{.*}}) : (!llvm.ptr<i8>, i64) -> i1 | ||
!LLVMIRDialect: llvm.call @_FortranAioEndIoStatement(%{{.*}}) : (!llvm.ptr<i8>) -> i32 | ||
|
||
!LLVMIR: br label %omp_loop.cond | ||
!LLVMIR: omp_loop.cond: ; preds = %omp_loop.header | ||
!LLVMIR %{{.*}} = load i32, i32* %{{.*}}, aling {{.*}} | ||
!LLVMIR: %omp_loop.cmp = icmp ult i32 %{{.*}}, %{{.*}} | ||
!LLVMIR: br i1 %omp_loop.cmp, label %omp_loop.body, label %omp_loop.preheader.outer.cond | ||
!LLVMIR: omp_loop.body: ; preds = %omp_loop.cond | ||
!LLVMIR: %{{.*}} = mul i32 %{{.*}}, 1 | ||
!LLVMIR: %{{.*}} = add i32 %{{.*}}, 1 | ||
!LLVMIR: br label %omp.wsloop.region | ||
!LLVMIR: omp.wsloop.region: ; preds = %omp_loop.body | ||
!LLVMIR: %{{.*}} = call i8* @_FortranAioBeginExternalListOutput | ||
!LLVMIR: %{{.*}} = sext i32 %{{.*}} to i64 | ||
!LLVMIR: %{{.*}} = call i1 @_FortranAioOutputInteger64 | ||
!LLVMIR: %{{.*}} = call i32 @_FortranAioEndIoStatement | ||
|
||
end do | ||
!FIRDialect: omp.yield | ||
!FIRDialect: omp.terminator | ||
!FIRDialect: } | ||
|
||
!LLVMIRDialect: omp.yield | ||
!LLVMIRDialect: omp.terminator | ||
!LLVMIRDialect: } | ||
!LLVMIRDialect: llvm.return | ||
!LLVMIRDialect: } | ||
!$OMP END DO NOWAIT | ||
!$OMP END PARALLEL | ||
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,102 @@ | ||
! This test checks lowering of OpenMP DO Directive(Worksharing). | ||
|
||
! RUN: bbc -fopenmp -emit-fir %s -o - | \ | ||
! RUN: FileCheck %s --check-prefix=FIRDialect | ||
! RUN: bbc -fopenmp -emit-fir %s -o - | \ | ||
! RUN: tco --disable-llvm --print-ir-after=fir-to-llvm-ir 2>&1 | \ | ||
! RUN: FileCheck %s --check-prefix=LLVMIRDialect | ||
! RUN: bbc -fopenmp -emit-fir %s -o - | \ | ||
! RUN: tco | FileCheck %s --check-prefix=LLVMIR | ||
|
||
program wsloop_dynamic | ||
integer :: i | ||
!FIRDialect: func @_QQmain() | ||
!LLVMIRDialect: func @_QQmain() | ||
|
||
!LLVMIR: define void @_QQmain() | ||
!LLVMIR:call i32 @__kmpc_global_thread_num{{.*}} | ||
!LLVMIR: br label %omp_parallel | ||
|
||
!$OMP PARALLEL | ||
!FIRDialect-LABLEL: omp.parallel { | ||
!LLVMIRDialect-LABLEL: omp.parallel { | ||
|
||
!LLVMIR: omp_parallel: ; preds = %0 | ||
!LLVMIR: @__kmpc_fork_call | ||
!$OMP DO SCHEDULE(nonmonotonic:dynamic) | ||
!FIRDialect: %[[WS_LB:.*]] = constant 1 : i32 | ||
!FIRDialect: %[[WS_UB:.*]] = constant 9 : i32 | ||
!FIRDialect: %[[WS_STEP:.*]] = constant 1 : i32 | ||
!FIRDialect: omp.wsloop (%[[I:.*]]) : i32 = (%[[WS_LB]]) to (%[[WS_UB]]) step (%[[WS_STEP]]) schedule(dynamic, nonmonotonic) nowait inclusive | ||
|
||
!LLVMIRDialect: %[[WS_UB:.*]] = llvm.mlir.constant(9 : i32) : i32 | ||
!LLVMIRDialect: %[[WS_LB_STEP:.*]] = llvm.mlir.constant(1 : i32) : i32 | ||
!LLVMIRDialect: omp.wsloop (%[[I:.*]]) : i32 = (%[[WS_LB_STEP]]) to (%[[WS_UB]]) step (%[[WS_LB_STEP]]) schedule(dynamic, nonmonotonic) nowait inclusive | ||
|
||
!LLVMIR: define internal void @_QQmain..omp_par | ||
!LLVMIR: omp.par.entry: | ||
!LLVMIR: br label %omp.par.region | ||
!LLVMIR: omp.par.outlined.exit.exitStub: ; preds = %omp.par.pre_finalize | ||
!LLVMIR: ret void | ||
!LLVMIR: omp.par.region: ; preds = %omp.par.entry | ||
!LLVMIR: br label %omp.par.region1 | ||
!LLVMIR: omp.par.region1: ; preds = %omp.par.region | ||
!LLVMIR: br label %omp_loop.preheader | ||
!LLVMIR: omp_loop.preheader: ; preds = %omp.par.region1 | ||
!LLVMIR: @__kmpc_global_thread_num | ||
!LLVMIR: @__kmpc_dispatch_init_4u(%struct.ident_t* @{{.*}}, i32 %omp_global_thread_num{{.*}}, i32 1073741859, i32 {{.*}}, i32 {{.*}}, i32 {{.*}}, i32 {{.*}}) | ||
!LLVMIR: br label %omp_loop.preheader.outer.cond | ||
!LLVMIR: omp_loop.preheader.outer.cond: | ||
!LLVMIR: @__kmpc_dispatch_next_4u | ||
!LLVMIR: %{{.*}} = icmp ne i32 %{{.*}}, 0 | ||
!LLVMIR: %{{.*}} = load i32, i32* %p.lowerbound, align 4 | ||
!LLVMIR: %{{.*}} = sub i32 %{{.*}}, 1 | ||
!LLVMIR: br i1 %{{.*}}, label %omp_loop.header, label %omp_loop.exit | ||
!LLVMIR: omp_loop.exit: ; preds = %omp_loop.preheader.outer.cond | ||
!LLVMIR: br label %omp_loop.after | ||
!LLVMIR: omp_loop.header: ; preds = %omp_loop.preheader.outer.cond, %omp_loop.inc | ||
!LLVMIR: %omp_loop.iv = phi i32 [ %lb, %omp_loop.preheader.outer.cond ], [ %omp_loop.next, %omp_loop.inc ] | ||
|
||
do i=1, 9 | ||
print*, i | ||
!FIRDialect: %[[RTBEGIN:.*]] = fir.call @_FortranAioBeginExternalListOutput | ||
!FIRDialect: %[[CONVERTED:.*]] = fir.convert %[[I]] : (i32) -> i64 | ||
!FIRDialect: fir.call @_FortranAioOutputInteger64(%[[RTBEGIN]], %[[CONVERTED]]) : (!fir.ref<i8>, i64) -> i1 | ||
!FIRDialect: fir.call @_FortranAioEndIoStatement(%[[RTBEGIN]]) : (!fir.ref<i8>) -> i32 | ||
|
||
|
||
!LLVMIRDialect: llvm.call @_FortranAioBeginExternalListOutput(%{{.*}}, %{{.*}}, %{{.*}}) : (i32, !llvm.ptr<i8>, i32) -> !llvm.ptr<i8> | ||
!LLVMIRDialect: %{{.*}} = llvm.sext %arg0 : i32 to i64 | ||
!LLVMIRDialect: llvm.call @_FortranAioOutputInteger64(%{{.*}}, %{{.*}}) : (!llvm.ptr<i8>, i64) -> i1 | ||
!LLVMIRDialect: llvm.call @_FortranAioEndIoStatement(%{{.*}}) : (!llvm.ptr<i8>) -> i32 | ||
|
||
!LLVMIR: br label %omp_loop.cond | ||
!LLVMIR: omp_loop.cond: ; preds = %omp_loop.header | ||
!LLVMIR %{{.*}} = load i32, i32* %{{.*}}, aling {{.*}} | ||
!LLVMIR: %omp_loop.cmp = icmp ult i32 %{{.*}}, %{{.*}} | ||
!LLVMIR: br i1 %omp_loop.cmp, label %omp_loop.body, label %omp_loop.preheader.outer.cond | ||
!LLVMIR: omp_loop.body: ; preds = %omp_loop.cond | ||
!LLVMIR: %{{.*}} = mul i32 %{{.*}}, 1 | ||
!LLVMIR: %{{.*}} = add i32 %{{.*}}, 1 | ||
!LLVMIR: br label %omp.wsloop.region | ||
!LLVMIR: omp.wsloop.region: ; preds = %omp_loop.body | ||
!LLVMIR: %{{.*}} = call i8* @_FortranAioBeginExternalListOutput | ||
!LLVMIR: %{{.*}} = sext i32 %{{.*}} to i64 | ||
!LLVMIR: %{{.*}} = call i1 @_FortranAioOutputInteger64 | ||
!LLVMIR: %{{.*}} = call i32 @_FortranAioEndIoStatement | ||
|
||
end do | ||
!FIRDialect: omp.yield | ||
!FIRDialect: } | ||
!FIRDialect: omp.terminator | ||
!FIRDialect: } | ||
|
||
!LLVMIRDialect: omp.yield | ||
!LLVMIRDialect: } | ||
!LLVMIRDialect: omp.terminator | ||
!LLVMIRDialect: } | ||
!LLVMIRDialect: llvm.return | ||
!LLVMIRDialect: } | ||
!$OMP END DO NOWAIT | ||
!$OMP END PARALLEL | ||
end |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.