• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1; RUN: opt -S -indvars -loop-unswitch < %s | FileCheck %s
2
3target triple = "x86_64-unknown-linux-gnu"
4
5define void @test_01() {
6
7; Make sure we don't fail by SCEV's assertion due to incorrect invalidation.
8; CHECK-LABEL: @test_01
9
10entry:
11  br label %loop
12
13loop:                           ; 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
19  br label %inner_loop
20
21inner_loop:                                     ; preds = %inner_backedge, %loop
22  br i1 %tobool2692, label %backedge, label %inner_backedge
23
24inner_backedge:                                       ; preds = %inner_loop
25  br label %inner_loop
26
27backedge:                                      ; preds = %inner_loop
28  %add2699 = add nsw i16 %p_50.addr.0, 1
29  br i1 false, label %loop, label %exit
30
31exit:               ; preds = %backedge
32  unreachable
33}
34