mirror of
https://github.com/llvm/llvm-project.git
synced 2025-04-25 08:46:06 +00:00

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.