[LoopFlatten] Forget all block and loop dispositions after flatten
authorluxufan <luxufan@iscas.ac.cn>
Fri, 11 Nov 2022 13:21:45 +0000 (21:21 +0800)
committerluxufan <luxufan@iscas.ac.cn>
Mon, 14 Nov 2022 02:19:11 +0000 (10:19 +0800)
commit98eb9179398d1e69e1f4416b1ef3bf308171684b
treede496155faa8049fb836064d7792d4e1a274a044
parent19ae5391e35c821f8f2c0d06fe625f9947c398d8
[LoopFlatten] Forget all block and loop dispositions after flatten

Method forgetLoop only forgets expression of phi or its users. SCEV
expressions except the above mentioned may still has loop dispositions
that point to the destroyed loop, which might cause a crash.

Fixes: https://github.com/llvm/llvm-project/issues/58865

Reviewed By: nikic, fhahn

Differential Revision: https://reviews.llvm.org/D137651
llvm/lib/Transforms/Scalar/LoopFlatten.cpp
llvm/test/Transforms/LoopFlatten/pr58865.ll [new file with mode: 0644]