[mlir][Affine][NFC] Return BlockArgument in AffineForOp::getInductionVar
authorDiego Caballero <diego.caballero@intel.com>
Fri, 5 Mar 2021 21:43:56 +0000 (23:43 +0200)
committerDiego Caballero <diego.caballero@intel.com>
Fri, 5 Mar 2021 22:02:19 +0000 (00:02 +0200)
This avoids unnecessary casts when a BlockArgument is required.

Reviewed By: bondhugula

Differential Revision: https://reviews.llvm.org/D97879

mlir/include/mlir/Dialect/Affine/IR/AffineOps.td

index c32b235..734075b 100644 (file)
@@ -233,7 +233,7 @@ def AffineForOp : Affine_Op<"for",
     static StringRef getLowerBoundAttrName() { return "lower_bound"; }
     static StringRef getUpperBoundAttrName() { return "upper_bound"; }
 
-    Value getInductionVar() { return getBody()->getArgument(0); }
+    BlockArgument getInductionVar() { return getBody()->getArgument(0); }
     Block::BlockArgListType getRegionIterArgs() {
       return getBody()->getArguments().drop_front();
     }