llvm-project
llvm-project copied to clipboard
[LSR] crashed on "asserting value handle still pointed to this value!"
https://godbolt.org/z/MWWcGdxT5 LSR crashed when deleting dead PHIs
I will give a resolution to fix it later.
#84777 For this case, I think we should not set the value with nullptr when the value's uses are not empty.
Reduced:
define i64 @test() {
bb:
br label %bb1
bb1:
%phi = phi i8 [ %zext6, %bb5 ], [ 0, %bb ]
br label %bb2
bb2:
%phi3 = phi i8 [ %add, %bb2 ], [ %phi, %bb1 ]
%phi4 = phi i32 [ 0, %bb2 ], [ 1, %bb1 ]
%add = add i8 %phi3, 1
br i1 true, label %bb5, label %bb2
bb5:
%zext = zext i8 %add to i32
%icmp = icmp sge i32 %phi4, 0
%zext6 = zext i1 %icmp to i8
br label %bb1
}