Skip to content

Commit 7e7437b

Browse files
committed
Fix formatting
1 parent 5c17a0d commit 7e7437b

File tree

7 files changed

+31
-27
lines changed

7 files changed

+31
-27
lines changed

flang/include/flang/Parser/parse-tree.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5024,10 +5024,10 @@ struct OpenMPBlockConstruct {
50245024
struct OpenMPLoopConstruct {
50255025
TUPLE_CLASS_BOILERPLATE(OpenMPLoopConstruct);
50265026
OpenMPLoopConstruct(OmpBeginLoopDirective &&a)
5027-
: t({std::move(a), std::nullopt, std::nullopt, std::nullopt}) {}
5027+
: t({std::move(a), std::nullopt, std::nullopt, std::nullopt}) {}
50285028
std::tuple<OmpBeginLoopDirective, std::optional<DoConstruct>,
5029-
std::optional<common::Indirection<OpenMPLoopConstruct>>,
5030-
std::optional<OmpEndLoopDirective>>
5029+
std::optional<common::Indirection<OpenMPLoopConstruct>>,
5030+
std::optional<OmpEndLoopDirective>>
50315031
t;
50325032
};
50335033

flang/lib/Lower/OpenMP/OpenMP.cpp

Lines changed: 16 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -482,9 +482,10 @@ static void processHostEvalClauses(lower::AbstractConverter &converter,
482482
if (innerOptional.has_value()) {
483483
const auto &innerLoopDirective = innerOptional.value().value();
484484
const auto &innerBegin =
485-
std::get<parser::OmpBeginLoopDirective>(innerLoopDirective.t);
485+
std::get<parser::OmpBeginLoopDirective>(
486+
innerLoopDirective.t);
486487
const auto &innerDirective =
487-
std::get<parser::OmpLoopDirective>(innerBegin.t);
488+
std::get<parser::OmpLoopDirective>(innerBegin.t);
488489
if (innerDirective.v == llvm::omp::Directive::OMPD_tile) {
489490
middleClauseList =
490491
&std::get<parser::OmpClauseList>(innerBegin.t);
@@ -2169,11 +2170,13 @@ genLoopOp(lower::AbstractConverter &converter, lower::SymMap &symTable,
21692170
return loopOp;
21702171
}
21712172

2172-
static mlir::omp::LoopOp
2173-
genTiledLoopOp(lower::AbstractConverter &converter, lower::SymMap &symTable,
2174-
semantics::SemanticsContext &semaCtx, lower::pft::Evaluation &eval,
2175-
mlir::Location loc, const ConstructQueue &queue,
2176-
ConstructQueue::const_iterator item) {
2173+
static mlir::omp::LoopOp genTiledLoopOp(lower::AbstractConverter &converter,
2174+
lower::SymMap &symTable,
2175+
semantics::SemanticsContext &semaCtx,
2176+
lower::pft::Evaluation &eval,
2177+
mlir::Location loc,
2178+
const ConstructQueue &queue,
2179+
ConstructQueue::const_iterator item) {
21772180
mlir::omp::LoopOperands loopClauseOps;
21782181
llvm::SmallVector<const semantics::Symbol *> loopReductionSyms;
21792182
genLoopClauses(converter, semaCtx, item->clauses, loc, loopClauseOps,
@@ -3683,7 +3686,7 @@ static void genOMPDispatch(lower::AbstractConverter &converter,
36833686
break;
36843687
case llvm::omp::Directive::OMPD_tile:
36853688
newOp =
3686-
genTiledLoopOp(converter, symTable, semaCtx, eval, loc, queue, item);
3689+
genTiledLoopOp(converter, symTable, semaCtx, eval, loc, queue, item);
36873690
break;
36883691
case llvm::omp::Directive::OMPD_unroll: {
36893692
unsigned version = semaCtx.langOptions().OpenMPVersion;
@@ -4262,13 +4265,15 @@ static void genOMP(lower::AbstractConverter &converter, lower::SymMap &symTable,
42624265
List<Clause> clauses = makeClauses(
42634266
std::get<parser::OmpClauseList>(beginLoopDirective.t), semaCtx);
42644267

4265-
const auto &innerOptional = std::get<std::optional<common::Indirection<parser::OpenMPLoopConstruct>>>(loopConstruct.t);
4268+
const auto &innerOptional =
4269+
std::get<std::optional<common::Indirection<parser::OpenMPLoopConstruct>>>(
4270+
loopConstruct.t);
42664271
if (innerOptional.has_value()) {
42674272
const auto &innerLoopDirective = innerOptional.value().value();
42684273
const auto &innerBegin =
4269-
std::get<parser::OmpBeginLoopDirective>(innerLoopDirective.t);
4274+
std::get<parser::OmpBeginLoopDirective>(innerLoopDirective.t);
42704275
const auto &innerDirective =
4271-
std::get<parser::OmpLoopDirective>(innerBegin.t);
4276+
std::get<parser::OmpLoopDirective>(innerBegin.t);
42724277
if (innerDirective.v == llvm::omp::Directive::OMPD_tile) {
42734278
clauses.append(
42744279
makeClauses(std::get<parser::OmpClauseList>(innerBegin.t), semaCtx));

flang/lib/Lower/OpenMP/Utils.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,7 @@ int64_t getCollapseValue(const List<Clause> &clauses) {
5151
}
5252

5353
collapseValue = collapseValue - numTileSizes;
54-
int64_t result =
55-
collapseValue > numTileSizes ? collapseValue : numTileSizes;
54+
int64_t result = collapseValue > numTileSizes ? collapseValue : numTileSizes;
5655
return result;
5756
}
5857

flang/lib/Semantics/canonicalize-omp.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
#include "canonicalize-omp.h"
1010
#include "flang/Parser/parse-tree-visitor.h"
11-
# include <stack>
11+
#include <stack>
1212
// After Loop Canonicalization, rewrite OpenMP parse tree to make OpenMP
1313
// Constructs more structured which provide explicit scopes for later
1414
// structural checks and semantic analysis.
@@ -137,7 +137,7 @@ class CanonicalizationOfOmp {
137137
std::stack<parser::OpenMPLoopConstruct *> loops;
138138
loops.push(&x);
139139
if (auto *innerConstruct{
140-
GetConstructIf<parser::OpenMPConstruct>(*nextIt)}) {
140+
GetConstructIf<parser::OpenMPConstruct>(*nextIt)}) {
141141
if (auto *innerOmpLoop{
142142
std::get_if<parser::OpenMPLoopConstruct>(&innerConstruct->u)}) {
143143
auto &innerBeginDir{

flang/lib/Semantics/resolve-directives.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2069,7 +2069,8 @@ void OmpAttributeVisitor::PrivatizeAssociatedLoopIndexAndCheckLoopLevel(
20692069
innerMostLoop = &innerLoop.value().value();
20702070
}
20712071

2072-
const auto &outer{std::get<std::optional<parser::DoConstruct>>(innerMostLoop->t)};
2072+
const auto &outer{
2073+
std::get<std::optional<parser::DoConstruct>>(innerMostLoop->t)};
20732074
if (outer.has_value()) {
20742075
for (const parser::DoConstruct *loop{&*outer}; loop && level > 0; --level) {
20752076
if (loop->IsDoConcurrent()) {

mlir/lib/Dialect/OpenMP/IR/OpenMPDialect.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2978,8 +2978,7 @@ ParseResult LoopNestOp::parse(OpAsmParser &parser, OperationState &result) {
29782978
};
29792979

29802980
if (!parser.parseOptionalKeyword("tiles") &&
2981-
(parser.parseLParen() ||
2982-
parser.parseCommaSeparatedList(parseTiles) ||
2981+
(parser.parseLParen() || parser.parseCommaSeparatedList(parseTiles) ||
29832982
parser.parseRParen()))
29842983
return failure();
29852984

mlir/lib/Target/LLVMIR/Dialect/OpenMP/OpenMPToLLVMIRTranslation.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2923,7 +2923,7 @@ convertOmpSimd(Operation &opInst, llvm::IRBuilderBase &builder,
29232923
/// Converts an OpenMP loop nest into LLVM IR using OpenMPIRBuilder.
29242924
static LogicalResult
29252925
convertOmpLoopNest(Operation &opInst, llvm::IRBuilderBase &builder,
2926-
LLVM::ModuleTranslation &moduleTranslation) {
2926+
LLVM::ModuleTranslation &moduleTranslation) {
29272927
llvm::OpenMPIRBuilder *ompBuilder = moduleTranslation.getOpenMPBuilder();
29282928
auto loopOp = cast<omp::LoopNestOp>(opInst);
29292929
// Set up the source location value for OpenMP runtime.
@@ -2993,7 +2993,7 @@ convertOmpLoopNest(Operation &opInst, llvm::IRBuilderBase &builder,
29932993

29942994
// llvm::OpenMPIRBuilder::InsertPointTy afterIP = builder.saveIP();
29952995
llvm::OpenMPIRBuilder::InsertPointTy afterIP =
2996-
loopInfos.front()->getAfterIP();
2996+
loopInfos.front()->getAfterIP();
29972997

29982998
// Initialize the new loop info to the current one, in case there
29992999
// are no loop transformations done.
@@ -3005,12 +3005,12 @@ convertOmpLoopNest(Operation &opInst, llvm::IRBuilderBase &builder,
30053005
SmallVector<llvm::Value *> TileSizes;
30063006

30073007
for (auto tile : tiles.value()) {
3008-
llvm::Value *TileVal = llvm::ConstantInt::get(IVType, tile);
3008+
llvm::Value *TileVal = llvm::ConstantInt::get(IVType, tile);
30093009
TileSizes.push_back(TileVal);
30103010
}
30113011

3012-
std::vector<llvm::CanonicalLoopInfo*> NewLoops =
3013-
ompBuilder->tileLoops(ompLoc.DL, loopInfos, TileSizes);
3012+
std::vector<llvm::CanonicalLoopInfo *> NewLoops =
3013+
ompBuilder->tileLoops(ompLoc.DL, loopInfos, TileSizes);
30143014

30153015
// Collapse loops. Store the insertion point because LoopInfos may get
30163016
// invalidated.
@@ -3021,7 +3021,7 @@ convertOmpLoopNest(Operation &opInst, llvm::IRBuilderBase &builder,
30213021

30223022
// Update the loop infos
30233023
loopInfos.clear();
3024-
for (const auto& newLoop : NewLoops) {
3024+
for (const auto &newLoop : NewLoops) {
30253025
loopInfos.push_back(newLoop);
30263026
}
30273027
} // Tiling done

0 commit comments

Comments
 (0)