1 ; RUN: opt < %s -S -passes='loop(indvars),loop-unroll' | FileCheck %s
3 ; PR15570: SEGV: SCEV back-edge info invalid after dead code removal.
5 ; Indvars creates a SCEV expression for the loop's back edge taken
6 ; count, then determines that the comparison is always true and
9 ; When loop-unroll asks for the expression, it contains a NULL
10 ; SCEVUnknkown (as a CallbackVH).
12 ; forgetMemoizedResults should invalidate the backedge taken count expression.
24 br i1 undef, label %b22, label %b18
27 %phi1 = phi i32 [ %add1, %b18 ], [ %xor1, %b17 ]
28 %add1 = add nsw i32 %phi1, -1
29 %cmp1 = icmp sgt i32 %add1, 0
30 br i1 %cmp1, label %b18, label %b22