brintos

brintos / llvm-project-archived public Read only

0
0
Text · 834 B · fe2402b Raw
35 lines · plain
1; RUN: opt < %s -S -passes='loop(indvars),loop-unroll' | FileCheck %s2;3; PR15570: SEGV: SCEV back-edge info invalid after dead code removal.4;5; Indvars creates a SCEV expression for the loop's back edge taken6; count, then determines that the comparison is always true and7; removes it.8;9; When loop-unroll asks for the expression, it contains a NULL10; SCEVUnknkown (as a CallbackVH).11;12; forgetMemoizedResults should invalidate the backedge taken count expression.13 14; CHECK: @test15; CHECK-NOT: phi16; CHECK-NOT: icmp17; CHECK: ret void18define void @test(i1 %arg) {19entry:20  %xor1 = xor i32 0, 121  br label %b1722 23b17:24  br i1 %arg, label %b22, label %b1825 26b18:27  %phi1 = phi i32 [ %add1, %b18 ], [ %xor1, %b17 ]28  %add1 = add nsw i32 %phi1, -129  %cmp1 = icmp sgt i32 %add1, 030  br i1 %cmp1, label %b18, label %b2231 32b22:33  ret void34}35