[Mlir-commits] [mlir] 3d51b40 - Fix induction variable type in scf.for py binding.

Alex Zinenko llvmlistbot at llvm.org
Thu Sep 21 01:07:33 PDT 2023


Author: Jevin Jiang
Date: 2023-09-21T08:07:26Z
New Revision: 3d51b40c4a4855a36a503d269c6c484404652949

URL: https://github.com/llvm/llvm-project/commit/3d51b40c4a4855a36a503d269c6c484404652949
DIFF: https://github.com/llvm/llvm-project/commit/3d51b40c4a4855a36a503d269c6c484404652949.diff

LOG: Fix induction variable type in scf.for py binding.

- make sure that the type of induction variable should be determined by the type of the lower bound type.

Reviewed By: ftynse

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

Added: 
    

Modified: 
    mlir/python/mlir/dialects/_scf_ops_ext.py

Removed: 
    


################################################################################
diff  --git a/mlir/python/mlir/dialects/_scf_ops_ext.py b/mlir/python/mlir/dialects/_scf_ops_ext.py
index 4b2519ef35357d6..4b0a31327abb0ee 100644
--- a/mlir/python/mlir/dialects/_scf_ops_ext.py
+++ b/mlir/python/mlir/dialects/_scf_ops_ext.py
@@ -52,7 +52,7 @@ def __init__(
                 ip=ip,
             )
         )
-        self.regions[0].blocks.append(IndexType.get(), *results)
+        self.regions[0].blocks.append(self.operands[0].type, *results)
 
     @property
     def body(self):


        


More information about the Mlir-commits mailing list