Skip to content
Commit 22c91df5 authored by Congzhe Cao's avatar Congzhe Cao Committed by CongzheUalberta
Browse files

[LoopInterchange][PR57148] Ensure the correct form of IR after transformation

This is a bugfix patch that resolves the following two bugs in loop interchange:

1. PR57148 which is an assertion error due to of loss of LCSSA form after interchange,
   as referred to test1() in pr57148.ll.
2. Use before def for the outermost loop induction variables after interchange,
   as referred to test2() in pr57148.ll.

The fix in this patch is that:

1. In cases where the LCSSA form is not maintained after interchange, we update the IR
   to the LCSSA form again.
2. We split the phi nodes in the inner loop header into a separate basic block to avoid
   the situation where use of the outer indvar appears before its def after interchange.
   Previously we already did this for innermost loops, now we do it for non-innermost
   loops (e.g., middle loops) as well.

Reviewed By: bmahjour, Meinersbur, #loopoptwg

Differential Revision: https://reviews.llvm.org/D132055
parent 8a2729fe
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment