llvm.org GIT mirror llvm / 8688ce4
[ARM] Set Defs = [CPSR] for COPY_STRUCT_BYVAL, as it clobbers CPSR. Fixes PR35023. Reviewers: MatzeB, t.p.northover, sunfish, qcolombet, efriedma Reviewed By: efriedma Differential Revision: https://reviews.llvm.org/D55909 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@349935 91177308-0d34-0410-b5e6-96231b3b80d8 Florian Hahn 1 year, 9 months ago
2 changed file(s) with 62 addition(s) and 1 deletion(s). Raw diff Collapse all Expand all
49074907 def ABS : ARMPseudoInst<(outs GPR:$dst), (ins GPR:$src), 8, NoItinerary, []>;
49084908 }
49094909
4910 let usesCustomInserter = 1 in {
4910 let usesCustomInserter = 1, Defs = [CPSR] in {
49114911 def COPY_STRUCT_BYVAL_I32 : PseudoInst<
49124912 (outs), (ins GPR:$dst, GPR:$src, i32imm:$size, i32imm:$alignment),
49134913 NoItinerary,
0 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
1 ; RUN: llc -mtriple=armv7-unknown-linux < %s -stop-before=expand-isel-pseudos | FileCheck --check-prefix=BEFORE-EXPAND %s
2 ; RUN: llc -mtriple=armv7-unknown-linux < %s | FileCheck --check-prefix=ASSEMBLY %s
3
4 ; Check COPY_STRUCT_BYVAL_I32 has CPSR as operand.
5 ; BEFORE-EXPAND: COPY_STRUCT_BYVAL_I32 {{.*}} implicit-def dead $cpsr
6 ; BEFORE-EXPAND: COPY_STRUCT_BYVAL_I32 {{.*}} implicit-def dead $cpsr
7
8 %struct.anon = type { i32, i32, i32, i32, i32, i32, i32, %struct.f, i32, i64, i32 }
9 %struct.f = type { i32, i32, i32, i32, i32 }
10
11 define arm_aapcscc void @s(i64* %q, %struct.anon* %p) {
12 ; ASSEMBLY-LABEL: s:
13 ; ASSEMBLY: @ %bb.0: @ %entry
14 ; ASSEMBLY-NEXT: push {r4, r5, r11, lr}
15 ; ASSEMBLY-NEXT: sub sp, sp, #136
16 ; ASSEMBLY-NEXT: ldrd r4, r5, [r0]
17 ; ASSEMBLY-NEXT: add lr, sp, #56
18 ; ASSEMBLY-NEXT: ldm r1, {r0, r12}
19 ; ASSEMBLY-NEXT: subs r4, r4, #1
20 ; ASSEMBLY-NEXT: sbc r5, r5, #0
21 ; ASSEMBLY-NEXT: ldr r2, [r1, #8]
22 ; ASSEMBLY-NEXT: ldr r3, [r1, #12]
23 ; ASSEMBLY-NEXT: str r5, [sp, #132]
24 ; ASSEMBLY-NEXT: add r5, r1, #16
25 ; ASSEMBLY-NEXT: str r4, [sp, #128]
26 ; ASSEMBLY-NEXT: mov r4, sp
27 ; ASSEMBLY-NEXT: vld1.32 {d16}, [r5]!
28 ; ASSEMBLY-NEXT: vst1.32 {d16}, [r4]!
29 ; ASSEMBLY-NEXT: vld1.32 {d16}, [r5]!
30 ; ASSEMBLY-NEXT: vst1.32 {d16}, [r4]!
31 ; ASSEMBLY-NEXT: vld1.32 {d16}, [r5]!
32 ; ASSEMBLY-NEXT: vst1.32 {d16}, [r4]!
33 ; ASSEMBLY-NEXT: vld1.32 {d16}, [r5]!
34 ; ASSEMBLY-NEXT: vst1.32 {d16}, [r4]!
35 ; ASSEMBLY-NEXT: vld1.32 {d16}, [r5]!
36 ; ASSEMBLY-NEXT: vst1.32 {d16}, [r4]!
37 ; ASSEMBLY-NEXT: vld1.32 {d16}, [r5]!
38 ; ASSEMBLY-NEXT: vst1.32 {d16}, [r4]!
39 ; ASSEMBLY-NEXT: vld1.32 {d16}, [r5]!
40 ; ASSEMBLY-NEXT: vst1.32 {d16}, [r4]!
41 ; ASSEMBLY-NEXT: movw r4, #72
42 ; ASSEMBLY-NEXT: .LBB0_1: @ %entry
43 ; ASSEMBLY-NEXT: @ =>This Inner Loop Header: Depth=1
44 ; ASSEMBLY-NEXT: vld1.32 {d16}, [r1]!
45 ; ASSEMBLY-NEXT: subs r4, r4, #8
46 ; ASSEMBLY-NEXT: vst1.32 {d16}, [lr]!
47 ; ASSEMBLY-NEXT: bne .LBB0_1
48 ; ASSEMBLY-NEXT: @ %bb.2: @ %entry
49 ; ASSEMBLY-NEXT: mov r1, r12
50 ; ASSEMBLY-NEXT: bl r
51 ; ASSEMBLY-NEXT: add sp, sp, #136
52 ; ASSEMBLY-NEXT: pop {r4, r5, r11, pc}
53 entry:
54 %0 = load i64, i64* %q, align 8
55 %sub = add nsw i64 %0, -1
56 tail call arm_aapcscc void bitcast (void (...)* @r to void (%struct.anon*, %struct.anon*, i64)*)(%struct.anon* byval nonnull align 8 %p, %struct.anon* byval nonnull align 8 %p, i64 %sub)
57 ret void
58 }
59
60 declare arm_aapcscc void @r(...)