Skip to content

Commit 8c11d6f

Browse files
committed
format
1 parent d92e115 commit 8c11d6f

File tree

2 files changed

+16
-10
lines changed

2 files changed

+16
-10
lines changed

flang/lib/Lower/Bridge.cpp

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3195,7 +3195,7 @@ class FirConverter : public Fortran::lower::AbstractConverter {
31953195
uint64_t collapseDepth = 1;
31963196
uint64_t loopCount = 1;
31973197
auto parseCollapse = [&](const Fortran::parser::AccClauseList &cl)
3198-
-> std::pair<bool, uint64_t> {
3198+
-> std::pair<bool, uint64_t> {
31993199
bool force = false;
32003200
uint64_t depth = 1;
32013201
for (const Fortran::parser::AccClause &clause : cl.v) {
@@ -3244,16 +3244,17 @@ class FirConverter : public Fortran::lower::AbstractConverter {
32443244

32453245
const bool isStructured = curEval && curEval->lowerAsStructured();
32463246
if (isStructured && collapseForce && collapseDepth > 1) {
3247-
// force: collect prologue/epilogue for the first collapseDepth nested loops
3248-
// and sink them into the innermost loop body at that depth
3247+
// force: collect prologue/epilogue for the first collapseDepth nested
3248+
// loops and sink them into the innermost loop body at that depth
32493249
llvm::SmallVector<Fortran::lower::pft::Evaluation *> prologue, epilogue;
32503250
Fortran::lower::pft::Evaluation *parent = &getEval();
32513251
Fortran::lower::pft::Evaluation *innermostLoopEval = nullptr;
32523252
for (uint64_t lvl = 0; lvl + 1 < collapseDepth; ++lvl) {
32533253
epilogue.clear();
32543254
auto &kids = parent->getNestedEvaluations();
3255-
// Collect all non-loop statements before the next inner loop as prologue,
3256-
// then mark remaining siblings as epilogue and descend into the inner loop.
3255+
// Collect all non-loop statements before the next inner loop as
3256+
// prologue, then mark remaining siblings as epilogue and descend into
3257+
// the inner loop.
32573258
Fortran::lower::pft::Evaluation *childLoop = nullptr;
32583259
for (auto it = kids.begin(); it != kids.end(); ++it) {
32593260
if (it->getIf<Fortran::parser::DoConstruct>()) {
@@ -3273,8 +3274,10 @@ class FirConverter : public Fortran::lower::AbstractConverter {
32733274

32743275
// Track sunk evaluations (avoid double-lowering)
32753276
llvm::SmallPtrSet<const Fortran::lower::pft::Evaluation *, 16> sunk;
3276-
for (auto *e : prologue) sunk.insert(e);
3277-
for (auto *e : epilogue) sunk.insert(e);
3277+
for (auto *e : prologue)
3278+
sunk.insert(e);
3279+
for (auto *e : epilogue)
3280+
sunk.insert(e);
32783281

32793282
auto sink =
32803283
[&](llvm::SmallVector<Fortran::lower::pft::Evaluation *> &lst) {
@@ -3285,8 +3288,10 @@ class FirConverter : public Fortran::lower::AbstractConverter {
32853288
sink(prologue);
32863289

32873290
// Lower innermost loop body, skipping sunk
3288-
for (Fortran::lower::pft::Evaluation &e : innermostLoopEval->getNestedEvaluations())
3289-
if (!sunk.contains(&e)) genFIR(e);
3291+
for (Fortran::lower::pft::Evaluation &e :
3292+
innermostLoopEval->getNestedEvaluations())
3293+
if (!sunk.contains(&e))
3294+
genFIR(e);
32903295

32913296
sink(epilogue);
32923297
} else {

flang/lib/Lower/OpenACC.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2147,7 +2147,8 @@ static void processDoLoopBounds(
21472147
// Safely locate the next inner DoConstruct within this eval.
21482148
const Fortran::parser::DoConstruct *innerDo = nullptr;
21492149
if (crtEval && crtEval->hasNestedEvaluations()) {
2150-
for (Fortran::lower::pft::Evaluation &child : crtEval->getNestedEvaluations()) {
2150+
for (Fortran::lower::pft::Evaluation &child :
2151+
crtEval->getNestedEvaluations()) {
21512152
if (auto *stmt = child.getIf<Fortran::parser::DoConstruct>()) {
21522153
innerDo = stmt;
21532154
// Prepare to descend for the next iteration

0 commit comments

Comments
 (0)