Bill Wendling | 2c8685e | 2012-08-15 21:10:18 +0000 | [diff] [blame] | 1 | ; RUN: llc < %s -mtriple=thumbv7-apple-darwin10 -relocation-model=pic -disable-fp-elim -mcpu=cortex-a8 | FileCheck %s |
Evan Cheng | 42401d6 | 2011-03-15 18:41:52 +0000 | [diff] [blame] | 2 | |
| 3 | ; Do not form Thumb2 ldrd / strd if the offset is not multiple of 4. |
| 4 | ; rdar://9133587 |
| 5 | |
| 6 | %struct.Outer = type { i32, [2 x %"struct.Outer::Inner"] } |
| 7 | %"struct.Outer::Inner" = type { i32, i32, i8, i8 } |
| 8 | |
| 9 | @oStruct = external global %struct.Outer, align 4 |
| 10 | |
| 11 | define void @main() nounwind { |
Stephen Lin | d24ab20 | 2013-07-14 06:24:09 +0000 | [diff] [blame] | 12 | ; CHECK-LABEL: main: |
Evan Cheng | 42401d6 | 2011-03-15 18:41:52 +0000 | [diff] [blame] | 13 | ; CHECK-NOT: ldrd |
| 14 | ; CHECK: mul |
| 15 | for.body.lr.ph: |
| 16 | br label %for.body |
| 17 | |
| 18 | for.body: ; preds = %_Z14printIsNotZeroi.exit17.for.body_crit_edge, %for.body.lr.ph |
| 19 | %tmp3 = phi i1 [ false, %for.body.lr.ph ], [ %phitmp27, %_Z14printIsNotZeroi.exit17.for.body_crit_edge ] |
| 20 | %i.022 = phi i32 [ 0, %for.body.lr.ph ], [ %inc, %_Z14printIsNotZeroi.exit17.for.body_crit_edge ] |
| 21 | %x = getelementptr %struct.Outer* @oStruct, i32 0, i32 1, i32 %i.022, i32 0 |
| 22 | %y = getelementptr %struct.Outer* @oStruct, i32 0, i32 1, i32 %i.022, i32 1 |
| 23 | %inc = add i32 %i.022, 1 |
Manman Ren | a2e9a98 | 2013-08-21 22:20:53 +0000 | [diff] [blame^] | 24 | %tmp8 = load i32* %x, align 4 |
| 25 | %tmp11 = load i32* %y, align 4 |
Evan Cheng | 42401d6 | 2011-03-15 18:41:52 +0000 | [diff] [blame] | 26 | %mul = mul nsw i32 %tmp11, %tmp8 |
| 27 | %tobool.i14 = icmp eq i32 %mul, 0 |
| 28 | br i1 %tobool.i14, label %_Z14printIsNotZeroi.exit17, label %if.then.i16 |
| 29 | |
| 30 | if.then.i16: ; preds = %_Z14printIsNotZeroi.exit |
| 31 | unreachable |
| 32 | |
| 33 | _Z14printIsNotZeroi.exit17: ; preds = %_Z14printIsNotZeroi.exit |
Bill Wendling | 2c8685e | 2012-08-15 21:10:18 +0000 | [diff] [blame] | 34 | br label %_Z14printIsNotZeroi.exit17.for.body_crit_edge |
Evan Cheng | 42401d6 | 2011-03-15 18:41:52 +0000 | [diff] [blame] | 35 | |
| 36 | _Z14printIsNotZeroi.exit17.for.body_crit_edge: ; preds = %_Z14printIsNotZeroi.exit17 |
| 37 | %b.phi.trans.insert = getelementptr %struct.Outer* @oStruct, i32 0, i32 1, i32 %inc, i32 3 |
Manman Ren | a2e9a98 | 2013-08-21 22:20:53 +0000 | [diff] [blame^] | 38 | %tmp3.pre = load i8* %b.phi.trans.insert, align 1 |
Evan Cheng | 42401d6 | 2011-03-15 18:41:52 +0000 | [diff] [blame] | 39 | %phitmp27 = icmp eq i8 undef, 0 |
| 40 | br label %for.body |
| 41 | |
| 42 | for.end: ; preds = %_Z14printIsNotZeroi.exit17 |
| 43 | ret void |
| 44 | } |