[Mlir-commits] [mlir] [mlir] Fix loop-like interface (PR #95817)
Ivan Kulagin
llvmlistbot at llvm.org
Mon Jun 17 10:53:46 PDT 2024
https://github.com/ikulagin created https://github.com/llvm/llvm-project/pull/95817
Using the `this` pointer inside interface methods is illegal because it breaks concept-based interfaces.
It is necessary to use `$_op` instead.
>From d4165e3c24ac065cb943814c923f05ca5decddf2 Mon Sep 17 00:00:00 2001
From: ikulagin <i.kulagin at ispras.ru>
Date: Mon, 17 Jun 2024 20:40:12 +0300
Subject: [PATCH] [mlir] Fix loop-like interface
---
mlir/include/mlir/Interfaces/LoopLikeInterface.td | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/mlir/include/mlir/Interfaces/LoopLikeInterface.td b/mlir/include/mlir/Interfaces/LoopLikeInterface.td
index b748d5e29114a..7db624ba43974 100644
--- a/mlir/include/mlir/Interfaces/LoopLikeInterface.td
+++ b/mlir/include/mlir/Interfaces/LoopLikeInterface.td
@@ -246,7 +246,7 @@ def LoopLikeOpInterface : OpInterface<"LoopLikeOpInterface"> {
/// If there is a single induction variable return it, otherwise return
/// std::nullopt.
::std::optional<::mlir::Value> getSingleInductionVar() {
- auto inductionVars = this->getLoopInductionVars();
+ auto inductionVars = $_op.getLoopInductionVars();
if (inductionVars.has_value() && (*inductionVars).size() == 1)
return (*inductionVars)[0];
return std::nullopt;
@@ -254,7 +254,7 @@ def LoopLikeOpInterface : OpInterface<"LoopLikeOpInterface"> {
/// Return the single lower bound value or attribute if it exists, otherwise
/// return std::nullopt.
::std::optional<::mlir::OpFoldResult> getSingleLowerBound() {
- auto lowerBounds = this->getLoopLowerBounds();
+ auto lowerBounds = $_op.getLoopLowerBounds();
if (lowerBounds.has_value() && (*lowerBounds).size() == 1)
return (*lowerBounds)[0];
return std::nullopt;
@@ -262,7 +262,7 @@ def LoopLikeOpInterface : OpInterface<"LoopLikeOpInterface"> {
/// Return the single step value or attribute if it exists, otherwise
/// return std::nullopt.
::std::optional<::mlir::OpFoldResult> getSingleStep() {
- auto steps = this->getLoopSteps();
+ auto steps = $_op.getLoopSteps();
if (steps.has_value() && (*steps).size() == 1)
return (*steps)[0];
return std::nullopt;
@@ -270,7 +270,7 @@ def LoopLikeOpInterface : OpInterface<"LoopLikeOpInterface"> {
/// Return the single upper bound value or attribute if it exists, otherwise
/// return std::nullopt.
::std::optional<::mlir::OpFoldResult> getSingleUpperBound() {
- auto upperBounds = this->getLoopUpperBounds();
+ auto upperBounds = $_op.getLoopUpperBounds();
if (upperBounds.has_value() && (*upperBounds).size() == 1)
return (*upperBounds)[0];
return std::nullopt;
More information about the Mlir-commits
mailing list