source: icGREP/icgrep-devel/llvm-3.8.0.src/test/Analysis/ScalarEvolution/trip-count-switch.ll @ 5027

Last change on this file since 5027 was 5027, checked in by cameron, 3 years ago

Upgrade to llvm 3.8

File size: 817 bytes
Line 
1; RUN: opt < %s -analyze -scalar-evolution | FileCheck %s
2
3declare void @foo()
4
5define void @test1() nounwind {
6entry:
7  br label %for.cond
8
9for.cond:                                         ; preds = %if.end, %entry
10  %i.0 = phi i32 [ 2, %entry ], [ %dec, %if.end ]
11  switch i32 %i.0, label %if.end [
12    i32 0, label %for.end
13    i32 1, label %if.then
14  ]
15
16if.then:                                          ; preds = %for.cond
17  tail call void @foo()
18  br label %if.end
19
20if.end:                                           ; preds = %for.cond, %if.then
21  %dec = add nsw i32 %i.0, -1
22  br label %for.cond
23
24for.end:                                          ; preds = %for.cond
25  ret void
26
27; CHECK-LABEL: @test1
28; CHECK: Loop %for.cond: backedge-taken count is 2
29; CHECK: Loop %for.cond: max backedge-taken count is 2
30}
Note: See TracBrowser for help on using the repository browser.