[all-commits] [llvm/llvm-project] b91324: [LoopInterchange] Prevent the transformation stage...
Ryotaro Kasuga via All-commits
all-commits at lists.llvm.org
Tue Aug 4 05:30:22 PDT 2026
Branch: refs/heads/release/23.x
Home: https://github.com/llvm/llvm-project
Commit: b913248f32a99d16cc7542b54a804bd0b9eb33e1
https://github.com/llvm/llvm-project/commit/b913248f32a99d16cc7542b54a804bd0b9eb33e1
Author: Ryotaro Kasuga <kasuga.ryotaro at fujitsu.com>
Date: 2026-08-04 (Tue, 04 Aug 2026)
Changed paths:
M llvm/lib/Transforms/Scalar/LoopInterchange.cpp
M llvm/test/Transforms/LoopInterchange/guarded-inner-loop.ll
M llvm/test/Transforms/LoopInterchange/interchanged-loop-nest-3.ll
M llvm/test/Transforms/LoopInterchange/lcssa-incoming-value-is-not-instr.ll
M llvm/test/Transforms/LoopInterchange/pr43326-ideal-access-pattern.ll
M llvm/test/Transforms/LoopInterchange/pr57148.ll
M llvm/test/Transforms/LoopInterchange/reduction-extra-use-in-inner-loop.ll
M llvm/test/Transforms/LoopInterchange/reduction-not-involve-innermost.ll
M llvm/test/Transforms/LoopInterchange/transform-stop-partway.ll
Log Message:
-----------
[LoopInterchange] Prevent the transformation stage from stopping partway (#205564)
As mentioned in #205562, there are cases where the transformation stage
in LoopInterchange stops partway through, and the output IR ends up
partially modified rather than interchanged. Notably, the interchange is
recognized as having succeeded internally even in such cases. Apparently
this happens not to cause any miscompiles at the moment, but it is
clearly dangerous.
This patch removes the early exit in the transformation phase. We cannot
simply remove it, which checks for the presence of a unique successor of
the inner loop header, because there is a case where the header actually
has multiple successors. To avoid that situation, this patch changes the
code to call SplitBlock on the inner loop header unconditionally.
The test changes fall into two categories: some are simply due to newly
added redundant BBs. In the others, the expected interchanges are now
applied as intended, whereas previously the transformation failed and
the interchanges were not applied before this patch.
(cherry picked from commit ca52c1b3abbadf829598872b7dded2bca2fd50c0)
To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications
More information about the All-commits
mailing list