[all-commits] [llvm/llvm-project] 30fe87: [mlir][cfg-to-scf] Fix invalid transformation when...
Markus Böck via All-commits
all-commits at lists.llvm.org
Wed Sep 27 05:03:08 PDT 2023
Branch: refs/heads/main
Home: https://github.com/llvm/llvm-project
Commit: 30fe8762446ca91a34174ab9c5dde34bde4d4394
https://github.com/llvm/llvm-project/commit/30fe8762446ca91a34174ab9c5dde34bde4d4394
Author: Markus Böck <markus.boeck02 at gmail.com>
Date: 2023-09-27 (Wed, 27 Sep 2023)
Changed paths:
M mlir/lib/Transforms/Utils/CFGToSCF.cpp
M mlir/test/Conversion/ControlFlowToSCF/test.mlir
Log Message:
-----------
[mlir][cfg-to-scf] Fix invalid transformation when value is used in a subregion (#67544)
The current loop-reduce-form transformation incorrectly assumes that any
value that is used in a block that isn't in the set of loop blocks is a
block outside the loop. This is correct for a pure CFG but is incorrect
if operations with subregions are present. In that case, a use may be in
a subregion of an operation part of the loop and incorrectly deemed
outside the loop. This would later lead to transformations with code
that does not verify.
This PR fixes that issue by checking the transitive parent block that is
in the same region as the loop rather than the immediate parent block.
More information about the All-commits
mailing list