Skip to content

Commit b52544b

Browse files
committed
Undo formatting changes.
1 parent f898071 commit b52544b

File tree

1 file changed

+22
-27
lines changed

1 file changed

+22
-27
lines changed

flang/lib/Lower/OpenMP.cpp

Lines changed: 22 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -2403,8 +2403,7 @@ static void createBodyOfOp(Op &op, OpWithBodyGenInfo &info) {
24032403
// is more complicated, especially with unstructured control flow, there
24042404
// may be multiple blocks, and some of them may have non-OMP terminators
24052405
// 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.
24082407
//
24092408
// Explicit control flow cannot exit any OpenMP region (other than via
24102409
// STOP), and that is enforced by semantic checks prior to lowering. STOP
@@ -2769,9 +2768,8 @@ genEnterExitUpdateDataOp(Fortran::lower::AbstractConverter &converter,
27692768
deviceOperand, nowaitAttr, mapOperands);
27702769
}
27712770

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.
27752773
static void genBodyOfTargetOp(
27762774
Fortran::lower::AbstractConverter &converter,
27772775
Fortran::lower::pft::Evaluation &eval, bool genNested,
@@ -2788,8 +2786,7 @@ static void genBodyOfTargetOp(
27882786
auto *regionBlock =
27892787
firOpBuilder.createBlock(&region, {}, mapSymTypes, mapSymLocs);
27902788

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.
27932790
auto cloneBound = [&](mlir::Value bound) {
27942791
if (mlir::isMemoryEffectFree(bound.getDefiningOp())) {
27952792
mlir::Operation *clonedOp = bound.getDefiningOp()->clone();
@@ -2851,11 +2848,10 @@ static void genBodyOfTargetOp(
28512848
});
28522849
}
28532850

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.
28592855
llvm::SetVector<mlir::Value> valuesDefinedAbove;
28602856
mlir::getUsedValuesDefinedAbove(region, valuesDefinedAbove);
28612857
while (!valuesDefinedAbove.empty()) {
@@ -3448,8 +3444,8 @@ static void createSimdWsLoop(
34483444
// OpenMP standard does not specify the length of vector instructions.
34493445
// Currently we safely assume that for !$omp do simd pragma the SIMD length
34503446
// 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
34533449
// SIMD length = 1.
34543450
createWsLoop(converter, eval, ompDirective, beginClauseList, endClauseList,
34553451
loc);
@@ -3857,8 +3853,8 @@ static void genOMP(Fortran::lower::AbstractConverter &converter,
38573853

38583854
// The function or global already has a declare target applied to it, very
38593855
// 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
38623858
if (declareTargetOp.isDeclareTarget()) {
38633859
if (declareTargetOp.getDeclareTargetDeviceType() != deviceType)
38643860
declareTargetOp.setDeclareTarget(
@@ -4037,8 +4033,8 @@ void Fortran::lower::genThreadprivateOp(
40374033
Fortran::semantics::FindCommonBlockContaining(sym.GetUltimate())) {
40384034
mlir::Value commonValue = converter.getSymbolAddress(*common);
40394035
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.
40424038
return;
40434039
}
40444040
// Generate ThreadprivateOp and rebind the common block.
@@ -4051,8 +4047,8 @@ void Fortran::lower::genThreadprivateOp(
40514047
sym, commonThreadprivateValue);
40524048
} else if (!var.isGlobal()) {
40534049
// 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
40564052
// translation to LLVM IR.
40574053
fir::GlobalOp global = globalInitialization(converter, firOpBuilder, sym,
40584054
var, currentLocation);
@@ -4064,9 +4060,9 @@ void Fortran::lower::genThreadprivateOp(
40644060
} else {
40654061
mlir::Value symValue = converter.getSymbolAddress(sym);
40664062

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.
40704066
mlir::Operation *op;
40714067
if (auto declOp = symValue.getDefiningOp<hlfir::DeclareOp>())
40724068
op = declOp.getMemref().getDefiningOp();
@@ -4104,12 +4100,11 @@ void Fortran::lower::genDeclareTargetIntGlobal(
41044100

41054101
// Generate an OpenMP reduction operation.
41064102
// 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.
41094105
// TODO: Generate the reduction operation during lowering instead of creating
41104106
// 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.
41134108
void Fortran::lower::genOpenMPReduction(
41144109
Fortran::lower::AbstractConverter &converter,
41154110
const Fortran::parser::OmpClauseList &clauseList) {

0 commit comments

Comments
 (0)