[mlir] use getNumDimAndSymbolVars when iterate dims/symbols of FlatAffineValueConstraints
authorXiang <python3kgae@outlook.com>
Sun, 29 Jan 2023 23:12:47 +0000 (18:12 -0500)
committerXiang <python3kgae@outlook.com>
Mon, 30 Jan 2023 14:07:49 +0000 (09:07 -0500)
commit7b182d788e7ba94da1cc620050a65c276de86607
tree92e207477899589072087d2757b50a632a47d102
parent56656f8378c842ef83af2ec7606e185d6fdefaf1
[mlir] use getNumDimAndSymbolVars when iterate dims/symbols of FlatAffineValueConstraints

Fixes #59443  https://github.com/llvm/llvm-project/issues/59443

getNumVars will add locals and cause out of bound access.

Differential Revision: https://reviews.llvm.org/D142851
mlir/lib/Dialect/Affine/Analysis/Utils.cpp
mlir/test/Dialect/SCF/for-loop-canonicalization.mlir