aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIvan Kulagin <ivan.i.kulagin@gmail.com>2024-06-19 11:03:42 +0300
committerGitHub <noreply@github.com>2024-06-19 09:03:42 +0100
commitc38b1fa32599cd84f60d09a0efdac62faa9c416e (patch)
tree09404a96d52f85a099b5afbe0fd422e7c4763379
parentc6ff2446a4650f23afc9faffb55020aa68cf678c (diff)
downloadllvm-c38b1fa32599cd84f60d09a0efdac62faa9c416e.zip
llvm-c38b1fa32599cd84f60d09a0efdac62faa9c416e.tar.gz
llvm-c38b1fa32599cd84f60d09a0efdac62faa9c416e.tar.bz2
[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 <i.kulagin@ispras.ru>
-rw-r--r--mlir/include/mlir/Interfaces/LoopLikeInterface.td8
1 files changed, 4 insertions, 4 deletions
diff --git a/mlir/include/mlir/Interfaces/LoopLikeInterface.td b/mlir/include/mlir/Interfaces/LoopLikeInterface.td
index b748d5e..7db624b 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;