| 1 |
; NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py UTC_ARGS: --version 5 |
| 2 |
; RUN: llc -mtriple powerpc-ibm-aix-xcoff -stop-after=machine-cp -mcpu=pwr4 \ |
| 3 |
; RUN: -mattr=-altivec -verify-machineinstrs < %s | \ |
| 4 |
; RUN: FileCheck --check-prefixes=32BIT %s |
| 5 |
|
| 6 |
; RUN: llc -mtriple powerpc64-ibm-aix-xcoff -stop-after=machine-cp -mcpu=pwr4 \ |
| 7 |
; RUN: -mattr=-altivec -verify-machineinstrs < %s | \ |
| 8 |
; RUN: FileCheck --check-prefixes=64BIT %s |
| 9 |
|
| 10 |
%struct.S0 = type {} |
| 11 |
|
| 12 |
%struct.S1 = type { [1 x i8] } |
| 13 |
@gS1 = external global %struct.S1, align 1 |
| 14 |
|
| 15 |
define void @call_test_byval_1Byte() { |
| 16 |
; 32BIT-LABEL: name: call_test_byval_1Byte |
| 17 |
; 32BIT: bb.0.entry: |
| 18 |
; 32BIT-NEXT: ADJCALLSTACKDOWN 56, 0, implicit-def dead $r1, implicit $r1 |
| 19 |
; 32BIT-NEXT: renamable $r3 = LWZtoc @gS1, $r2 :: (load (s32) from got) |
| 20 |
; 32BIT-NEXT: renamable $r3 = LBZ 0, killed renamable $r3 :: (load (s8)) |
| 21 |
; 32BIT-NEXT: renamable $r3 = RLWINM killed renamable $r3, 24, 0, 7 |
| 22 |
; 32BIT-NEXT: BL_NOP <mcsymbol .test_byval_1Byte>, csr_aix32, implicit-def dead $lr, implicit $rm, implicit $r3, implicit $r2, implicit-def $r1, implicit-def dead $r3 |
| 23 |
; 32BIT-NEXT: ADJCALLSTACKUP 56, 0, implicit-def dead $r1, implicit $r1 |
| 24 |
; 32BIT-NEXT: BLR implicit $lr, implicit $rm |
| 25 |
; |
| 26 |
; 64BIT-LABEL: name: call_test_byval_1Byte |
| 27 |
; 64BIT: bb.0.entry: |
| 28 |
; 64BIT-NEXT: ADJCALLSTACKDOWN 112, 0, implicit-def dead $r1, implicit $r1 |
| 29 |
; 64BIT-NEXT: renamable $x3 = LDtoc @gS1, $x2 :: (load (s64) from got) |
| 30 |
; 64BIT-NEXT: renamable $x3 = LBZ8 0, killed renamable $x3 :: (load (s8)) |
| 31 |
; 64BIT-NEXT: renamable $x3 = RLDICR killed renamable $x3, 56, 7 |
| 32 |
; 64BIT-NEXT: BL8_NOP <mcsymbol .test_byval_1Byte>, csr_ppc64, implicit-def dead $lr8, implicit $rm, implicit $x3, implicit $x2, implicit-def $r1, implicit-def dead $x3 |
| 33 |
; 64BIT-NEXT: ADJCALLSTACKUP 112, 0, implicit-def dead $r1, implicit $r1 |
| 34 |
; 64BIT-NEXT: BLR8 implicit $lr8, implicit $rm |
| 35 |
entry: |
| 36 |
%s0 = alloca %struct.S0, align 8 |
| 37 |
%call = call zeroext i8 @test_byval_1Byte(ptr byval(%struct.S0) align 1 %s0, ptr byval(%struct.S1) align 1 @gS1) |
| 38 |
ret void |
| 39 |
} |
| 40 |
|
| 41 |
define zeroext i8 @test_byval_1Byte(ptr byval(%struct.S0) align 1 %s0, ptr byval(%struct.S1) align 1 %s) { |
| 42 |
; 32BIT-LABEL: name: test_byval_1Byte |
| 43 |
; 32BIT: bb.0.entry: |
| 44 |
; 32BIT-NEXT: liveins: $r3 |
| 45 |
; 32BIT-NEXT: {{ $}} |
| 46 |
; 32BIT-NEXT: renamable $r4 = COPY $r3 |
| 47 |
; 32BIT-NEXT: renamable $r3 = RLWINM $r3, 8, 24, 31 |
| 48 |
; 32BIT-NEXT: STW killed renamable $r4, 0, %fixed-stack.0 :: (store (s32) into %fixed-stack.0, align 8) |
| 49 |
; 32BIT-NEXT: BLR implicit $lr, implicit $rm, implicit $r3 |
| 50 |
; |
| 51 |
; 64BIT-LABEL: name: test_byval_1Byte |
| 52 |
; 64BIT: bb.0.entry: |
| 53 |
; 64BIT-NEXT: liveins: $x3 |
| 54 |
; 64BIT-NEXT: {{ $}} |
| 55 |
; 64BIT-NEXT: renamable $x4 = COPY $x3 |
| 56 |
; 64BIT-NEXT: renamable $x3 = RLDICL $x3, 8, 56 |
| 57 |
; 64BIT-NEXT: STD killed renamable $x4, 0, %fixed-stack.0 :: (store (s64) into %fixed-stack.0, align 16) |
| 58 |
; 64BIT-NEXT: BLR8 implicit $lr8, implicit $rm, implicit $x3 |
| 59 |
entry: |
| 60 |
%0 = load i8, ptr %s, align 1 |
| 61 |
ret i8 %0 |
| 62 |
} |
| 63 |
|
| 64 |
@f = common global float 0.000000e+00, align 4 |
| 65 |
|
| 66 |
%struct.S2 = type { [2 x i8] } |
| 67 |
|
| 68 |
@gS2 = external global %struct.S2, align 1 |
| 69 |
|
| 70 |
define void @call_test_byval_2Byte() { |
| 71 |
; 32BIT-LABEL: name: call_test_byval_2Byte |
| 72 |
; 32BIT: bb.0.entry: |
| 73 |
; 32BIT-NEXT: renamable $r3 = LWZtoc @f, $r2 :: (load (s32) from got) |
| 74 |
; 32BIT-NEXT: renamable $f1 = LFS 0, killed renamable $r3 :: (dereferenceable load (s32) from @f) |
| 75 |
; 32BIT-NEXT: ADJCALLSTACKDOWN 56, 0, implicit-def dead $r1, implicit $r1 |
| 76 |
; 32BIT-NEXT: renamable $r3 = LWZtoc @gS2, $r2 :: (load (s32) from got) |
| 77 |
; 32BIT-NEXT: renamable $r3 = LHZ 0, killed renamable $r3 :: (load (s16)) |
| 78 |
; 32BIT-NEXT: renamable $r5 = RLWINM killed renamable $r3, 16, 0, 15 |
| 79 |
; 32BIT-NEXT: $r3 = LI 42 |
| 80 |
; 32BIT-NEXT: $f2 = COPY renamable $f1 |
| 81 |
; 32BIT-NEXT: $r7 = LI 43 |
| 82 |
; 32BIT-NEXT: BL_NOP <mcsymbol .test_byval_2Byte>, csr_aix32, implicit-def dead $lr, implicit $rm, implicit $r3, implicit $f1, implicit $r5, implicit killed $f2, implicit killed $r7, implicit $r2, implicit-def $r1, implicit-def dead $r3 |
| 83 |
; 32BIT-NEXT: ADJCALLSTACKUP 56, 0, implicit-def dead $r1, implicit $r1 |
| 84 |
; 32BIT-NEXT: BLR implicit $lr, implicit $rm |
| 85 |
; |
| 86 |
; 64BIT-LABEL: name: call_test_byval_2Byte |
| 87 |
; 64BIT: bb.0.entry: |
| 88 |
; 64BIT-NEXT: renamable $x3 = LDtoc @f, $x2 :: (load (s64) from got) |
| 89 |
; 64BIT-NEXT: renamable $f1 = LFS 0, killed renamable $x3 :: (dereferenceable load (s32) from @f) |
| 90 |
; 64BIT-NEXT: ADJCALLSTACKDOWN 112, 0, implicit-def dead $r1, implicit $r1 |
| 91 |
; 64BIT-NEXT: renamable $x3 = LDtoc @gS2, $x2 :: (load (s64) from got) |
| 92 |
; 64BIT-NEXT: renamable $x3 = LHZ8 0, killed renamable $x3 :: (load (s16)) |
| 93 |
; 64BIT-NEXT: renamable $x5 = RLDICR killed renamable $x3, 48, 15 |
| 94 |
; 64BIT-NEXT: $x3 = LI8 42 |
| 95 |
; 64BIT-NEXT: $f2 = COPY renamable $f1 |
| 96 |
; 64BIT-NEXT: $x7 = LI8 43 |
| 97 |
; 64BIT-NEXT: BL8_NOP <mcsymbol .test_byval_2Byte>, csr_ppc64, implicit-def dead $lr8, implicit $rm, implicit $x3, implicit $f1, implicit $x5, implicit killed $f2, implicit killed $x7, implicit $x2, implicit-def $r1, implicit-def dead $x3 |
| 98 |
; 64BIT-NEXT: ADJCALLSTACKUP 112, 0, implicit-def dead $r1, implicit $r1 |
| 99 |
; 64BIT-NEXT: BLR8 implicit $lr8, implicit $rm |
| 100 |
entry: |
| 101 |
%0 = load float, ptr @f, align 4 |
| 102 |
%call = call zeroext i8 @test_byval_2Byte(i32 signext 42, float %0, ptr byval(%struct.S2) align 1 @gS2, float %0, i32 signext 43) |
| 103 |
ret void |
| 104 |
} |
| 105 |
|
| 106 |
define zeroext i8 @test_byval_2Byte(i32, float, ptr byval(%struct.S2) align 1 %s, float, i32) { |
| 107 |
; 32BIT-LABEL: name: test_byval_2Byte |
| 108 |
; 32BIT: bb.0.entry: |
| 109 |
; 32BIT-NEXT: liveins: $r5 |
| 110 |
; 32BIT-NEXT: {{ $}} |
| 111 |
; 32BIT-NEXT: STW killed renamable $r5, 0, %fixed-stack.0 :: (store (s32) into %fixed-stack.0, align 16) |
| 112 |
; 32BIT-NEXT: renamable $r3 = LBZ 1, %fixed-stack.0 :: (dereferenceable load (s8) from %ir.arrayidx) |
| 113 |
; 32BIT-NEXT: BLR implicit $lr, implicit $rm, implicit $r3 |
| 114 |
; |
| 115 |
; 64BIT-LABEL: name: test_byval_2Byte |
| 116 |
; 64BIT: bb.0.entry: |
| 117 |
; 64BIT-NEXT: liveins: $x5 |
| 118 |
; 64BIT-NEXT: {{ $}} |
| 119 |
; 64BIT-NEXT: STD killed renamable $x5, 0, %fixed-stack.0 :: (store (s64) into %fixed-stack.0, align 16) |
| 120 |
; 64BIT-NEXT: renamable $x3 = LBZ8 1, %fixed-stack.0 :: (dereferenceable load (s8) from %ir.arrayidx) |
| 121 |
; 64BIT-NEXT: BLR8 implicit $lr8, implicit $rm, implicit $x3 |
| 122 |
entry: |
| 123 |
%arrayidx = getelementptr inbounds %struct.S2, ptr %s, i32 0, i32 0, i32 1 |
| 124 |
%4 = load i8, ptr %arrayidx, align 1 |
| 125 |
ret i8 %4 |
| 126 |
} |
| 127 |
|
| 128 |
%struct.S3 = type <{ i8, i16 }> |
| 129 |
@gS3 = external global %struct.S3, align 1 |
| 130 |
|
| 131 |
define void @call_test_byval_3Byte() { |
| 132 |
; 32BIT-LABEL: name: call_test_byval_3Byte |
| 133 |
; 32BIT: bb.0.entry: |
| 134 |
; 32BIT-NEXT: ADJCALLSTACKDOWN 60, 0, implicit-def dead $r1, implicit $r1 |
| 135 |
; 32BIT-NEXT: renamable $r3 = LI 42 |
| 136 |
; 32BIT-NEXT: renamable $r4 = LWZtoc @gS3, $r2 :: (load (s32) from got) |
| 137 |
; 32BIT-NEXT: STW killed renamable $r3, 56, $r1 :: (store (s32) into stack + 56, align 8, basealign 16) |
| 138 |
; 32BIT-NEXT: renamable $r3 = LBZ 2, renamable $r4 :: (load (s8)) |
| 139 |
; 32BIT-NEXT: renamable $r4 = LHZ 0, killed renamable $r4 :: (load (s16)) |
| 140 |
; 32BIT-NEXT: renamable $r10 = RLWINM killed renamable $r3, 8, 16, 23 |
| 141 |
; 32BIT-NEXT: renamable $r10 = RLWIMI killed renamable $r10, killed renamable $r4, 16, 0, 15 |
| 142 |
; 32BIT-NEXT: $r3 = LI 1 |
| 143 |
; 32BIT-NEXT: $r4 = LI 2 |
| 144 |
; 32BIT-NEXT: $r5 = LI 3 |
| 145 |
; 32BIT-NEXT: $r6 = LI 4 |
| 146 |
; 32BIT-NEXT: $r7 = LI 5 |
| 147 |
; 32BIT-NEXT: $r8 = LI 6 |
| 148 |
; 32BIT-NEXT: $r9 = LI 7 |
| 149 |
; 32BIT-NEXT: BL_NOP <mcsymbol .test_byval_3Byte>, csr_aix32, implicit-def dead $lr, implicit $rm, implicit $r3, implicit $r4, implicit killed $r5, implicit killed $r6, implicit killed $r7, implicit killed $r8, implicit killed $r9, implicit $r10, implicit $r2, implicit-def $r1, implicit-def dead $r3 |
| 150 |
; 32BIT-NEXT: ADJCALLSTACKUP 60, 0, implicit-def dead $r1, implicit $r1 |
| 151 |
; 32BIT-NEXT: BLR implicit $lr, implicit $rm |
| 152 |
; |
| 153 |
; 64BIT-LABEL: name: call_test_byval_3Byte |
| 154 |
; 64BIT: bb.0.entry: |
| 155 |
; 64BIT-NEXT: ADJCALLSTACKDOWN 120, 0, implicit-def dead $r1, implicit $r1 |
| 156 |
; 64BIT-NEXT: renamable $x3 = LI8 42 |
| 157 |
; 64BIT-NEXT: renamable $x4 = LDtoc @gS3, $x2 :: (load (s64) from got) |
| 158 |
; 64BIT-NEXT: STD killed renamable $x3, 112, $x1 :: (store (s64) into stack + 112, align 16) |
| 159 |
; 64BIT-NEXT: renamable $x3 = LBZ8 2, renamable $x4 :: (load (s8)) |
| 160 |
; 64BIT-NEXT: renamable $x4 = LHZ8 0, killed renamable $x4 :: (load (s16)) |
| 161 |
; 64BIT-NEXT: renamable $x10 = RLDIC killed renamable $x3, 40, 16 |
| 162 |
; 64BIT-NEXT: renamable $x10 = RLDIMI killed renamable $x10, killed renamable $x4, 48, 0 |
| 163 |
; 64BIT-NEXT: $x3 = LI8 1 |
| 164 |
; 64BIT-NEXT: $x4 = LI8 2 |
| 165 |
; 64BIT-NEXT: $x5 = LI8 3 |
| 166 |
; 64BIT-NEXT: $x6 = LI8 4 |
| 167 |
; 64BIT-NEXT: $x7 = LI8 5 |
| 168 |
; 64BIT-NEXT: $x8 = LI8 6 |
| 169 |
; 64BIT-NEXT: $x9 = LI8 7 |
| 170 |
; 64BIT-NEXT: BL8_NOP <mcsymbol .test_byval_3Byte>, csr_ppc64, implicit-def dead $lr8, implicit $rm, implicit $x3, implicit $x4, implicit killed $x5, implicit killed $x6, implicit killed $x7, implicit killed $x8, implicit killed $x9, implicit $x10, implicit $x2, implicit-def $r1, implicit-def dead $x3 |
| 171 |
; 64BIT-NEXT: ADJCALLSTACKUP 120, 0, implicit-def dead $r1, implicit $r1 |
| 172 |
; 64BIT-NEXT: BLR8 implicit $lr8, implicit $rm |
| 173 |
entry: |
| 174 |
%call = call zeroext i16 @test_byval_3Byte(i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7, ptr byval(%struct.S3) align 1 @gS3, i32 42) |
| 175 |
ret void |
| 176 |
} |
| 177 |
|
| 178 |
define zeroext i16 @test_byval_3Byte(i32, i32, i32, i32, i32, i32, i32, ptr byval(%struct.S3) align 1 %s, i32) { |
| 179 |
; 32BIT-LABEL: name: test_byval_3Byte |
| 180 |
; 32BIT: bb.0.entry: |
| 181 |
; 32BIT-NEXT: liveins: $r10 |
| 182 |
; 32BIT-NEXT: {{ $}} |
| 183 |
; 32BIT-NEXT: STW killed renamable $r10, 0, %fixed-stack.1 :: (store (s32) into %fixed-stack.1) |
| 184 |
; 32BIT-NEXT: renamable $r3 = LHZ 1, %fixed-stack.1 :: (dereferenceable load (s16) from %ir.gep, align 1) |
| 185 |
; 32BIT-NEXT: BLR implicit $lr, implicit $rm, implicit $r3 |
| 186 |
; |
| 187 |
; 64BIT-LABEL: name: test_byval_3Byte |
| 188 |
; 64BIT: bb.0.entry: |
| 189 |
; 64BIT-NEXT: liveins: $x10 |
| 190 |
; 64BIT-NEXT: {{ $}} |
| 191 |
; 64BIT-NEXT: STD killed renamable $x10, 0, %fixed-stack.1 :: (store (s64) into %fixed-stack.1) |
| 192 |
; 64BIT-NEXT: renamable $x3 = LHZ8 1, %fixed-stack.1 :: (dereferenceable load (s16) from %ir.gep, align 1) |
| 193 |
; 64BIT-NEXT: BLR8 implicit $lr8, implicit $rm, implicit $x3 |
| 194 |
entry: |
| 195 |
%gep = getelementptr inbounds %struct.S3, ptr %s, i32 0, i32 1 |
| 196 |
%8 = load i16, ptr %gep, align 1 |
| 197 |
ret i16 %8 |
| 198 |
} |
| 199 |
|
| 200 |
%struct.S4 = type { [4 x i8] } |
| 201 |
%struct.S4A = type { i32 } |
| 202 |
|
| 203 |
@gS4 = external global %struct.S4, align 1 |
| 204 |
|
| 205 |
define void @call_test_byval_4Byte() { |
| 206 |
; 32BIT-LABEL: name: call_test_byval_4Byte |
| 207 |
; 32BIT: bb.0.entry: |
| 208 |
; 32BIT-NEXT: ADJCALLSTACKDOWN 56, 0, implicit-def dead $r1, implicit $r1 |
| 209 |
; 32BIT-NEXT: renamable $r3 = LWZtoc @gS4, $r2 :: (load (s32) from got) |
| 210 |
; 32BIT-NEXT: renamable $r3 = LWZ 0, killed renamable $r3 :: (load (s32)) |
| 211 |
; 32BIT-NEXT: renamable $r4 = LWZ 0, %stack.1.s4a :: (load (s32) from %stack.1.s4a, align 8) |
| 212 |
; 32BIT-NEXT: BL_NOP <mcsymbol .test_byval_4Byte>, csr_aix32, implicit-def dead $lr, implicit $rm, implicit $r3, implicit $r4, implicit $r2, implicit-def $r1, implicit-def dead $r3 |
| 213 |
; 32BIT-NEXT: ADJCALLSTACKUP 56, 0, implicit-def dead $r1, implicit $r1 |
| 214 |
; 32BIT-NEXT: BLR implicit $lr, implicit $rm |
| 215 |
; |
| 216 |
; 64BIT-LABEL: name: call_test_byval_4Byte |
| 217 |
; 64BIT: bb.0.entry: |
| 218 |
; 64BIT-NEXT: ADJCALLSTACKDOWN 112, 0, implicit-def dead $r1, implicit $r1 |
| 219 |
; 64BIT-NEXT: renamable $x3 = LDtoc @gS4, $x2 :: (load (s64) from got) |
| 220 |
; 64BIT-NEXT: renamable $x3 = LWZ8 0, killed renamable $x3 :: (load (s32)) |
| 221 |
; 64BIT-NEXT: renamable $x4 = LWZ8 0, %stack.1.s4a :: (load (s32) from %stack.1.s4a, align 8) |
| 222 |
; 64BIT-NEXT: renamable $x3 = RLDICR killed renamable $x3, 32, 31 |
| 223 |
; 64BIT-NEXT: renamable $x4 = RLDICR killed renamable $x4, 32, 31 |
| 224 |
; 64BIT-NEXT: BL8_NOP <mcsymbol .test_byval_4Byte>, csr_ppc64, implicit-def dead $lr8, implicit $rm, implicit $x3, implicit $x4, implicit $x2, implicit-def $r1, implicit-def dead $x3 |
| 225 |
; 64BIT-NEXT: ADJCALLSTACKUP 112, 0, implicit-def dead $r1, implicit $r1 |
| 226 |
; 64BIT-NEXT: BLR8 implicit $lr8, implicit $rm |
| 227 |
entry: |
| 228 |
%s0 = alloca %struct.S0, align 8 |
| 229 |
%s4a = alloca %struct.S4A, align 8 |
| 230 |
%call = call signext i32 @test_byval_4Byte(ptr byval(%struct.S4) align 1 @gS4, ptr byval(%struct.S0) align 1 %s0, ptr byval(%struct.S4A) align 4 %s4a) |
| 231 |
ret void |
| 232 |
} |
| 233 |
|
| 234 |
define signext i32 @test_byval_4Byte(ptr byval(%struct.S4) align 1 %s, ptr byval(%struct.S0) align 1, ptr byval(%struct.S4A) align 4 %s4a) { |
| 235 |
; 32BIT-LABEL: name: test_byval_4Byte |
| 236 |
; 32BIT: bb.0.entry: |
| 237 |
; 32BIT-NEXT: liveins: $r3, $r4 |
| 238 |
; 32BIT-NEXT: {{ $}} |
| 239 |
; 32BIT-NEXT: STW renamable $r3, 0, %fixed-stack.2 :: (store (s32) into %fixed-stack.2, align 8) |
| 240 |
; 32BIT-NEXT: renamable $r3 = RLWINM killed renamable $r3, 0, 24, 31 |
| 241 |
; 32BIT-NEXT: renamable $r3 = nsw ADD4 renamable $r4, killed renamable $r3 |
| 242 |
; 32BIT-NEXT: STW killed renamable $r4, 0, %fixed-stack.0 :: (store (s32) into %fixed-stack.0) |
| 243 |
; 32BIT-NEXT: BLR implicit $lr, implicit $rm, implicit $r3 |
| 244 |
; |
| 245 |
; 64BIT-LABEL: name: test_byval_4Byte |
| 246 |
; 64BIT: bb.0.entry: |
| 247 |
; 64BIT-NEXT: liveins: $x3, $x4 |
| 248 |
; 64BIT-NEXT: {{ $}} |
| 249 |
; 64BIT-NEXT: STD killed renamable $x3, 0, %fixed-stack.2 :: (store (s64) into %fixed-stack.2, align 16) |
| 250 |
; 64BIT-NEXT: STD renamable $x4, 0, %fixed-stack.0 :: (store (s64) into %fixed-stack.0) |
| 251 |
; 64BIT-NEXT: renamable $r3 = LBZ 3, %fixed-stack.2 :: (dereferenceable load (s8) from %ir.arrayidx) |
| 252 |
; 64BIT-NEXT: renamable $x4 = RLDICL killed renamable $x4, 32, 32 |
| 253 |
; 64BIT-NEXT: renamable $r3 = nsw ADD4 renamable $r4, killed renamable $r3, implicit killed $x4 |
| 254 |
; 64BIT-NEXT: renamable $x3 = EXTSW_32_64 killed renamable $r3 |
| 255 |
; 64BIT-NEXT: BLR8 implicit $lr8, implicit $rm, implicit $x3 |
| 256 |
entry: |
| 257 |
%arrayidx = getelementptr inbounds %struct.S4, ptr %s, i32 0, i32 0, i32 3 |
| 258 |
%1 = load i8, ptr %arrayidx, align 1 |
| 259 |
%2 = load i32, ptr %s4a, align 4 |
| 260 |
%conv = zext i8 %1 to i32 |
| 261 |
%add = add nsw i32 %2, %conv |
| 262 |
ret i32 %add |
| 263 |
} |
| 264 |
|
| 265 |
%struct.S5 = type { [5 x i8] } |
| 266 |
|
| 267 |
@gS5 = external global %struct.S5, align 1 |
| 268 |
|
| 269 |
define void @call_test_byval_5Byte() { |
| 270 |
; 32BIT-LABEL: name: call_test_byval_5Byte |
| 271 |
; 32BIT: bb.0.entry: |
| 272 |
; 32BIT-NEXT: ADJCALLSTACKDOWN 56, 0, implicit-def dead $r1, implicit $r1 |
| 273 |
; 32BIT-NEXT: renamable $r3 = LWZtoc @gS5, $r2 :: (load (s32) from got) |
| 274 |
; 32BIT-NEXT: renamable $r4 = LBZ 4, renamable $r3 :: (load (s8)) |
| 275 |
; 32BIT-NEXT: renamable $r3 = LWZ 0, killed renamable $r3 :: (load (s32)) |
| 276 |
; 32BIT-NEXT: renamable $r4 = RLWINM killed renamable $r4, 24, 0, 7 |
| 277 |
; 32BIT-NEXT: BL_NOP <mcsymbol .test_byval_5Byte[PR]>, csr_aix32, implicit-def dead $lr, implicit $rm, implicit $r3, implicit $r4, implicit $r2, implicit-def $r1, implicit-def dead $r3 |
| 278 |
; 32BIT-NEXT: ADJCALLSTACKUP 56, 0, implicit-def dead $r1, implicit $r1 |
| 279 |
; 32BIT-NEXT: BLR implicit $lr, implicit $rm |
| 280 |
; |
| 281 |
; 64BIT-LABEL: name: call_test_byval_5Byte |
| 282 |
; 64BIT: bb.0.entry: |
| 283 |
; 64BIT-NEXT: ADJCALLSTACKDOWN 112, 0, implicit-def dead $r1, implicit $r1 |
| 284 |
; 64BIT-NEXT: renamable $x3 = LDtoc @gS5, $x2 :: (load (s64) from got) |
| 285 |
; 64BIT-NEXT: renamable $x4 = LBZ8 4, renamable $x3 :: (load (s8)) |
| 286 |
; 64BIT-NEXT: renamable $x5 = LWZ8 0, killed renamable $x3 :: (load (s32)) |
| 287 |
; 64BIT-NEXT: renamable $x3 = RLWINM8 killed renamable $x4, 24, 0, 7 |
| 288 |
; 64BIT-NEXT: renamable $x3 = RLDIMI killed renamable $x3, killed renamable $x5, 32, 0 |
| 289 |
; 64BIT-NEXT: BL8_NOP <mcsymbol .test_byval_5Byte[PR]>, csr_ppc64, implicit-def dead $lr8, implicit $rm, implicit $x3, implicit $x2, implicit-def $r1, implicit-def dead $x3 |
| 290 |
; 64BIT-NEXT: ADJCALLSTACKUP 112, 0, implicit-def dead $r1, implicit $r1 |
| 291 |
; 64BIT-NEXT: BLR8 implicit $lr8, implicit $rm |
| 292 |
entry: |
| 293 |
%call = call zeroext i8 @test_byval_5Byte(ptr byval(%struct.S5) align 1 @gS5) |
| 294 |
ret void |
| 295 |
} |
| 296 |
|
| 297 |
declare zeroext i8 @test_byval_5Byte(ptr byval(%struct.S5) align 1) |
| 298 |
|
| 299 |
%struct.S6 = type { [6 x i8] } |
| 300 |
|
| 301 |
@gS6 = external global %struct.S6, align 1 |
| 302 |
|
| 303 |
define void @call_test_byval_6Byte() { |
| 304 |
; 32BIT-LABEL: name: call_test_byval_6Byte |
| 305 |
; 32BIT: bb.0.entry: |
| 306 |
; 32BIT-NEXT: ADJCALLSTACKDOWN 56, 0, implicit-def dead $r1, implicit $r1 |
| 307 |
; 32BIT-NEXT: renamable $r3 = LWZtoc @gS6, $r2 :: (load (s32) from got) |
| 308 |
; 32BIT-NEXT: renamable $r4 = LHZ 4, renamable $r3 :: (load (s16)) |
| 309 |
; 32BIT-NEXT: renamable $r3 = LWZ 0, killed renamable $r3 :: (load (s32)) |
| 310 |
; 32BIT-NEXT: renamable $r4 = RLWINM killed renamable $r4, 16, 0, 15 |
| 311 |
; 32BIT-NEXT: BL_NOP <mcsymbol .test_byval_6Byte[PR]>, csr_aix32, implicit-def dead $lr, implicit $rm, implicit $r3, implicit $r4, implicit $r2, implicit-def $r1, implicit-def dead $r3 |
| 312 |
; 32BIT-NEXT: ADJCALLSTACKUP 56, 0, implicit-def dead $r1, implicit $r1 |
| 313 |
; 32BIT-NEXT: BLR implicit $lr, implicit $rm |
| 314 |
; |
| 315 |
; 64BIT-LABEL: name: call_test_byval_6Byte |
| 316 |
; 64BIT: bb.0.entry: |
| 317 |
; 64BIT-NEXT: ADJCALLSTACKDOWN 112, 0, implicit-def dead $r1, implicit $r1 |
| 318 |
; 64BIT-NEXT: renamable $x3 = LDtoc @gS6, $x2 :: (load (s64) from got) |
| 319 |
; 64BIT-NEXT: renamable $x4 = LHZ8 4, renamable $x3 :: (load (s16)) |
| 320 |
; 64BIT-NEXT: renamable $x5 = LWZ8 0, killed renamable $x3 :: (load (s32)) |
| 321 |
; 64BIT-NEXT: renamable $x3 = RLWINM8 killed renamable $x4, 16, 0, 15 |
| 322 |
; 64BIT-NEXT: renamable $x3 = RLDIMI killed renamable $x3, killed renamable $x5, 32, 0 |
| 323 |
; 64BIT-NEXT: BL8_NOP <mcsymbol .test_byval_6Byte[PR]>, csr_ppc64, implicit-def dead $lr8, implicit $rm, implicit $x3, implicit $x2, implicit-def $r1, implicit-def dead $x3 |
| 324 |
; 64BIT-NEXT: ADJCALLSTACKUP 112, 0, implicit-def dead $r1, implicit $r1 |
| 325 |
; 64BIT-NEXT: BLR8 implicit $lr8, implicit $rm |
| 326 |
entry: |
| 327 |
%call = call zeroext i8 @test_byval_6Byte(ptr byval(%struct.S6) align 1 @gS6) |
| 328 |
ret void |
| 329 |
} |
| 330 |
|
| 331 |
declare zeroext i8 @test_byval_6Byte(ptr byval(%struct.S6) align 1) |
| 332 |
|
| 333 |
%struct.S7 = type { [7 x i8] } |
| 334 |
|
| 335 |
@gS7 = external global %struct.S7, align 1 |
| 336 |
|
| 337 |
define void @call_test_byval_7Byte() { |
| 338 |
; 32BIT-LABEL: name: call_test_byval_7Byte |
| 339 |
; 32BIT: bb.0.entry: |
| 340 |
; 32BIT-NEXT: ADJCALLSTACKDOWN 56, 0, implicit-def dead $r1, implicit $r1 |
| 341 |
; 32BIT-NEXT: renamable $r3 = LWZtoc @gS7, $r2 :: (load (s32) from got) |
| 342 |
; 32BIT-NEXT: renamable $r5 = LHZ 4, renamable $r3 :: (load (s16)) |
| 343 |
; 32BIT-NEXT: renamable $r4 = LBZ 6, renamable $r3 :: (load (s8)) |
| 344 |
; 32BIT-NEXT: renamable $r3 = LWZ 0, killed renamable $r3 :: (load (s32)) |
| 345 |
; 32BIT-NEXT: renamable $r4 = RLWINM killed renamable $r4, 8, 16, 23 |
| 346 |
; 32BIT-NEXT: renamable $r4 = RLWIMI killed renamable $r4, killed renamable $r5, 16, 0, 15 |
| 347 |
; 32BIT-NEXT: BL_NOP <mcsymbol .test_byval_7Byte[PR]>, csr_aix32, implicit-def dead $lr, implicit $rm, implicit $r3, implicit $r4, implicit $r2, implicit-def $r1, implicit-def dead $r3 |
| 348 |
; 32BIT-NEXT: ADJCALLSTACKUP 56, 0, implicit-def dead $r1, implicit $r1 |
| 349 |
; 32BIT-NEXT: BLR implicit $lr, implicit $rm |
| 350 |
; |
| 351 |
; 64BIT-LABEL: name: call_test_byval_7Byte |
| 352 |
; 64BIT: bb.0.entry: |
| 353 |
; 64BIT-NEXT: ADJCALLSTACKDOWN 112, 0, implicit-def dead $r1, implicit $r1 |
| 354 |
; 64BIT-NEXT: renamable $x3 = LDtoc @gS7, $x2 :: (load (s64) from got) |
| 355 |
; 64BIT-NEXT: renamable $x4 = LHZ8 4, renamable $x3 :: (load (s16)) |
| 356 |
; 64BIT-NEXT: renamable $x5 = LBZ8 6, renamable $x3 :: (load (s8)) |
| 357 |
; 64BIT-NEXT: renamable $x6 = LWZ8 0, killed renamable $x3 :: (load (s32)) |
| 358 |
; 64BIT-NEXT: renamable $x3 = RLWINM8 killed renamable $x5, 8, 16, 23 |
| 359 |
; 64BIT-NEXT: renamable $x3 = RLWIMI8 killed renamable $x3, killed renamable $x4, 16, 0, 15 |
| 360 |
; 64BIT-NEXT: renamable $x3 = RLDIMI killed renamable $x3, killed renamable $x6, 32, 0 |
| 361 |
; 64BIT-NEXT: BL8_NOP <mcsymbol .test_byval_7Byte[PR]>, csr_ppc64, implicit-def dead $lr8, implicit $rm, implicit $x3, implicit $x2, implicit-def $r1, implicit-def dead $x3 |
| 362 |
; 64BIT-NEXT: ADJCALLSTACKUP 112, 0, implicit-def dead $r1, implicit $r1 |
| 363 |
; 64BIT-NEXT: BLR8 implicit $lr8, implicit $rm |
| 364 |
entry: |
| 365 |
%call = call zeroext i8 @test_byval_7Byte(ptr byval(%struct.S7) align 1 @gS7) |
| 366 |
ret void |
| 367 |
} |
| 368 |
|
| 369 |
declare zeroext i8 @test_byval_7Byte(ptr byval(%struct.S7) align 1) |
| 370 |
|
| 371 |
%struct.S8 = type { [8 x i8] } |
| 372 |
|
| 373 |
@gS8 = external global %struct.S8, align 1 |
| 374 |
|
| 375 |
define void @call_test_byval_8Byte() { |
| 376 |
; 32BIT-LABEL: name: call_test_byval_8Byte |
| 377 |
; 32BIT: bb.0.entry: |
| 378 |
; 32BIT-NEXT: ADJCALLSTACKDOWN 56, 0, implicit-def dead $r1, implicit $r1 |
| 379 |
; 32BIT-NEXT: renamable $r3 = LWZtoc @gS8, $r2 :: (load (s32) from got) |
| 380 |
; 32BIT-NEXT: renamable $r4 = LWZ 4, renamable $r3 :: (load (s32)) |
| 381 |
; 32BIT-NEXT: renamable $r3 = LWZ 0, killed renamable $r3 :: (load (s32)) |
| 382 |
; 32BIT-NEXT: BL_NOP <mcsymbol .test_byval_8Byte[PR]>, csr_aix32, implicit-def dead $lr, implicit $rm, implicit $r3, implicit $r4, implicit $r2, implicit-def $r1, implicit-def dead $r3 |
| 383 |
; 32BIT-NEXT: ADJCALLSTACKUP 56, 0, implicit-def dead $r1, implicit $r1 |
| 384 |
; 32BIT-NEXT: BLR implicit $lr, implicit $rm |
| 385 |
; |
| 386 |
; 64BIT-LABEL: name: call_test_byval_8Byte |
| 387 |
; 64BIT: bb.0.entry: |
| 388 |
; 64BIT-NEXT: ADJCALLSTACKDOWN 112, 0, implicit-def dead $r1, implicit $r1 |
| 389 |
; 64BIT-NEXT: renamable $x3 = LDtoc @gS8, $x2 :: (load (s64) from got) |
| 390 |
; 64BIT-NEXT: renamable $x3 = LD 0, killed renamable $x3 :: (load (s64)) |
| 391 |
; 64BIT-NEXT: BL8_NOP <mcsymbol .test_byval_8Byte[PR]>, csr_ppc64, implicit-def dead $lr8, implicit $rm, implicit $x3, implicit $x2, implicit-def $r1, implicit-def dead $x3 |
| 392 |
; 64BIT-NEXT: ADJCALLSTACKUP 112, 0, implicit-def dead $r1, implicit $r1 |
| 393 |
; 64BIT-NEXT: BLR8 implicit $lr8, implicit $rm |
| 394 |
entry: |
| 395 |
%call = call zeroext i8 @test_byval_8Byte(ptr byval(%struct.S8) align 1 @gS8) |
| 396 |
ret void |
| 397 |
} |
| 398 |
|
| 399 |
declare zeroext i8 @test_byval_8Byte(ptr byval(%struct.S8) align 1) |
| 400 |
|
| 401 |
%struct.S32 = type { [32 x i8] } |
| 402 |
|
| 403 |
@gS32 = external global %struct.S32, align 1 |
| 404 |
|
| 405 |
define void @call_test_byval_32Byte() { |
| 406 |
; 32BIT-LABEL: name: call_test_byval_32Byte |
| 407 |
; 32BIT: bb.0.entry: |
| 408 |
; 32BIT-NEXT: ADJCALLSTACKDOWN 56, 0, implicit-def dead $r1, implicit $r1 |
| 409 |
; 32BIT-NEXT: renamable $r3 = LWZtoc @gS32, $r2 :: (load (s32) from got) |
| 410 |
; 32BIT-NEXT: renamable $r10 = LWZ 28, renamable $r3 :: (load (s32)) |
| 411 |
; 32BIT-NEXT: renamable $r9 = LWZ 24, renamable $r3 :: (load (s32)) |
| 412 |
; 32BIT-NEXT: renamable $r8 = LWZ 20, renamable $r3 :: (load (s32)) |
| 413 |
; 32BIT-NEXT: renamable $r7 = LWZ 16, renamable $r3 :: (load (s32)) |
| 414 |
; 32BIT-NEXT: renamable $r6 = LWZ 12, renamable $r3 :: (load (s32)) |
| 415 |
; 32BIT-NEXT: renamable $r5 = LWZ 8, renamable $r3 :: (load (s32)) |
| 416 |
; 32BIT-NEXT: renamable $r4 = LWZ 4, renamable $r3 :: (load (s32)) |
| 417 |
; 32BIT-NEXT: renamable $r3 = LWZ 0, killed renamable $r3 :: (load (s32)) |
| 418 |
; 32BIT-NEXT: BL_NOP <mcsymbol .test_byval_32Byte>, csr_aix32, implicit-def dead $lr, implicit $rm, implicit $r3, implicit $r4, implicit $r5, implicit $r6, implicit $r7, implicit $r8, implicit $r9, implicit $r10, implicit $r2, implicit-def $r1, implicit-def dead $r3 |
| 419 |
; 32BIT-NEXT: ADJCALLSTACKUP 56, 0, implicit-def dead $r1, implicit $r1 |
| 420 |
; 32BIT-NEXT: BLR implicit $lr, implicit $rm |
| 421 |
; |
| 422 |
; 64BIT-LABEL: name: call_test_byval_32Byte |
| 423 |
; 64BIT: bb.0.entry: |
| 424 |
; 64BIT-NEXT: ADJCALLSTACKDOWN 112, 0, implicit-def dead $r1, implicit $r1 |
| 425 |
; 64BIT-NEXT: renamable $x3 = LDtoc @gS32, $x2 :: (load (s64) from got) |
| 426 |
; 64BIT-NEXT: renamable $x6 = LD 24, renamable $x3 :: (load (s64)) |
| 427 |
; 64BIT-NEXT: renamable $x5 = LD 16, renamable $x3 :: (load (s64)) |
| 428 |
; 64BIT-NEXT: renamable $x4 = LD 8, renamable $x3 :: (load (s64)) |
| 429 |
; 64BIT-NEXT: renamable $x3 = LD 0, killed renamable $x3 :: (load (s64)) |
| 430 |
; 64BIT-NEXT: BL8_NOP <mcsymbol .test_byval_32Byte>, csr_ppc64, implicit-def dead $lr8, implicit $rm, implicit $x3, implicit $x4, implicit $x5, implicit $x6, implicit $x2, implicit-def $r1, implicit-def dead $x3 |
| 431 |
; 64BIT-NEXT: ADJCALLSTACKUP 112, 0, implicit-def dead $r1, implicit $r1 |
| 432 |
; 64BIT-NEXT: BLR8 implicit $lr8, implicit $rm |
| 433 |
entry: |
| 434 |
%call = call zeroext i8 @test_byval_32Byte(ptr byval(%struct.S32) align 1 @gS32) |
| 435 |
ret void |
| 436 |
} |
| 437 |
|
| 438 |
define zeroext i8 @test_byval_32Byte(ptr byval(%struct.S32) align 1 %s) { |
| 439 |
; 32BIT-LABEL: name: test_byval_32Byte |
| 440 |
; 32BIT: bb.0.entry: |
| 441 |
; 32BIT-NEXT: liveins: $r3, $r4, $r5, $r6, $r7, $r8, $r9, $r10 |
| 442 |
; 32BIT-NEXT: {{ $}} |
| 443 |
; 32BIT-NEXT: STW killed renamable $r8, 20, %fixed-stack.0 :: (store (s32) into %fixed-stack.0 + 20) |
| 444 |
; 32BIT-NEXT: STW killed renamable $r3, 0, %fixed-stack.0 :: (store (s32) into %fixed-stack.0, align 8) |
| 445 |
; 32BIT-NEXT: STW killed renamable $r4, 4, %fixed-stack.0 :: (store (s32) into %fixed-stack.0 + 4) |
| 446 |
; 32BIT-NEXT: STW killed renamable $r5, 8, %fixed-stack.0 :: (store (s32) into %fixed-stack.0 + 8, align 8) |
| 447 |
; 32BIT-NEXT: STW killed renamable $r6, 12, %fixed-stack.0 :: (store (s32) into %fixed-stack.0 + 12) |
| 448 |
; 32BIT-NEXT: STW killed renamable $r7, 16, %fixed-stack.0 :: (store (s32) into %fixed-stack.0 + 16, align 8) |
| 449 |
; 32BIT-NEXT: renamable $r3 = LBZ 21, %fixed-stack.0 :: (dereferenceable load (s8) from %ir.arrayidx) |
| 450 |
; 32BIT-NEXT: STW killed renamable $r9, 24, %fixed-stack.0 :: (store (s32) into %fixed-stack.0 + 24, align 8) |
| 451 |
; 32BIT-NEXT: STW killed renamable $r10, 28, %fixed-stack.0 :: (store (s32) into %fixed-stack.0 + 28) |
| 452 |
; 32BIT-NEXT: BLR implicit $lr, implicit $rm, implicit $r3 |
| 453 |
; |
| 454 |
; 64BIT-LABEL: name: test_byval_32Byte |
| 455 |
; 64BIT: bb.0.entry: |
| 456 |
; 64BIT-NEXT: liveins: $x3, $x4, $x5, $x6 |
| 457 |
; 64BIT-NEXT: {{ $}} |
| 458 |
; 64BIT-NEXT: STD killed renamable $x5, 16, %fixed-stack.0 :: (store (s64) into %fixed-stack.0 + 16, align 16) |
| 459 |
; 64BIT-NEXT: STD killed renamable $x3, 0, %fixed-stack.0 :: (store (s64) into %fixed-stack.0, align 16) |
| 460 |
; 64BIT-NEXT: renamable $x3 = LBZ8 21, %fixed-stack.0 :: (dereferenceable load (s8) from %ir.arrayidx) |
| 461 |
; 64BIT-NEXT: STD killed renamable $x4, 8, %fixed-stack.0 :: (store (s64) into %fixed-stack.0 + 8) |
| 462 |
; 64BIT-NEXT: STD killed renamable $x6, 24, %fixed-stack.0 :: (store (s64) into %fixed-stack.0 + 24) |
| 463 |
; 64BIT-NEXT: BLR8 implicit $lr8, implicit $rm, implicit $x3 |
| 464 |
entry: |
| 465 |
%arrayidx = getelementptr inbounds %struct.S32, ptr %s, i32 0, i32 0, i32 21 |
| 466 |
%0 = load i8, ptr %arrayidx, align 1 |
| 467 |
ret i8 %0 |
| 468 |
} |
| 469 |
|
| 470 |
; The ByVal handling produces dead stores. See `LowerFormalArguments_AIX` for |
| 471 |
; details on why. |
| 472 |
|
| 473 |
%struct.S31 = type <{ float, i32, i64, double, i32, i16, i8 }> |
| 474 |
|
| 475 |
@gS31 = external global %struct.S31, align 1 |
| 476 |
|
| 477 |
define void @call_test_byval_31Byte() { |
| 478 |
; 32BIT-LABEL: name: call_test_byval_31Byte |
| 479 |
; 32BIT: bb.0.entry: |
| 480 |
; 32BIT-NEXT: ADJCALLSTACKDOWN 56, 0, implicit-def dead $r1, implicit $r1 |
| 481 |
; 32BIT-NEXT: renamable $r3 = LWZtoc @gS31, $r2 :: (load (s32) from got) |
| 482 |
; 32BIT-NEXT: renamable $r11 = LHZ 28, renamable $r3 :: (load (s16)) |
| 483 |
; 32BIT-NEXT: renamable $r10 = LBZ 30, renamable $r3 :: (load (s8)) |
| 484 |
; 32BIT-NEXT: renamable $r9 = LWZ 24, renamable $r3 :: (load (s32)) |
| 485 |
; 32BIT-NEXT: renamable $r8 = LWZ 20, renamable $r3 :: (load (s32)) |
| 486 |
; 32BIT-NEXT: renamable $r7 = LWZ 16, renamable $r3 :: (load (s32)) |
| 487 |
; 32BIT-NEXT: renamable $r6 = LWZ 12, renamable $r3 :: (load (s32)) |
| 488 |
; 32BIT-NEXT: renamable $r5 = LWZ 8, renamable $r3 :: (load (s32)) |
| 489 |
; 32BIT-NEXT: renamable $r4 = LWZ 4, renamable $r3 :: (load (s32)) |
| 490 |
; 32BIT-NEXT: renamable $r3 = LWZ 0, killed renamable $r3 :: (load (s32)) |
| 491 |
; 32BIT-NEXT: renamable $r10 = RLWINM killed renamable $r10, 8, 16, 23 |
| 492 |
; 32BIT-NEXT: renamable $r10 = RLWIMI killed renamable $r10, killed renamable $r11, 16, 0, 15 |
| 493 |
; 32BIT-NEXT: BL_NOP <mcsymbol .test_byval_31Byte>, csr_aix32, implicit-def dead $lr, implicit $rm, implicit $r3, implicit $r4, implicit $r5, implicit $r6, implicit $r7, implicit $r8, implicit $r9, implicit $r10, implicit $r2, implicit-def $r1, implicit-def dead $f1 |
| 494 |
; 32BIT-NEXT: ADJCALLSTACKUP 56, 0, implicit-def dead $r1, implicit $r1 |
| 495 |
; 32BIT-NEXT: BLR implicit $lr, implicit $rm |
| 496 |
; |
| 497 |
; 64BIT-LABEL: name: call_test_byval_31Byte |
| 498 |
; 64BIT: bb.0.entry: |
| 499 |
; 64BIT-NEXT: ADJCALLSTACKDOWN 112, 0, implicit-def dead $r1, implicit $r1 |
| 500 |
; 64BIT-NEXT: renamable $x3 = LDtoc @gS31, $x2 :: (load (s64) from got) |
| 501 |
; 64BIT-NEXT: renamable $x7 = LHZ8 28, renamable $x3 :: (load (s16)) |
| 502 |
; 64BIT-NEXT: renamable $x6 = LBZ8 30, renamable $x3 :: (load (s8)) |
| 503 |
; 64BIT-NEXT: renamable $x8 = LWZ8 24, renamable $x3 :: (load (s32)) |
| 504 |
; 64BIT-NEXT: renamable $x5 = LD 16, renamable $x3 :: (load (s64)) |
| 505 |
; 64BIT-NEXT: renamable $x4 = LD 8, renamable $x3 :: (load (s64)) |
| 506 |
; 64BIT-NEXT: renamable $x6 = RLWINM8 killed renamable $x6, 8, 16, 23 |
| 507 |
; 64BIT-NEXT: renamable $x3 = LD 0, killed renamable $x3 :: (load (s64)) |
| 508 |
; 64BIT-NEXT: renamable $x6 = RLWIMI8 killed renamable $x6, killed renamable $x7, 16, 0, 15 |
| 509 |
; 64BIT-NEXT: renamable $x6 = RLDIMI killed renamable $x6, killed renamable $x8, 32, 0 |
| 510 |
; 64BIT-NEXT: BL8_NOP <mcsymbol .test_byval_31Byte>, csr_ppc64, implicit-def dead $lr8, implicit $rm, implicit $x3, implicit $x4, implicit $x5, implicit $x6, implicit $x2, implicit-def $r1, implicit-def dead $f1 |
| 511 |
; 64BIT-NEXT: ADJCALLSTACKUP 112, 0, implicit-def dead $r1, implicit $r1 |
| 512 |
; 64BIT-NEXT: BLR8 implicit $lr8, implicit $rm |
| 513 |
entry: |
| 514 |
%call = call double @test_byval_31Byte(ptr byval(%struct.S31) align 1 @gS31) |
| 515 |
ret void |
| 516 |
} |
| 517 |
|
| 518 |
define double @test_byval_31Byte(ptr byval(%struct.S31) align 1 %s) { |
| 519 |
; 32BIT-LABEL: name: test_byval_31Byte |
| 520 |
; 32BIT: bb.0.entry: |
| 521 |
; 32BIT-NEXT: liveins: $r3, $r4, $r5, $r6, $r7, $r8, $r9, $r10 |
| 522 |
; 32BIT-NEXT: {{ $}} |
| 523 |
; 32BIT-NEXT: STW killed renamable $r8, 20, %fixed-stack.0 :: (store (s32) into %fixed-stack.0 + 20) |
| 524 |
; 32BIT-NEXT: STW killed renamable $r7, 16, %fixed-stack.0 :: (store (s32) into %fixed-stack.0 + 16, align 8) |
| 525 |
; 32BIT-NEXT: STW killed renamable $r3, 0, %fixed-stack.0 :: (store (s32) into %fixed-stack.0, align 8) |
| 526 |
; 32BIT-NEXT: STW killed renamable $r4, 4, %fixed-stack.0 :: (store (s32) into %fixed-stack.0 + 4) |
| 527 |
; 32BIT-NEXT: STW killed renamable $r5, 8, %fixed-stack.0 :: (store (s32) into %fixed-stack.0 + 8, align 8) |
| 528 |
; 32BIT-NEXT: STW killed renamable $r6, 12, %fixed-stack.0 :: (store (s32) into %fixed-stack.0 + 12) |
| 529 |
; 32BIT-NEXT: renamable $f1 = LFD 16, %fixed-stack.0 :: (dereferenceable load (s64) from %ir.gep) |
| 530 |
; 32BIT-NEXT: STW killed renamable $r9, 24, %fixed-stack.0 :: (store (s32) into %fixed-stack.0 + 24, align 8) |
| 531 |
; 32BIT-NEXT: STW killed renamable $r10, 28, %fixed-stack.0 :: (store (s32) into %fixed-stack.0 + 28) |
| 532 |
; 32BIT-NEXT: BLR implicit $lr, implicit $rm, implicit $f1 |
| 533 |
; |
| 534 |
; 64BIT-LABEL: name: test_byval_31Byte |
| 535 |
; 64BIT: bb.0.entry: |
| 536 |
; 64BIT-NEXT: liveins: $x3, $x4, $x5, $x6 |
| 537 |
; 64BIT-NEXT: {{ $}} |
| 538 |
; 64BIT-NEXT: STD killed renamable $x5, 16, %fixed-stack.0 :: (store (s64) into %fixed-stack.0 + 16, align 16) |
| 539 |
; 64BIT-NEXT: STD killed renamable $x3, 0, %fixed-stack.0 :: (store (s64) into %fixed-stack.0, align 16) |
| 540 |
; 64BIT-NEXT: renamable $f1 = LFD 16, %fixed-stack.0 :: (dereferenceable load (s64) from %ir.gep, align 16) |
| 541 |
; 64BIT-NEXT: STD killed renamable $x4, 8, %fixed-stack.0 :: (store (s64) into %fixed-stack.0 + 8) |
| 542 |
; 64BIT-NEXT: STD killed renamable $x6, 24, %fixed-stack.0 :: (store (s64) into %fixed-stack.0 + 24) |
| 543 |
; 64BIT-NEXT: BLR8 implicit $lr8, implicit $rm, implicit $f1 |
| 544 |
entry: |
| 545 |
%gep = getelementptr inbounds %struct.S31, ptr %s, i32 0, i32 3 |
| 546 |
%load = load double, ptr %gep, align 1 |
| 547 |
ret double %load |
| 548 |
} |
| 549 |
|
| 550 |
%struct.F = type { float, float, float } |
| 551 |
|
| 552 |
define i32 @call_test_byval_homogeneous_float_struct() { |
| 553 |
; 32BIT-LABEL: name: call_test_byval_homogeneous_float_struct |
| 554 |
; 32BIT: bb.0.entry: |
| 555 |
; 32BIT-NEXT: renamable $r3 = LI 0 |
| 556 |
; 32BIT-NEXT: STW renamable $r3, 8, %stack.0.s :: (store (s32) into %ir.s + 8, align 8) |
| 557 |
; 32BIT-NEXT: STW renamable $r3, 4, %stack.0.s :: (store (s32) into %ir.s + 4, basealign 8) |
| 558 |
; 32BIT-NEXT: STW killed renamable $r3, 0, %stack.0.s :: (store (s32) into %ir.s, align 8) |
| 559 |
; 32BIT-NEXT: ADJCALLSTACKDOWN 56, 0, implicit-def dead $r1, implicit $r1 |
| 560 |
; 32BIT-NEXT: renamable $r5 = LWZ 8, %stack.0.s :: (load (s32) from %stack.0.s + 8, align 8) |
| 561 |
; 32BIT-NEXT: renamable $r4 = LWZ 4, %stack.0.s :: (load (s32) from %stack.0.s + 4) |
| 562 |
; 32BIT-NEXT: $r3 = LI 0 |
| 563 |
; 32BIT-NEXT: BL_NOP <mcsymbol .test_byval_homogeneous_float_struct[PR]>, csr_aix32, implicit-def dead $lr, implicit $rm, implicit $r3, implicit $r4, implicit $r5, implicit $r2, implicit-def $r1, implicit-def $r3 |
| 564 |
; 32BIT-NEXT: ADJCALLSTACKUP 56, 0, implicit-def dead $r1, implicit $r1 |
| 565 |
; 32BIT-NEXT: BLR implicit $lr, implicit $rm, implicit $r3 |
| 566 |
; |
| 567 |
; 64BIT-LABEL: name: call_test_byval_homogeneous_float_struct |
| 568 |
; 64BIT: bb.0.entry: |
| 569 |
; 64BIT-NEXT: renamable $x3 = LI8 0 |
| 570 |
; 64BIT-NEXT: STW8 renamable $x3, 8, %stack.0.s :: (store (s32) into %ir.s + 8, align 8) |
| 571 |
; 64BIT-NEXT: STD killed renamable $x3, 0, %stack.0.s :: (store (s64) into %ir.s) |
| 572 |
; 64BIT-NEXT: ADJCALLSTACKDOWN 112, 0, implicit-def dead $r1, implicit $r1 |
| 573 |
; 64BIT-NEXT: renamable $x3 = LWZ8 8, %stack.0.s :: (load (s32) from %stack.0.s + 8, align 8) |
| 574 |
; 64BIT-NEXT: renamable $x4 = RLDICR killed renamable $x3, 32, 31 |
| 575 |
; 64BIT-NEXT: $x3 = LI8 0 |
| 576 |
; 64BIT-NEXT: BL8_NOP <mcsymbol .test_byval_homogeneous_float_struct[PR]>, csr_ppc64, implicit-def dead $lr8, implicit $rm, implicit $x3, implicit $x4, implicit $x2, implicit-def $r1, implicit-def $x3 |
| 577 |
; 64BIT-NEXT: ADJCALLSTACKUP 112, 0, implicit-def dead $r1, implicit $r1 |
| 578 |
; 64BIT-NEXT: BLR8 implicit $lr8, implicit $rm, implicit $x3 |
| 579 |
entry: |
| 580 |
%s = alloca %struct.F, align 8 |
| 581 |
call void @llvm.memset.p0.i32(ptr align 4 %s, i8 0, i32 12, i1 false) |
| 582 |
%call = call i32 @test_byval_homogeneous_float_struct(ptr byval(%struct.F) align 4 %s) |
| 583 |
ret i32 %call |
| 584 |
} |
| 585 |
|
| 586 |
declare void @llvm.memset.p0.i32(ptr nocapture writeonly, i8, i32, i1 immarg) |
| 587 |
|
| 588 |
declare i32 @test_byval_homogeneous_float_struct(ptr byval(%struct.F) align 4) |