Skip to content

Commit f10a7eb

Browse files
committed
Address code review comments
1 parent 6c204fd commit f10a7eb

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

clang/lib/CIR/Interfaces/CIRLoopOpInterface.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -25,17 +25,18 @@ void LoopOpInterface::getLoopOpSuccessorRegions(
2525
return;
2626
}
2727

28+
mlir::Region *parentRegion =
29+
point.getTerminatorPredecessorOrNull()->getParentRegion();
30+
2831
// Branching from condition: go to body or exit.
29-
if (&op.getCond() ==
30-
point.getTerminatorPredecessorOrNull()->getParentRegion()) {
32+
if (&op.getCond() == parentRegion) {
3133
regions.emplace_back(mlir::RegionSuccessor(op, op->getResults()));
3234
regions.emplace_back(&op.getBody(), op.getBody().getArguments());
3335
return;
3436
}
3537

3638
// Branching from body: go to step (for) or condition.
37-
if (&op.getBody() ==
38-
point.getTerminatorPredecessorOrNull()->getParentRegion()) {
39+
if (&op.getBody() == parentRegion) {
3940
// FIXME(cir): Should we consider break/continue statements here?
4041
mlir::Region *afterBody =
4142
(op.maybeGetStep() ? op.maybeGetStep() : &op.getCond());
@@ -44,8 +45,7 @@ void LoopOpInterface::getLoopOpSuccessorRegions(
4445
}
4546

4647
// Branching from step: go to condition.
47-
if (op.maybeGetStep() ==
48-
point.getTerminatorPredecessorOrNull()->getParentRegion()) {
48+
if (op.maybeGetStep() == parentRegion) {
4949
regions.emplace_back(&op.getCond(), op.getCond().getArguments());
5050
return;
5151
}

0 commit comments

Comments
 (0)