@@ -2403,8 +2403,7 @@ static void createBodyOfOp(Op &op, OpWithBodyGenInfo &info) {
2403
2403
// is more complicated, especially with unstructured control flow, there
2404
2404
// may be multiple blocks, and some of them may have non-OMP terminators
2405
2405
// resulting from lowering of the code contained within the operation.
2406
- // All the remaining blocks are potential exit points from the op's
2407
- // region.
2406
+ // All the remaining blocks are potential exit points from the op's region.
2408
2407
//
2409
2408
// Explicit control flow cannot exit any OpenMP region (other than via
2410
2409
// STOP), and that is enforced by semantic checks prior to lowering. STOP
@@ -2769,9 +2768,8 @@ genEnterExitUpdateDataOp(Fortran::lower::AbstractConverter &converter,
2769
2768
deviceOperand, nowaitAttr, mapOperands);
2770
2769
}
2771
2770
2772
- // This functions creates a block for the body of the targetOp's region. It
2773
- // adds all the symbols present in mapSymbols as block arguments to this
2774
- // block.
2771
+ // This functions creates a block for the body of the targetOp's region. It adds
2772
+ // all the symbols present in mapSymbols as block arguments to this block.
2775
2773
static void genBodyOfTargetOp (
2776
2774
Fortran::lower::AbstractConverter &converter,
2777
2775
Fortran::lower::pft::Evaluation &eval, bool genNested,
@@ -2788,8 +2786,7 @@ static void genBodyOfTargetOp(
2788
2786
auto *regionBlock =
2789
2787
firOpBuilder.createBlock (®ion, {}, mapSymTypes, mapSymLocs);
2790
2788
2791
- // Clones the `bounds` placing them inside the target region and returns
2792
- // them.
2789
+ // Clones the `bounds` placing them inside the target region and returns them.
2793
2790
auto cloneBound = [&](mlir::Value bound) {
2794
2791
if (mlir::isMemoryEffectFree (bound.getDefiningOp ())) {
2795
2792
mlir::Operation *clonedOp = bound.getDefiningOp ()->clone ();
@@ -2851,11 +2848,10 @@ static void genBodyOfTargetOp(
2851
2848
});
2852
2849
}
2853
2850
2854
- // Check if cloning the bounds introduced any dependency on the outer
2855
- // region. If so, then either clone them as well if they are
2856
- // MemoryEffectFree, or else copy them to a new temporary and add them to
2857
- // the map and block_argument lists and replace their uses with the new
2858
- // temporary.
2851
+ // Check if cloning the bounds introduced any dependency on the outer region.
2852
+ // If so, then either clone them as well if they are MemoryEffectFree, or else
2853
+ // copy them to a new temporary and add them to the map and block_argument
2854
+ // lists and replace their uses with the new temporary.
2859
2855
llvm::SetVector<mlir::Value> valuesDefinedAbove;
2860
2856
mlir::getUsedValuesDefinedAbove (region, valuesDefinedAbove);
2861
2857
while (!valuesDefinedAbove.empty ()) {
@@ -3448,8 +3444,8 @@ static void createSimdWsLoop(
3448
3444
// OpenMP standard does not specify the length of vector instructions.
3449
3445
// Currently we safely assume that for !$omp do simd pragma the SIMD length
3450
3446
// is equal to 1 (i.e. we generate standard workshare loop).
3451
- // When support for vectorization is enabled, then we need to add handling
3452
- // of if clause. Currently if clause can be skipped because we always assume
3447
+ // When support for vectorization is enabled, then we need to add handling of
3448
+ // if clause. Currently if clause can be skipped because we always assume
3453
3449
// SIMD length = 1.
3454
3450
createWsLoop (converter, eval, ompDirective, beginClauseList, endClauseList,
3455
3451
loc);
@@ -3857,8 +3853,8 @@ static void genOMP(Fortran::lower::AbstractConverter &converter,
3857
3853
3858
3854
// The function or global already has a declare target applied to it, very
3859
3855
// likely through implicit capture (usage in another declare target
3860
- // function/subroutine). It should be marked as any if it has been
3861
- // assigned both host and nohost, else we skip, as there is no change
3856
+ // function/subroutine). It should be marked as any if it has been assigned
3857
+ // both host and nohost, else we skip, as there is no change
3862
3858
if (declareTargetOp.isDeclareTarget ()) {
3863
3859
if (declareTargetOp.getDeclareTargetDeviceType () != deviceType)
3864
3860
declareTargetOp.setDeclareTarget (
@@ -4037,8 +4033,8 @@ void Fortran::lower::genThreadprivateOp(
4037
4033
Fortran::semantics::FindCommonBlockContaining (sym.GetUltimate ())) {
4038
4034
mlir::Value commonValue = converter.getSymbolAddress (*common);
4039
4035
if (mlir::isa<mlir::omp::ThreadprivateOp>(commonValue.getDefiningOp ())) {
4040
- // Generate ThreadprivateOp for a common block instead of its members
4041
- // and only do it once for a common block.
4036
+ // Generate ThreadprivateOp for a common block instead of its members and
4037
+ // only do it once for a common block.
4042
4038
return ;
4043
4039
}
4044
4040
// Generate ThreadprivateOp and rebind the common block.
@@ -4051,8 +4047,8 @@ void Fortran::lower::genThreadprivateOp(
4051
4047
sym, commonThreadprivateValue);
4052
4048
} else if (!var.isGlobal ()) {
4053
4049
// Non-global variable which can be in threadprivate directive must be one
4054
- // variable in main program, and it has implicit SAVE attribute. Take it
4055
- // as with SAVE attribute, so to create GlobalOp for it to simplify the
4050
+ // variable in main program, and it has implicit SAVE attribute. Take it as
4051
+ // with SAVE attribute, so to create GlobalOp for it to simplify the
4056
4052
// translation to LLVM IR.
4057
4053
fir::GlobalOp global = globalInitialization (converter, firOpBuilder, sym,
4058
4054
var, currentLocation);
@@ -4064,9 +4060,9 @@ void Fortran::lower::genThreadprivateOp(
4064
4060
} else {
4065
4061
mlir::Value symValue = converter.getSymbolAddress (sym);
4066
4062
4067
- // The symbol may be use-associated multiple times, and nothing needs to
4068
- // be done after the original symbol is mapped to the threadprivatized
4069
- // value for the first time. Use the threadprivatized value directly.
4063
+ // The symbol may be use-associated multiple times, and nothing needs to be
4064
+ // done after the original symbol is mapped to the threadprivatized value
4065
+ // for the first time. Use the threadprivatized value directly.
4070
4066
mlir::Operation *op;
4071
4067
if (auto declOp = symValue.getDefiningOp <hlfir::DeclareOp>())
4072
4068
op = declOp.getMemref ().getDefiningOp ();
@@ -4104,12 +4100,11 @@ void Fortran::lower::genDeclareTargetIntGlobal(
4104
4100
4105
4101
// Generate an OpenMP reduction operation.
4106
4102
// TODO: Currently assumes it is either an integer addition/multiplication
4107
- // reduction, or a logical and reduction. Generalize this for various
4108
- // reduction operation types.
4103
+ // reduction, or a logical and reduction. Generalize this for various reduction
4104
+ // operation types.
4109
4105
// TODO: Generate the reduction operation during lowering instead of creating
4110
4106
// and removing operations since this is not a robust approach. Also, removing
4111
- // ops in the builder (instead of a rewriter) is probably not the best
4112
- // approach.
4107
+ // ops in the builder (instead of a rewriter) is probably not the best approach.
4113
4108
void Fortran::lower::genOpenMPReduction (
4114
4109
Fortran::lower::AbstractConverter &converter,
4115
4110
const Fortran::parser::OmpClauseList &clauseList) {
0 commit comments