Krzysztof Parzyszek | 71490fa | 2013-02-11 21:37:55 +0000 | [diff] [blame] | 1 | ; RUN: llc -march=hexagon -mcpu=hexagonv4 -O2 < %s | FileCheck %s |
| 2 | ; ModuleID = 'hwloop-const.c' |
| 3 | target datalayout = "e-p:32:32:32-i64:64:64-i32:32:32-i16:16:16-i1:32:32-f64:64:64-f32:32:32-v64:64:64-v32:32:32-a0:0-n16:32" |
| 4 | target triple = "hexagon-unknown-linux-gnu" |
| 5 | |
| 6 | @b = common global [25000 x i32] zeroinitializer, align 8 |
| 7 | @a = common global [25000 x i32] zeroinitializer, align 8 |
| 8 | @c = common global [25000 x i32] zeroinitializer, align 8 |
| 9 | |
| 10 | define i32 @hwloop_bug() nounwind { |
| 11 | entry: |
| 12 | br label %for.body |
| 13 | |
| 14 | ; CHECK: endloop |
| 15 | for.body: ; preds = %for.body, %entry |
| 16 | %i.02 = phi i32 [ 0, %entry ], [ %inc, %for.body ] |
| 17 | %arrayidx = getelementptr inbounds [25000 x i32]* @b, i32 0, i32 %i.02 |
Manman Ren | 2dc50d3 | 2013-04-30 17:52:57 +0000 | [diff] [blame^] | 18 | store i32 %i.02, i32* %arrayidx, align 4 |
Krzysztof Parzyszek | 71490fa | 2013-02-11 21:37:55 +0000 | [diff] [blame] | 19 | %arrayidx1 = getelementptr inbounds [25000 x i32]* @a, i32 0, i32 %i.02 |
Manman Ren | 2dc50d3 | 2013-04-30 17:52:57 +0000 | [diff] [blame^] | 20 | store i32 %i.02, i32* %arrayidx1, align 4 |
Krzysztof Parzyszek | 71490fa | 2013-02-11 21:37:55 +0000 | [diff] [blame] | 21 | %inc = add nsw i32 %i.02, 1 |
| 22 | %exitcond = icmp eq i32 %inc, 25000 |
| 23 | br i1 %exitcond, label %for.end, label %for.body |
| 24 | |
| 25 | for.end: ; preds = %for.body |
| 26 | ret i32 0 |
| 27 | } |