; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py UTC_ARGS: --version 2
; RUN: llc < %s -mtriple=thumbv7-apple-darwin10 -relocation-model=pic -frame-pointer=all -mcpu=cortex-a8 | FileCheck %s
; Do not form Thumb2 ldrd / strd if the offset is not multiple of 4.
; rdar://9133587
%struct.Outer = type { i32, [2 x %"struct.Outer::Inner"] }
%"struct.Outer::Inner" = type { i32, i32, i8, i8 }
@oStruct = external global %struct.Outer, align 4
define void @main(i8 %val8) nounwind {
; CHECK-LABEL: main:
; CHECK: @ %bb.0: @ %for.body.lr.ph
; CHECK-NEXT: movw r0, :lower16:(L_oStruct$non_lazy_ptr-(LPC0_0+4))
; CHECK-NEXT: movt r0, :upper16:(L_oStruct$non_lazy_ptr-(LPC0_0+4))
; CHECK-NEXT: LPC0_0:
; CHECK-NEXT: add r0, pc
; CHECK-NEXT: ldr r0, [r0]
; CHECK-NEXT: adds r0, #25
; CHECK-NEXT: LBB0_1: @ %for.body
; CHECK-NEXT: @ =>This Inner Loop Header: Depth=1
; CHECK-NEXT: ldr r1, [r0, #-21]
; CHECK-NEXT: ldr r2, [r0, #-17]
; CHECK-NEXT: muls r1, r2, r1
; CHECK-NEXT: cmp r1, #0
; CHECK-NEXT: it ne
; CHECK-NEXT: bxne lr
; CHECK-NEXT: LBB0_2: @ %_Z14printIsNotZeroi.exit17.for.body_crit_edge
; CHECK-NEXT: @ in Loop: Header=BB0_1 Depth=1
; CHECK-NEXT: adds r0, #12
; CHECK-NEXT: b LBB0_1
for.body.lr.ph:
br label %for.body
for.body: ; preds = %_Z14printIsNotZeroi.exit17.for.body_crit_edge, %for.body.lr.ph
%tmp3 = phi i1 [ false, %for.body.lr.ph ], [ %phitmp27, %_Z14printIsNotZeroi.exit17.for.body_crit_edge ]
%i.022 = phi i32 [ 0, %for.body.lr.ph ], [ %inc, %_Z14printIsNotZeroi.exit17.for.body_crit_edge ]
%x = getelementptr %struct.Outer, ptr @oStruct, i32 0, i32 1, i32 %i.022, i32 0
%y = getelementptr %struct.Outer, ptr @oStruct, i32 0, i32 1, i32 %i.022, i32 1
%inc = add i32 %i.022, 1
%tmp8 = load i32, ptr %x, align 4
%tmp11 = load i32, ptr %y, align 4
%mul = mul nsw i32 %tmp11, %tmp8
%tobool.i14 = icmp eq i32 %mul, 0
br i1 %tobool.i14, label %_Z14printIsNotZeroi.exit17, label %if.then.i16
if.then.i16: ; preds = %_Z14printIsNotZeroi.exit
ret void
_Z14printIsNotZeroi.exit17: ; preds = %_Z14printIsNotZeroi.exit
br label %_Z14printIsNotZeroi.exit17.for.body_crit_edge
_Z14printIsNotZeroi.exit17.for.body_crit_edge: ; preds = %_Z14printIsNotZeroi.exit17
%b.phi.trans.insert = getelementptr %struct.Outer, ptr @oStruct, i32 0, i32 1, i32 %inc, i32 3
%tmp3.pre = load i8, ptr %b.phi.trans.insert, align 1
%phitmp27 = icmp eq i8 %val8, 0
br label %for.body
for.end: ; preds = %_Z14printIsNotZeroi.exit17
ret void
}