blob: 5e6fe78d0e0b5db0ab6cc69b5a84e9ff42199778 [file] [log] [blame]
Brendon Cahoon55bdeb72015-04-27 14:16:43 +00001; RUN: llc -march=hexagon -hexagon-loop-range=0 < %s | FileCheck %s
2
3; Test that the loop start address operand uses a constant extender
4; if the offset is out of range.
5
6; CHECK: loop0(##.LBB
7; CHECK: endloop0
8
9@g = external global i32, align 4
10
11define void @test(i32* nocapture %a, i32* nocapture readonly %b, i32 %n) #0 {
12entry:
13 %cmp6 = icmp slt i32 %n, 1
14 br i1 %cmp6, label %for.end, label %for.body.preheader
15
16for.body.preheader:
17 br label %for.body
18
19for.body:
20 %i.07 = phi i32 [ %inc, %for.body ], [ 0, %for.body.preheader ]
21 %arrayidx = getelementptr inbounds i32, i32* %b, i32 %i.07
22 %0 = load i32, i32* %arrayidx, align 4
23 %1 = load i32, i32* @g, align 4
24 %mul = mul nsw i32 %1, %0
25 %arrayidx1 = getelementptr inbounds i32, i32* %a, i32 %i.07
26 store i32 %mul, i32* %arrayidx1, align 4
27 %inc = add nuw nsw i32 %i.07, 1
28 %exitcond = icmp eq i32 %inc, %n
29 br i1 %exitcond, label %for.end.loopexit, label %for.body
30
31for.end.loopexit:
32 br label %for.end
33
34for.end:
35 ret void
36}