Skip to content

Commit 6d56b99

Browse files
committed
Fix formatting
1 parent 20b9903 commit 6d56b99

File tree

5 files changed

+26
-23
lines changed

5 files changed

+26
-23
lines changed

flang/lib/Lower/OpenMP/OpenMP.cpp

Lines changed: 16 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -427,9 +427,10 @@ static void processHostEvalClauses(lower::AbstractConverter &converter,
427427
if (innerOptional.has_value()) {
428428
const auto &innerLoopDirective = innerOptional.value().value();
429429
const auto &innerBegin =
430-
std::get<parser::OmpBeginLoopDirective>(innerLoopDirective.t);
430+
std::get<parser::OmpBeginLoopDirective>(
431+
innerLoopDirective.t);
431432
const auto &innerDirective =
432-
std::get<parser::OmpLoopDirective>(innerBegin.t);
433+
std::get<parser::OmpLoopDirective>(innerBegin.t);
433434
if (innerDirective.v == llvm::omp::Directive::OMPD_tile) {
434435
middleClauseList =
435436
&std::get<parser::OmpClauseList>(innerBegin.t);
@@ -2268,11 +2269,13 @@ static void genUnrollOp(Fortran::lower::AbstractConverter &converter,
22682269
auto cli = canonLoop.getCli();
22692270
mlir::omp::UnrollHeuristicOp::create(firOpBuilder, loc, cli);
22702271

2271-
static mlir::omp::LoopOp
2272-
genTiledLoopOp(lower::AbstractConverter &converter, lower::SymMap &symTable,
2273-
semantics::SemanticsContext &semaCtx, lower::pft::Evaluation &eval,
2274-
mlir::Location loc, const ConstructQueue &queue,
2275-
ConstructQueue::const_iterator item) {
2272+
static mlir::omp::LoopOp genTiledLoopOp(lower::AbstractConverter &converter,
2273+
lower::SymMap &symTable,
2274+
semantics::SemanticsContext &semaCtx,
2275+
lower::pft::Evaluation &eval,
2276+
mlir::Location loc,
2277+
const ConstructQueue &queue,
2278+
ConstructQueue::const_iterator item) {
22762279
mlir::omp::LoopOperands loopClauseOps;
22772280
llvm::SmallVector<const semantics::Symbol *> loopReductionSyms;
22782281
genLoopClauses(converter, semaCtx, item->clauses, loc, loopClauseOps,
@@ -3522,7 +3525,7 @@ static void genOMPDispatch(lower::AbstractConverter &converter,
35223525
break;
35233526
case llvm::omp::Directive::OMPD_tile:
35243527
newOp =
3525-
genTiledLoopOp(converter, symTable, semaCtx, eval, loc, queue, item);
3528+
genTiledLoopOp(converter, symTable, semaCtx, eval, loc, queue, item);
35263529
break;
35273530
case llvm::omp::Directive::OMPD_unroll:
35283531
genUnrollOp(converter, symTable, stmtCtx, semaCtx, eval, loc, queue, item);
@@ -3959,13 +3962,15 @@ static void genOMP(lower::AbstractConverter &converter, lower::SymMap &symTable,
39593962
List<Clause> clauses = makeClauses(
39603963
std::get<parser::OmpClauseList>(beginLoopDirective.t), semaCtx);
39613964

3962-
const auto &innerOptional = std::get<std::optional<common::Indirection<parser::OpenMPLoopConstruct>>>(loopConstruct.t);
3965+
const auto &innerOptional =
3966+
std::get<std::optional<common::Indirection<parser::OpenMPLoopConstruct>>>(
3967+
loopConstruct.t);
39633968
if (innerOptional.has_value()) {
39643969
const auto &innerLoopDirective = innerOptional.value().value();
39653970
const auto &innerBegin =
3966-
std::get<parser::OmpBeginLoopDirective>(innerLoopDirective.t);
3971+
std::get<parser::OmpBeginLoopDirective>(innerLoopDirective.t);
39673972
const auto &innerDirective =
3968-
std::get<parser::OmpLoopDirective>(innerBegin.t);
3973+
std::get<parser::OmpLoopDirective>(innerBegin.t);
39693974
if (innerDirective.v == llvm::omp::Directive::OMPD_tile) {
39703975
clauses.append(
39713976
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
@@ -11,7 +11,7 @@
1111
#include "flang/Parser/parse-tree.h"
1212
#include "flang/Semantics/semantics.h"
1313

14-
# include <stack>
14+
#include <stack>
1515
// After Loop Canonicalization, rewrite OpenMP parse tree to make OpenMP
1616
// Constructs more structured which provide explicit scopes for later
1717
// structural checks and semantic analysis.
@@ -153,7 +153,7 @@ class CanonicalizationOfOmp {
153153
std::stack<parser::OpenMPLoopConstruct *> loops;
154154
loops.push(&x);
155155
if (auto *innerConstruct{
156-
GetConstructIf<parser::OpenMPConstruct>(*nextIt)}) {
156+
GetConstructIf<parser::OpenMPConstruct>(*nextIt)}) {
157157
if (auto *innerOmpLoop{
158158
std::get_if<parser::OpenMPLoopConstruct>(&innerConstruct->u)}) {
159159
auto &innerBeginDir{

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

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

29972997
if (!parser.parseOptionalKeyword("tiles") &&
2998-
(parser.parseLParen() ||
2999-
parser.parseCommaSeparatedList(parseTiles) ||
2998+
(parser.parseLParen() || parser.parseCommaSeparatedList(parseTiles) ||
30002999
parser.parseRParen()))
30013000
return failure();
30023001

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

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2966,7 +2966,7 @@ convertOmpSimd(Operation &opInst, llvm::IRBuilderBase &builder,
29662966
/// Converts an OpenMP loop nest into LLVM IR using OpenMPIRBuilder.
29672967
static LogicalResult
29682968
convertOmpLoopNest(Operation &opInst, llvm::IRBuilderBase &builder,
2969-
LLVM::ModuleTranslation &moduleTranslation) {
2969+
LLVM::ModuleTranslation &moduleTranslation) {
29702970
llvm::OpenMPIRBuilder *ompBuilder = moduleTranslation.getOpenMPBuilder();
29712971
auto loopOp = cast<omp::LoopNestOp>(opInst);
29722972
// Set up the source location value for OpenMP runtime.
@@ -3036,7 +3036,7 @@ convertOmpLoopNest(Operation &opInst, llvm::IRBuilderBase &builder,
30363036

30373037
// llvm::OpenMPIRBuilder::InsertPointTy afterIP = builder.saveIP();
30383038
llvm::OpenMPIRBuilder::InsertPointTy afterIP =
3039-
loopInfos.front()->getAfterIP();
3039+
loopInfos.front()->getAfterIP();
30403040

30413041
// Initialize the new loop info to the current one, in case there
30423042
// are no loop transformations done.
@@ -3048,12 +3048,12 @@ convertOmpLoopNest(Operation &opInst, llvm::IRBuilderBase &builder,
30483048
SmallVector<llvm::Value *> TileSizes;
30493049

30503050
for (auto tile : tiles.value()) {
3051-
llvm::Value *TileVal = llvm::ConstantInt::get(IVType, tile);
3051+
llvm::Value *TileVal = llvm::ConstantInt::get(IVType, tile);
30523052
TileSizes.push_back(TileVal);
30533053
}
30543054

3055-
std::vector<llvm::CanonicalLoopInfo*> NewLoops =
3056-
ompBuilder->tileLoops(ompLoc.DL, loopInfos, TileSizes);
3055+
std::vector<llvm::CanonicalLoopInfo *> NewLoops =
3056+
ompBuilder->tileLoops(ompLoc.DL, loopInfos, TileSizes);
30573057

30583058
// Collapse loops. Store the insertion point because LoopInfos may get
30593059
// invalidated.
@@ -3064,7 +3064,7 @@ convertOmpLoopNest(Operation &opInst, llvm::IRBuilderBase &builder,
30643064

30653065
// Update the loop infos
30663066
loopInfos.clear();
3067-
for (const auto& newLoop : NewLoops) {
3067+
for (const auto &newLoop : NewLoops) {
30683068
loopInfos.push_back(newLoop);
30693069
}
30703070
} // Tiling done

0 commit comments

Comments
 (0)