It's common to delete some instructions after using SCEVExpander, while it is still live (but will not be used afterwards). In that case, the AssertingVH may trigger. Replace it with a PoisoningVH so that we only detect the case where the SCEVExpander actually is used in a problematic fashion after the instruction removal. The alternative would be to add clear() calls to more code paths. Fixes https://github.com/llvm/llvm-project/issues/83404.
24 lines
686 B
LLVM
24 lines
686 B
LLVM
; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --version 4
|
|
; RUN: opt -S -passes=loop-reduce -mtriple=x86_64-unknown-linux-gnu < %s | FileCheck %s
|
|
|
|
; Make sure this does not assert.
|
|
define void @test() {
|
|
; CHECK-LABEL: define void @test() {
|
|
; CHECK-NEXT: entry:
|
|
; CHECK-NEXT: br label [[FOR_BODY:%.*]]
|
|
; CHECK: for.body:
|
|
; CHECK-NEXT: br label [[FOR_BODY]]
|
|
;
|
|
entry:
|
|
br label %for.body
|
|
|
|
for.body:
|
|
%0 = phi i64 [ %dec, %for.body ], [ 0, %entry ]
|
|
%h.18 = phi i32 [ 1, %for.body ], [ 0, %entry ]
|
|
%dec = add i64 %0, 1
|
|
%rem = urem i64 %0, 5
|
|
%1 = trunc i64 %rem to i32
|
|
%tobool3.not = icmp eq i32 %h.18, %1
|
|
br label %for.body
|
|
}
|