Skip to content

Commit 9269aee

Browse files
committed
address review comments
1 parent 8dbfe3c commit 9269aee

File tree

3 files changed

+9
-11
lines changed

3 files changed

+9
-11
lines changed

mlir/include/mlir/IR/SliceWalk.h

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,7 @@ class WalkContinuation {
4545
}
4646

4747
/// Creates a continuation that adds the user-specified `nextValues` to the
48-
/// work list and advances the walk. Unlike advance, this function does not
49-
/// add the control flow predecessor values to the work list.
48+
/// work list and advances the walk.
5049
static WalkContinuation advanceTo(mlir::ValueRange nextValues) {
5150
return WalkContinuation(WalkAction::AdvanceTo, nextValues);
5251
}
@@ -90,8 +89,8 @@ WalkContinuation walkSlice(mlir::ValueRange rootValues,
9089

9190
/// Computes a vector of all control predecessors of `value`. Relies on
9291
/// RegionBranchOpInterface and BranchOpInterface to determine predecessors.
93-
/// Returns nullopt if value has no predecessors or when the relevant operations
94-
/// are missing the interface implementations.
92+
/// Returns nullopt if `value` has no predecessors or when the relevant
93+
/// operations are missing the interface implementations.
9594
std::optional<SmallVector<Value>> getControlFlowPredecessors(Value value);
9695

9796
} // namespace mlir

mlir/lib/Dialect/LLVMIR/Transforms/InlinerInterfaceImpl.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -253,8 +253,8 @@ getUnderlyingObjectSet(Value pointerValue) {
253253
}
254254

255255
// If this place is reached, `val` is a block argument that is not
256-
// understood. Therfore, we conservatively interrupt.
257-
// Note: Dealing with the function arguments is not necessary, as the slice
256+
// understood. Therefore, we conservatively interrupt.
257+
// Note: Dealing with function arguments is not necessary, as the slice
258258
// would have to go through an SSACopyOp first.
259259
return WalkContinuation::interrupt();
260260
});

mlir/lib/IR/SliceWalk.cpp

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -78,9 +78,8 @@ getRegionPredecessorOperands(RegionBranchOpInterface regionOp,
7878
return predecessorOperands;
7979
}
8080

81-
/// Returns the predecessor branch operands that match `blockArg`. Returns a
82-
/// nullopt when some of the predecessor terminators do not implement the
83-
/// BranchOpInterface.
81+
/// Returns the predecessor branch operands that match `blockArg`, or nullopt if
82+
/// some of the predecessor terminators do not implement the BranchOpInterface.
8483
static std::optional<SmallVector<Value>>
8584
getBlockPredecessorOperands(BlockArgument blockArg) {
8685
Block *block = blockArg.getOwner();
@@ -130,8 +129,8 @@ mlir::getControlFlowPredecessors(Value value) {
130129
regionBranchOp, region, blockArg.getArgNumber());
131130
return predecessorOperands;
132131
}
133-
// Unclear how to deal with this operation, conservatively return a
134-
// failure.
132+
// If the interface is not implemented, there are no control flow
133+
// predecessors to work with.
135134
return std::nullopt;
136135
}
137136

0 commit comments

Comments
 (0)