source: icGREP/icgrep-devel/llvm-3.8.0.src/test/Analysis/ScalarEvolution/infer-via-ranges.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: 755 bytes
Line 
1; RUN: opt -indvars -S < %s | FileCheck %s
2
3define void @infer_via_ranges(i32 *%arr, i32 %n) {
4; CHECK-LABEL: @infer_via_ranges
5 entry:
6  %first.itr.check = icmp sgt i32 %n, 0
7  %start = sub i32 %n, 1
8  br i1 %first.itr.check, label %loop, label %exit
9
10 loop:
11; CHECK-LABEL: loop:
12  %idx = phi i32 [ %start, %entry ] , [ %idx.dec, %in.bounds ]
13  %idx.dec = sub i32 %idx, 1
14  %abc = icmp sge i32 %idx, 0
15; CHECK: br i1 true, label %in.bounds, label %out.of.bounds
16  br i1 %abc, label %in.bounds, label %out.of.bounds
17
18 in.bounds:
19; CHECK-LABEL: in.bounds:
20  %addr = getelementptr i32, i32* %arr, i32 %idx
21  store i32 0, i32* %addr
22  %next = icmp sgt i32 %idx.dec, -1
23  br i1 %next, label %loop, label %exit
24
25 out.of.bounds:
26  ret void
27
28 exit:
29  ret void
30}
Note: See TracBrowser for help on using the repository browser.