• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1; RUN: opt -S -indvars -loop-unswitch -enable-new-pm=0 < %s | FileCheck %s
2; RUN: opt -S -indvars -loop-unswitch -enable-new-pm=0 -enable-mssa-loop-dependency=true -verify-memoryssa < %s | FileCheck %s
3
4target triple = "x86_64-unknown-linux-gnu"
5
6define void @test_01() {
7
8; Make sure we don't fail by SCEV's assertion due to incorrect invalidation.
9; CHECK-LABEL: @test_01
10
11entry:
12  br label %loop
13
14loop:                           ; preds = %backedge, %entry
15  %p_50.addr.0 = phi i16 [ undef, %entry ], [ %add2699, %backedge ]
16  %idxprom2690 = sext i16 %p_50.addr.0 to i32
17  %arrayidx2691 = getelementptr inbounds [5 x i32], [5 x i32]* undef, i32 0, i32 %idxprom2690
18  %0 = load i32, i32* %arrayidx2691, align 1
19  %tobool2692 = icmp ne i32 %0, 0
20  br label %inner_loop
21
22inner_loop:                                     ; preds = %inner_backedge, %loop
23  br i1 %tobool2692, label %backedge, label %inner_backedge
24
25inner_backedge:                                       ; preds = %inner_loop
26  br label %inner_loop
27
28backedge:                                      ; preds = %inner_loop
29  %add2699 = add nsw i16 %p_50.addr.0, 1
30  br i1 false, label %loop, label %exit
31
32exit:               ; preds = %backedge
33  unreachable
34}
35