1 ; RUN: opt -S -indvars -loop-unswitch -enable-new-pm=0 -verify-memoryssa < %s | FileCheck %s
3 target triple = "x86_64-unknown-linux-gnu"
5 define void @test_01() {
7 ; Make sure we don't fail by SCEV's assertion due to incorrect invalidation.
8 ; CHECK-LABEL: @test_01
13 loop: ; preds = %backedge, %entry
14 %p_50.addr.0 = phi i16 [ undef, %entry ], [ %add2699, %backedge ]
15 %idxprom2690 = sext i16 %p_50.addr.0 to i32
16 %arrayidx2691 = getelementptr inbounds [5 x i32], [5 x i32]* undef, i32 0, i32 %idxprom2690
17 %0 = load i32, i32* %arrayidx2691, align 1
18 %tobool2692 = icmp ne i32 %0, 0
21 inner_loop: ; preds = %inner_backedge, %loop
22 br i1 %tobool2692, label %backedge, label %inner_backedge
24 inner_backedge: ; preds = %inner_loop
27 backedge: ; preds = %inner_loop
28 %add2699 = add nsw i16 %p_50.addr.0, 1
29 br i1 false, label %loop, label %exit
31 exit: ; preds = %backedge