Evan Cheng | ef42bea | 2011-04-11 21:09:18 +0000 | [diff] [blame] | 1 | ; RUN: llc < %s -mtriple=thumbv7-apple-darwin -mcpu=cortex-a8 | FileCheck %s |
| 2 | |
| 3 | ; Overly aggressive LICM simply adds copies of constants |
| 4 | ; rdar://9266679 |
| 5 | |
| 6 | define zeroext i1 @t(i32* nocapture %A, i32 %size, i32 %value) nounwind readonly ssp { |
Stephen Lin | d24ab20 | 2013-07-14 06:24:09 +0000 | [diff] [blame] | 7 | ; CHECK-LABEL: t: |
Evan Cheng | ef42bea | 2011-04-11 21:09:18 +0000 | [diff] [blame] | 8 | entry: |
| 9 | br label %for.cond |
| 10 | |
| 11 | for.cond: |
| 12 | %0 = phi i32 [ 0, %entry ], [ %inc, %for.inc ] |
| 13 | %cmp = icmp ult i32 %0, %size |
| 14 | br i1 %cmp, label %for.body, label %return |
| 15 | |
| 16 | for.body: |
Jakob Stoklund Olesen | 51b35f7 | 2011-05-03 22:31:21 +0000 | [diff] [blame] | 17 | ; CHECK: %for. |
Will Dietz | 5cb7f4e | 2013-10-14 16:57:17 +0000 | [diff] [blame] | 18 | ; CHECK: mov{{.*}} r{{[0-9]+}}, #{{[01]}} |
| 19 | ; CHECK: mov{{.*}} r{{[0-9]+}}, #{{[01]}} |
| 20 | ; CHECK-NOT: mov r{{[0-9]+}}, #{{[01]}} |
David Blaikie | 79e6c74 | 2015-02-27 19:29:02 +0000 | [diff] [blame] | 21 | %arrayidx = getelementptr i32, i32* %A, i32 %0 |
David Blaikie | a79ac14 | 2015-02-27 21:17:42 +0000 | [diff] [blame] | 22 | %tmp4 = load i32, i32* %arrayidx, align 4 |
Evan Cheng | ef42bea | 2011-04-11 21:09:18 +0000 | [diff] [blame] | 23 | %cmp6 = icmp eq i32 %tmp4, %value |
| 24 | br i1 %cmp6, label %return, label %for.inc |
| 25 | |
Evan Cheng | ef42bea | 2011-04-11 21:09:18 +0000 | [diff] [blame] | 26 | for.inc: |
| 27 | %inc = add i32 %0, 1 |
| 28 | br label %for.cond |
| 29 | |
| 30 | return: |
| 31 | %retval.0 = phi i1 [ true, %for.body ], [ false, %for.cond ] |
| 32 | ret i1 %retval.0 |
| 33 | } |