blob: 92bdd19a7b3d7608fca36d9f0dffdd274c74e936 [file] [log] [blame]
Bill Wendling2c8685e2012-08-15 21:10:18 +00001; RUN: llc < %s -mtriple=thumbv7-apple-darwin10 -relocation-model=pic -disable-fp-elim -mcpu=cortex-a8 | FileCheck %s
Evan Cheng42401d62011-03-15 18:41:52 +00002
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
Tim Northoverce6538c2014-05-30 08:59:55 +000011define void @main(i8 %val8) nounwind {
Stephen Lind24ab202013-07-14 06:24:09 +000012; CHECK-LABEL: main:
Evan Cheng42401d62011-03-15 18:41:52 +000013; CHECK-NOT: ldrd
14; CHECK: mul
15for.body.lr.ph:
16 br label %for.body
17
18for.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 ]
David Blaikie79e6c742015-02-27 19:29:02 +000021 %x = getelementptr %struct.Outer, %struct.Outer* @oStruct, i32 0, i32 1, i32 %i.022, i32 0
22 %y = getelementptr %struct.Outer, %struct.Outer* @oStruct, i32 0, i32 1, i32 %i.022, i32 1
Evan Cheng42401d62011-03-15 18:41:52 +000023 %inc = add i32 %i.022, 1
David Blaikiea79ac142015-02-27 21:17:42 +000024 %tmp8 = load i32, i32* %x, align 4
25 %tmp11 = load i32, i32* %y, align 4
Evan Cheng42401d62011-03-15 18:41:52 +000026 %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
30if.then.i16: ; preds = %_Z14printIsNotZeroi.exit
Tim Northoverce6538c2014-05-30 08:59:55 +000031 ret void
Evan Cheng42401d62011-03-15 18:41:52 +000032
33_Z14printIsNotZeroi.exit17: ; preds = %_Z14printIsNotZeroi.exit
Bill Wendling2c8685e2012-08-15 21:10:18 +000034 br label %_Z14printIsNotZeroi.exit17.for.body_crit_edge
Evan Cheng42401d62011-03-15 18:41:52 +000035
36_Z14printIsNotZeroi.exit17.for.body_crit_edge: ; preds = %_Z14printIsNotZeroi.exit17
David Blaikie79e6c742015-02-27 19:29:02 +000037 %b.phi.trans.insert = getelementptr %struct.Outer, %struct.Outer* @oStruct, i32 0, i32 1, i32 %inc, i32 3
David Blaikiea79ac142015-02-27 21:17:42 +000038 %tmp3.pre = load i8, i8* %b.phi.trans.insert, align 1
Tim Northoverce6538c2014-05-30 08:59:55 +000039 %phitmp27 = icmp eq i8 %val8, 0
Evan Cheng42401d62011-03-15 18:41:52 +000040 br label %for.body
41
42for.end: ; preds = %_Z14printIsNotZeroi.exit17
43 ret void
44}