Skip to content

Commit c38b1fa

Browse files
authored
[mlir] Fix loop-like interface (#95817)
Using the `this` pointer inside interface methods is illegal because it breaks concept-based interfaces. It is necessary to use `$_op` instead. Co-authored-by: ikulagin <[email protected]>
1 parent c6ff244 commit c38b1fa

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

mlir/include/mlir/Interfaces/LoopLikeInterface.td

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -246,31 +246,31 @@ def LoopLikeOpInterface : OpInterface<"LoopLikeOpInterface"> {
246246
/// If there is a single induction variable return it, otherwise return
247247
/// std::nullopt.
248248
::std::optional<::mlir::Value> getSingleInductionVar() {
249-
auto inductionVars = this->getLoopInductionVars();
249+
auto inductionVars = $_op.getLoopInductionVars();
250250
if (inductionVars.has_value() && (*inductionVars).size() == 1)
251251
return (*inductionVars)[0];
252252
return std::nullopt;
253253
}
254254
/// Return the single lower bound value or attribute if it exists, otherwise
255255
/// return std::nullopt.
256256
::std::optional<::mlir::OpFoldResult> getSingleLowerBound() {
257-
auto lowerBounds = this->getLoopLowerBounds();
257+
auto lowerBounds = $_op.getLoopLowerBounds();
258258
if (lowerBounds.has_value() && (*lowerBounds).size() == 1)
259259
return (*lowerBounds)[0];
260260
return std::nullopt;
261261
}
262262
/// Return the single step value or attribute if it exists, otherwise
263263
/// return std::nullopt.
264264
::std::optional<::mlir::OpFoldResult> getSingleStep() {
265-
auto steps = this->getLoopSteps();
265+
auto steps = $_op.getLoopSteps();
266266
if (steps.has_value() && (*steps).size() == 1)
267267
return (*steps)[0];
268268
return std::nullopt;
269269
}
270270
/// Return the single upper bound value or attribute if it exists, otherwise
271271
/// return std::nullopt.
272272
::std::optional<::mlir::OpFoldResult> getSingleUpperBound() {
273-
auto upperBounds = this->getLoopUpperBounds();
273+
auto upperBounds = $_op.getLoopUpperBounds();
274274
if (upperBounds.has_value() && (*upperBounds).size() == 1)
275275
return (*upperBounds)[0];
276276
return std::nullopt;

0 commit comments

Comments
 (0)