Skip to content

Commit b52269c

Browse files
committed
Fix formatting
1 parent 9393ecc commit b52269c

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
@@ -5075,10 +5075,10 @@ struct OpenMPBlockConstruct {
50755075
struct OpenMPLoopConstruct {
50765076
TUPLE_CLASS_BOILERPLATE(OpenMPLoopConstruct);
50775077
OpenMPLoopConstruct(OmpBeginLoopDirective &&a)
5078-
: t({std::move(a), std::nullopt, std::nullopt, std::nullopt}) {}
5078+
: t({std::move(a), std::nullopt, std::nullopt, std::nullopt}) {}
50795079
std::tuple<OmpBeginLoopDirective, std::optional<DoConstruct>,
5080-
std::optional<common::Indirection<OpenMPLoopConstruct>>,
5081-
std::optional<OmpEndLoopDirective>>
5080+
std::optional<common::Indirection<OpenMPLoopConstruct>>,
5081+
std::optional<OmpEndLoopDirective>>
50825082
t;
50835083
};
50845084

flang/lib/Lower/OpenMP/OpenMP.cpp

Lines changed: 16 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -477,9 +477,10 @@ static void processHostEvalClauses(lower::AbstractConverter &converter,
477477
if (innerOptional.has_value()) {
478478
const auto &innerLoopDirective = innerOptional.value().value();
479479
const auto &innerBegin =
480-
std::get<parser::OmpBeginLoopDirective>(innerLoopDirective.t);
480+
std::get<parser::OmpBeginLoopDirective>(
481+
innerLoopDirective.t);
481482
const auto &innerDirective =
482-
std::get<parser::OmpLoopDirective>(innerBegin.t);
483+
std::get<parser::OmpLoopDirective>(innerBegin.t);
483484
if (innerDirective.v == llvm::omp::Directive::OMPD_tile) {
484485
middleClauseList =
485486
&std::get<parser::OmpClauseList>(innerBegin.t);
@@ -2153,11 +2154,13 @@ genLoopOp(lower::AbstractConverter &converter, lower::SymMap &symTable,
21532154
return loopOp;
21542155
}
21552156

2156-
static mlir::omp::LoopOp
2157-
genTiledLoopOp(lower::AbstractConverter &converter, lower::SymMap &symTable,
2158-
semantics::SemanticsContext &semaCtx, lower::pft::Evaluation &eval,
2159-
mlir::Location loc, const ConstructQueue &queue,
2160-
ConstructQueue::const_iterator item) {
2157+
static mlir::omp::LoopOp genTiledLoopOp(lower::AbstractConverter &converter,
2158+
lower::SymMap &symTable,
2159+
semantics::SemanticsContext &semaCtx,
2160+
lower::pft::Evaluation &eval,
2161+
mlir::Location loc,
2162+
const ConstructQueue &queue,
2163+
ConstructQueue::const_iterator item) {
21612164
mlir::omp::LoopOperands loopClauseOps;
21622165
llvm::SmallVector<const semantics::Symbol *> loopReductionSyms;
21632166
genLoopClauses(converter, semaCtx, item->clauses, loc, loopClauseOps,
@@ -4007,7 +4010,7 @@ static void genOMPDispatch(lower::AbstractConverter &converter,
40074010
break;
40084011
case llvm::omp::Directive::OMPD_tile:
40094012
newOp =
4010-
genTiledLoopOp(converter, symTable, semaCtx, eval, loc, queue, item);
4013+
genTiledLoopOp(converter, symTable, semaCtx, eval, loc, queue, item);
40114014
break;
40124015
case llvm::omp::Directive::OMPD_unroll: {
40134016
unsigned version = semaCtx.langOptions().OpenMPVersion;
@@ -4461,13 +4464,15 @@ static void genOMP(lower::AbstractConverter &converter, lower::SymMap &symTable,
44614464
List<Clause> clauses = makeClauses(
44624465
std::get<parser::OmpClauseList>(beginLoopDirective.t), semaCtx);
44634466

4464-
const auto &innerOptional = std::get<std::optional<common::Indirection<parser::OpenMPLoopConstruct>>>(loopConstruct.t);
4467+
const auto &innerOptional =
4468+
std::get<std::optional<common::Indirection<parser::OpenMPLoopConstruct>>>(
4469+
loopConstruct.t);
44654470
if (innerOptional.has_value()) {
44664471
const auto &innerLoopDirective = innerOptional.value().value();
44674472
const auto &innerBegin =
4468-
std::get<parser::OmpBeginLoopDirective>(innerLoopDirective.t);
4473+
std::get<parser::OmpBeginLoopDirective>(innerLoopDirective.t);
44694474
const auto &innerDirective =
4470-
std::get<parser::OmpLoopDirective>(innerBegin.t);
4475+
std::get<parser::OmpLoopDirective>(innerBegin.t);
44714476
if (innerDirective.v == llvm::omp::Directive::OMPD_tile) {
44724477
clauses.append(
44734478
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
@@ -2061,7 +2061,8 @@ void OmpAttributeVisitor::PrivatizeAssociatedLoopIndexAndCheckLoopLevel(
20612061
innerMostLoop = &innerLoop.value().value();
20622062
}
20632063

2064-
const auto &outer{std::get<std::optional<parser::DoConstruct>>(innerMostLoop->t)};
2064+
const auto &outer{
2065+
std::get<std::optional<parser::DoConstruct>>(innerMostLoop->t)};
20652066
if (outer.has_value()) {
20662067
for (const parser::DoConstruct *loop{&*outer}; loop && level > 0; --level) {
20672068
// go through all the nested do-loops and resolve index variables

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)