[LoopFuse] Drop loop dispositions before reassigning blocks to other loop

This bug was found by recent improvement in SCEV verifier. The code in LoopFuse
directly reassigns blocks to be a part of a different loop, which should automatically
invalidate all related cached loop dispositions.

Differential Revision: https://reviews.llvm.org/D134173
Reviewed By: nikic
This commit is contained in:
Max Kazantsev 2022-09-19 17:39:13 +07:00
parent bb68b2402d
commit 21a9abc1ce
4 changed files with 2 additions and 9 deletions

View File

@ -1696,6 +1696,7 @@ private:
// mergeLatch may remove the only block in FC1.
SE.forgetLoop(FC1.L);
SE.forgetLoop(FC0.L);
SE.forgetLoopDispositions();
// Move instructions from FC0.Latch to FC1.Latch.
// Note: mergeLatch requires an updated DT.
@ -1988,6 +1989,7 @@ private:
// mergeLatch may remove the only block in FC1.
SE.forgetLoop(FC1.L);
SE.forgetLoop(FC0.L);
SE.forgetLoopDispositions();
// Move instructions from FC0.Latch to FC1.Latch.
// Note: mergeLatch requires an updated DT.

View File

@ -1,7 +1,4 @@
; RUN: opt -S -loop-fusion < %s 2>&1 | FileCheck %s
; XFAIL: *
; REQUIRES: asserts
; Fails due to incorrect cached loop disposition.
; Verify that LoopFusion can fuse two double-loop nests with guarded inner
; loops. Loops are in canonical form.

View File

@ -1,7 +1,4 @@
; RUN: opt -S -loop-fusion < %s | FileCheck %s
; XFAIL: *
; REQUIRES: asserts
; Fails due to incorrect cached loop disposition.
;
; int A[1024][1024];
; int B[1024][1024];

View File

@ -1,7 +1,4 @@
; RUN: opt -S -loop-fusion < %s 2>&1 | FileCheck %s
; XFAIL: *
; REQUIRES: asserts
; Fails due to incorrect cached loop disposition.
; Verify that LoopFusion can fuse two triple-loop nests with guarded inner
; loops. Loops are in canonical form.