| OLD | NEW |
| 1 ; This tests the NaCl intrinsics memset, memcpy and memmove. | 1 ; This tests the NaCl intrinsics memset, memcpy and memmove. |
| 2 | 2 |
| 3 ; RUN: %if --need=target_X8632 --command %p2i --filetype=obj --disassemble \ | 3 ; RUN: %if --need=target_X8632 --command %p2i --filetype=obj --disassemble \ |
| 4 ; RUN: --target x8632 -i %s --args -O2 -sandbox \ | 4 ; RUN: --target x8632 -i %s --args -O2 -sandbox \ |
| 5 ; RUN: | %if --need=target_X8632 --command FileCheck %s | 5 ; RUN: | %if --need=target_X8632 --command FileCheck %s |
| 6 ; RUN: %if --need=target_X8632 --command %p2i --filetype=obj --disassemble \ | 6 ; RUN: %if --need=target_X8632 --command %p2i --filetype=obj --disassemble \ |
| 7 ; RUN: --target x8632 -i %s --args -Om1 --fmem-intrin-opt -sandbox \ |
| 8 ; RUN: | %if --need=target_X8632 --command FileCheck %s |
| 9 ; RUN: %if --need=target_X8632 --command %p2i --filetype=obj --disassemble \ |
| 7 ; RUN: --target x8632 -i %s --args -Om1 -sandbox \ | 10 ; RUN: --target x8632 -i %s --args -Om1 -sandbox \ |
| 8 ; RUN: | %if --need=target_X8632 --command FileCheck %s | 11 ; RUN: | %if --need=target_X8632 --command FileCheck --check-prefix OM1 %s |
| 9 | 12 |
| 10 ; RUN: %if --need=target_ARM32 --need=allow_dump \ | 13 ; RUN: %if --need=target_ARM32 --need=allow_dump \ |
| 11 ; RUN: --command %p2i --filetype=asm --assemble --disassemble --target arm32 \ | 14 ; RUN: --command %p2i --filetype=asm --assemble --disassemble --target arm32 \ |
| 12 ; RUN: -i %s --args -O2 --skip-unimplemented \ | 15 ; RUN: -i %s --args -O2 --skip-unimplemented \ |
| 13 ; RUN: | %if --need=target_ARM32 --need=allow_dump \ | 16 ; RUN: | %if --need=target_ARM32 --need=allow_dump \ |
| 14 ; RUN: --command FileCheck --check-prefix ARM32 %s | 17 ; RUN: --command FileCheck --check-prefix ARM32 %s |
| 15 | 18 |
| 16 declare void @llvm.memcpy.p0i8.p0i8.i32(i8*, i8*, i32, i32, i1) | 19 declare void @llvm.memcpy.p0i8.p0i8.i32(i8*, i8*, i32, i32, i1) |
| 17 declare void @llvm.memmove.p0i8.p0i8.i32(i8*, i8*, i32, i32, i1) | 20 declare void @llvm.memmove.p0i8.p0i8.i32(i8*, i8*, i32, i32, i1) |
| 18 declare void @llvm.memset.p0i8.i32(i8*, i8, i32, i32, i1) | 21 declare void @llvm.memset.p0i8.i32(i8*, i8, i32, i32, i1) |
| 19 | 22 |
| 20 define void @test_memcpy(i32 %iptr_dst, i32 %iptr_src, i32 %len) { | 23 define void @test_memcpy(i32 %iptr_dst, i32 %iptr_src, i32 %len) { |
| 21 entry: | 24 entry: |
| 22 %dst = inttoptr i32 %iptr_dst to i8* | 25 %dst = inttoptr i32 %iptr_dst to i8* |
| 23 %src = inttoptr i32 %iptr_src to i8* | 26 %src = inttoptr i32 %iptr_src to i8* |
| 24 call void @llvm.memcpy.p0i8.p0i8.i32(i8* %dst, i8* %src, | 27 call void @llvm.memcpy.p0i8.p0i8.i32(i8* %dst, i8* %src, |
| 25 i32 %len, i32 1, i1 false) | 28 i32 %len, i32 1, i1 false) |
| 26 ret void | 29 ret void |
| 27 } | 30 } |
| 28 ; CHECK-LABEL: test_memcpy | 31 ; CHECK-LABEL: test_memcpy |
| 29 ; CHECK: call {{.*}} R_{{.*}} memcpy | 32 ; CHECK: call {{.*}} R_{{.*}} memcpy |
| 33 ; OM1-LABEL: test_memcpy |
| 34 ; OM1: call {{.*}} memcpy |
| 30 ; ARM32-LABEL: test_memcpy | 35 ; ARM32-LABEL: test_memcpy |
| 31 ; ARM32: bl {{.*}} memcpy | 36 ; ARM32: bl {{.*}} memcpy |
| 32 | 37 |
| 33 define void @test_memcpy_long_const_len(i32 %iptr_dst, i32 %iptr_src) { | 38 define void @test_memcpy_long_const_len(i32 %iptr_dst, i32 %iptr_src) { |
| 34 entry: | 39 entry: |
| 35 %dst = inttoptr i32 %iptr_dst to i8* | 40 %dst = inttoptr i32 %iptr_dst to i8* |
| 36 %src = inttoptr i32 %iptr_src to i8* | 41 %src = inttoptr i32 %iptr_src to i8* |
| 37 call void @llvm.memcpy.p0i8.p0i8.i32(i8* %dst, i8* %src, | 42 call void @llvm.memcpy.p0i8.p0i8.i32(i8* %dst, i8* %src, |
| 38 i32 4876, i32 1, i1 false) | 43 i32 4876, i32 1, i1 false) |
| 39 ret void | 44 ret void |
| 40 } | 45 } |
| 41 ; CHECK-LABEL: test_memcpy_long_const_len | 46 ; CHECK-LABEL: test_memcpy_long_const_len |
| 42 ; CHECK: call {{.*}} R_{{.*}} memcpy | 47 ; CHECK: call {{.*}} R_{{.*}} memcpy |
| 48 ; OM1-LABEL: test_memcpy_long_const_len |
| 49 ; OM1: call {{.*}} memcpy |
| 43 ; ARM32-LABEL: test_memcpy_long_const_len | 50 ; ARM32-LABEL: test_memcpy_long_const_len |
| 44 ; ARM32: bl {{.*}} memcpy | 51 ; ARM32: bl {{.*}} memcpy |
| 45 | 52 |
| 46 define void @test_memcpy_very_small_const_len(i32 %iptr_dst, i32 %iptr_src) { | 53 define void @test_memcpy_very_small_const_len(i32 %iptr_dst, i32 %iptr_src) { |
| 47 entry: | 54 entry: |
| 48 %dst = inttoptr i32 %iptr_dst to i8* | 55 %dst = inttoptr i32 %iptr_dst to i8* |
| 49 %src = inttoptr i32 %iptr_src to i8* | 56 %src = inttoptr i32 %iptr_src to i8* |
| 50 call void @llvm.memcpy.p0i8.p0i8.i32(i8* %dst, i8* %src, | 57 call void @llvm.memcpy.p0i8.p0i8.i32(i8* %dst, i8* %src, |
| 51 i32 2, i32 1, i1 false) | 58 i32 2, i32 1, i1 false) |
| 52 ret void | 59 ret void |
| 53 } | 60 } |
| 54 ; CHECK-LABEL: test_memcpy_very_small_const_len | 61 ; CHECK-LABEL: test_memcpy_very_small_const_len |
| 55 ; CHECK: mov [[REG:[^,]*]],WORD PTR [{{.*}}] | 62 ; CHECK: mov [[REG:[^,]*]],WORD PTR [{{.*}}] |
| 56 ; CHECK-NEXT: mov WORD PTR [{{.*}}],[[REG]] | 63 ; CHECK-NEXT: mov WORD PTR [{{.*}}],[[REG]] |
| 57 ; CHECK-NOT: mov | 64 ; CHECK-NOT: mov |
| 65 ; OM1-LABEL: test_memcpy_very_small_const_len |
| 66 ; OM1: call {{.*}} memcpy |
| 58 ; ARM32-LABEL: test_memcpy_very_small_const_len | 67 ; ARM32-LABEL: test_memcpy_very_small_const_len |
| 59 ; ARM32: bl {{.*}} memcpy | 68 ; ARM32: bl {{.*}} memcpy |
| 60 | 69 |
| 61 define void @test_memcpy_const_len_3(i32 %iptr_dst, i32 %iptr_src) { | 70 define void @test_memcpy_const_len_3(i32 %iptr_dst, i32 %iptr_src) { |
| 62 entry: | 71 entry: |
| 63 %dst = inttoptr i32 %iptr_dst to i8* | 72 %dst = inttoptr i32 %iptr_dst to i8* |
| 64 %src = inttoptr i32 %iptr_src to i8* | 73 %src = inttoptr i32 %iptr_src to i8* |
| 65 call void @llvm.memcpy.p0i8.p0i8.i32(i8* %dst, i8* %src, | 74 call void @llvm.memcpy.p0i8.p0i8.i32(i8* %dst, i8* %src, |
| 66 i32 3, i32 1, i1 false) | 75 i32 3, i32 1, i1 false) |
| 67 ret void | 76 ret void |
| 68 } | 77 } |
| 69 ; CHECK-LABEL: test_memcpy_const_len_3 | 78 ; CHECK-LABEL: test_memcpy_const_len_3 |
| 70 ; CHECK: mov [[REG:[^,]*]],WORD PTR [{{.*}}] | 79 ; CHECK: mov [[REG:[^,]*]],WORD PTR [{{.*}}] |
| 71 ; CHECK-NEXT: mov WORD PTR [{{.*}}],[[REG]] | 80 ; CHECK-NEXT: mov WORD PTR [{{.*}}],[[REG]] |
| 72 ; CHECK-NEXT: mov [[REG:[^,]*]],BYTE PTR [{{.*}}+0x2] | 81 ; CHECK-NEXT: mov [[REG:[^,]*]],BYTE PTR [{{.*}}+0x2] |
| 73 ; CHECK-NEXT: mov BYTE PTR [{{.*}}+0x2],[[REG]] | 82 ; CHECK-NEXT: mov BYTE PTR [{{.*}}+0x2],[[REG]] |
| 74 ; CHECK-NOT: mov | 83 ; CHECK-NOT: mov |
| 84 ; OM1-LABEL: test_memcpy_const_len_3 |
| 85 ; OM1: call {{.*}} memcpy |
| 75 ; ARM32-LABEL: test_memcpy_const_len_3 | 86 ; ARM32-LABEL: test_memcpy_const_len_3 |
| 76 ; ARM32: bl {{.*}} memcpy | 87 ; ARM32: bl {{.*}} memcpy |
| 77 | 88 |
| 78 define void @test_memcpy_mid_const_len(i32 %iptr_dst, i32 %iptr_src) { | 89 define void @test_memcpy_mid_const_len(i32 %iptr_dst, i32 %iptr_src) { |
| 79 entry: | 90 entry: |
| 80 %dst = inttoptr i32 %iptr_dst to i8* | 91 %dst = inttoptr i32 %iptr_dst to i8* |
| 81 %src = inttoptr i32 %iptr_src to i8* | 92 %src = inttoptr i32 %iptr_src to i8* |
| 82 call void @llvm.memcpy.p0i8.p0i8.i32(i8* %dst, i8* %src, | 93 call void @llvm.memcpy.p0i8.p0i8.i32(i8* %dst, i8* %src, |
| 83 i32 9, i32 1, i1 false) | 94 i32 9, i32 1, i1 false) |
| 84 ret void | 95 ret void |
| 85 } | 96 } |
| 86 ; CHECK-LABEL: test_memcpy_mid_const_len | 97 ; CHECK-LABEL: test_memcpy_mid_const_len |
| 87 ; CHECK: movq [[REG:xmm[0-9]+]],QWORD PTR [{{.*}}] | 98 ; CHECK: movq [[REG:xmm[0-9]+]],QWORD PTR [{{.*}}] |
| 88 ; CHECK-NEXT: movq QWORD PTR [{{.*}}],[[REG]] | 99 ; CHECK-NEXT: movq QWORD PTR [{{.*}}],[[REG]] |
| 89 ; CHECK-NEXT: mov [[REG:[^,]*]],BYTE PTR [{{.*}}+0x8] | 100 ; CHECK-NEXT: mov [[REG:[^,]*]],BYTE PTR [{{.*}}+0x8] |
| 90 ; CHECK-NEXT: mov BYTE PTR [{{.*}}+0x8],[[REG]] | 101 ; CHECK-NEXT: mov BYTE PTR [{{.*}}+0x8],[[REG]] |
| 91 ; CHECK-NOT: mov | 102 ; CHECK-NOT: mov |
| 103 ; OM1-LABEL: test_memcpy_mid_const_len |
| 104 ; OM1: call {{.*}} memcpy |
| 92 ; ARM32-LABEL: test_memcpy_mid_const_len | 105 ; ARM32-LABEL: test_memcpy_mid_const_len |
| 93 ; ARM32: bl {{.*}} memcpy | 106 ; ARM32: bl {{.*}} memcpy |
| 94 | 107 |
| 95 define void @test_memcpy_mid_const_len_overlap(i32 %iptr_dst, i32 %iptr_src) { | 108 define void @test_memcpy_mid_const_len_overlap(i32 %iptr_dst, i32 %iptr_src) { |
| 96 entry: | 109 entry: |
| 97 %dst = inttoptr i32 %iptr_dst to i8* | 110 %dst = inttoptr i32 %iptr_dst to i8* |
| 98 %src = inttoptr i32 %iptr_src to i8* | 111 %src = inttoptr i32 %iptr_src to i8* |
| 99 call void @llvm.memcpy.p0i8.p0i8.i32(i8* %dst, i8* %src, | 112 call void @llvm.memcpy.p0i8.p0i8.i32(i8* %dst, i8* %src, |
| 100 i32 15, i32 1, i1 false) | 113 i32 15, i32 1, i1 false) |
| 101 ret void | 114 ret void |
| 102 } | 115 } |
| 103 ; CHECK-LABEL: test_memcpy_mid_const_len_overlap | 116 ; CHECK-LABEL: test_memcpy_mid_const_len_overlap |
| 104 ; CHECK: movq [[REG:xmm[0-9]+]],QWORD PTR [{{.*}}] | 117 ; CHECK: movq [[REG:xmm[0-9]+]],QWORD PTR [{{.*}}] |
| 105 ; CHECK-NEXT: movq QWORD PTR [{{.*}}],[[REG]] | 118 ; CHECK-NEXT: movq QWORD PTR [{{.*}}],[[REG]] |
| 106 ; CHECK-NEXT: movq [[REG:xmm[0-9]+]],QWORD PTR [{{.*}}+0x7] | 119 ; CHECK-NEXT: movq [[REG:xmm[0-9]+]],QWORD PTR [{{.*}}+0x7] |
| 107 ; CHECK-NEXT: movq QWORD PTR [{{.*}}+0x7],[[REG]] | 120 ; CHECK-NEXT: movq QWORD PTR [{{.*}}+0x7],[[REG]] |
| 108 ; CHECK-NOT: mov | 121 ; CHECK-NOT: mov |
| 122 ; OM1-LABEL: test_memcpy_mid_const_len_overlap |
| 123 ; OM1: call {{.*}} memcpy |
| 109 ; ARM32-LABEL: test_memcpy_mid_const_len_overlap | 124 ; ARM32-LABEL: test_memcpy_mid_const_len_overlap |
| 110 ; ARM32: bl {{.*}} memcpy | 125 ; ARM32: bl {{.*}} memcpy |
| 111 | 126 |
| 112 define void @test_memcpy_large_const_len_overlap(i32 %iptr_dst, i32 %iptr_src) { | 127 define void @test_memcpy_big_const_len_overlap(i32 %iptr_dst, i32 %iptr_src) { |
| 113 entry: | 128 entry: |
| 114 %dst = inttoptr i32 %iptr_dst to i8* | 129 %dst = inttoptr i32 %iptr_dst to i8* |
| 115 %src = inttoptr i32 %iptr_src to i8* | 130 %src = inttoptr i32 %iptr_src to i8* |
| 116 call void @llvm.memcpy.p0i8.p0i8.i32(i8* %dst, i8* %src, | 131 call void @llvm.memcpy.p0i8.p0i8.i32(i8* %dst, i8* %src, |
| 117 i32 30, i32 1, i1 false) | 132 i32 30, i32 1, i1 false) |
| 118 ret void | 133 ret void |
| 119 } | 134 } |
| 120 ; CHECK-LABEL: test_memcpy_large_const_len_overlap | 135 ; CHECK-LABEL: test_memcpy_big_const_len_overlap |
| 121 ; CHECK: movups [[REG:xmm[0-9]+]],XMMWORD PTR [{{.*}}] | 136 ; CHECK: movups [[REG:xmm[0-9]+]],XMMWORD PTR [{{.*}}] |
| 122 ; CHECK-NEXT: movups XMMWORD PTR [{{.*}}],[[REG]] | 137 ; CHECK-NEXT: movups XMMWORD PTR [{{.*}}],[[REG]] |
| 123 ; CHECK-NEXT: movups [[REG:xmm[0-9]+]],XMMWORD PTR [{{.*}}+0xe] | 138 ; CHECK-NEXT: movups [[REG:xmm[0-9]+]],XMMWORD PTR [{{.*}}+0xe] |
| 124 ; CHECK-NEXT: movups XMMWORD PTR [{{.*}}+0xe],[[REG]] | 139 ; CHECK-NEXT: movups XMMWORD PTR [{{.*}}+0xe],[[REG]] |
| 125 ; CHECK-NOT: mov | 140 ; CHECK-NOT: mov |
| 126 ; ARM32-LABEL: test_memcpy_large_const_len_overlap | 141 ; OM1-LABEL: test_memcpy_big_const_len_overlap |
| 142 ; OM1: call {{.*}} memcpy |
| 143 ; ARM32-LABEL: test_memcpy_big_const_len_overlap |
| 127 ; ARM32: bl {{.*}} memcpy | 144 ; ARM32: bl {{.*}} memcpy |
| 128 | 145 |
| 129 define void @test_memcpy_large_const_len(i32 %iptr_dst, i32 %iptr_src) { | 146 define void @test_memcpy_large_const_len(i32 %iptr_dst, i32 %iptr_src) { |
| 130 entry: | 147 entry: |
| 131 %dst = inttoptr i32 %iptr_dst to i8* | 148 %dst = inttoptr i32 %iptr_dst to i8* |
| 132 %src = inttoptr i32 %iptr_src to i8* | 149 %src = inttoptr i32 %iptr_src to i8* |
| 133 call void @llvm.memcpy.p0i8.p0i8.i32(i8* %dst, i8* %src, | 150 call void @llvm.memcpy.p0i8.p0i8.i32(i8* %dst, i8* %src, |
| 134 i32 33, i32 1, i1 false) | 151 i32 33, i32 1, i1 false) |
| 135 ret void | 152 ret void |
| 136 } | 153 } |
| 137 ; CHECK-LABEL: test_memcpy_large_const_len | 154 ; CHECK-LABEL: test_memcpy_large_const_len |
| 138 ; CHECK: movups [[REG:xmm[0-9]+]],XMMWORD PTR [{{.*}}+0x10] | 155 ; CHECK: movups [[REG:xmm[0-9]+]],XMMWORD PTR [{{.*}}+0x10] |
| 139 ; CHECK-NEXT: movups XMMWORD PTR [{{.*}}+0x10],[[REG]] | 156 ; CHECK-NEXT: movups XMMWORD PTR [{{.*}}+0x10],[[REG]] |
| 140 ; CHECK-NEXT: movups [[REG:xmm[0-9]+]],XMMWORD PTR [{{.*}}] | 157 ; CHECK-NEXT: movups [[REG:xmm[0-9]+]],XMMWORD PTR [{{.*}}] |
| 141 ; CHECK-NEXT: movups XMMWORD PTR [{{.*}}],[[REG]] | 158 ; CHECK-NEXT: movups XMMWORD PTR [{{.*}}],[[REG]] |
| 142 ; CHECK-NEXT: mov [[REG:[^,]*]],BYTE PTR [{{.*}}+0x20] | 159 ; CHECK-NEXT: mov [[REG:[^,]*]],BYTE PTR [{{.*}}+0x20] |
| 143 ; CHECK-NEXT: mov BYTE PTR [{{.*}}+0x20],[[REG]] | 160 ; CHECK-NEXT: mov BYTE PTR [{{.*}}+0x20],[[REG]] |
| 144 ; CHECK-NOT: mov | 161 ; CHECK-NOT: mov |
| 162 ; OM1-LABEL: test_memcpy_large_const_len |
| 163 ; OM1: call {{.*}} memcpy |
| 145 ; ARM32-LABEL: test_memcpy_large_const_len | 164 ; ARM32-LABEL: test_memcpy_large_const_len |
| 146 ; ARM32: bl {{.*}} memcpy | 165 ; ARM32: bl {{.*}} memcpy |
| 147 | 166 |
| 148 ; TODO(jvoung) -- if we want to be clever, we can do memset without a function | |
| 149 ; call similar to memcpy. | |
| 150 define void @test_memmove(i32 %iptr_dst, i32 %iptr_src, i32 %len) { | 167 define void @test_memmove(i32 %iptr_dst, i32 %iptr_src, i32 %len) { |
| 151 entry: | 168 entry: |
| 152 %dst = inttoptr i32 %iptr_dst to i8* | 169 %dst = inttoptr i32 %iptr_dst to i8* |
| 153 %src = inttoptr i32 %iptr_src to i8* | 170 %src = inttoptr i32 %iptr_src to i8* |
| 154 call void @llvm.memmove.p0i8.p0i8.i32(i8* %dst, i8* %src, | 171 call void @llvm.memmove.p0i8.p0i8.i32(i8* %dst, i8* %src, |
| 155 i32 %len, i32 1, i1 false) | 172 i32 %len, i32 1, i1 false) |
| 156 ret void | 173 ret void |
| 157 } | 174 } |
| 158 ; CHECK-LABEL: test_memmove | 175 ; CHECK-LABEL: test_memmove |
| 159 ; CHECK: call {{.*}} R_{{.*}} memmove | 176 ; CHECK: call {{.*}} R_{{.*}} memmove |
| 177 ; OM1-LABEL: test_memmove |
| 178 ; OM1: call {{.*}} memmove |
| 160 ; ARM32-LABEL: test_memmove | 179 ; ARM32-LABEL: test_memmove |
| 161 ; ARM32: bl {{.*}} memmove | 180 ; ARM32: bl {{.*}} memmove |
| 162 | 181 |
| 163 define void @test_memmove_const_len_align(i32 %iptr_dst, i32 %iptr_src) { | 182 define void @test_memmove_long_const_len(i32 %iptr_dst, i32 %iptr_src) { |
| 164 entry: | 183 entry: |
| 165 %dst = inttoptr i32 %iptr_dst to i8* | 184 %dst = inttoptr i32 %iptr_dst to i8* |
| 166 %src = inttoptr i32 %iptr_src to i8* | 185 %src = inttoptr i32 %iptr_src to i8* |
| 167 call void @llvm.memmove.p0i8.p0i8.i32(i8* %dst, i8* %src, | 186 call void @llvm.memmove.p0i8.p0i8.i32(i8* %dst, i8* %src, |
| 168 i32 32, i32 1, i1 false) | 187 i32 4876, i32 1, i1 false) |
| 169 ret void | 188 ret void |
| 170 } | 189 } |
| 171 ; CHECK-LABEL: test_memmove_const_len_align | 190 ; CHECK-LABEL: test_memmove_long_const_len |
| 172 ; CHECK: call {{.*}} R_{{.*}} memmove | 191 ; CHECK: call {{.*}} R_{{.*}} memmove |
| 173 ; ARM32-LABEL: test_memmove_const_len_align | 192 ; OM1-LABEL: test_memmove_long_const_len |
| 193 ; OM1: call {{.*}} memmove |
| 194 ; ARM32-LABEL: test_memmove_long_const_len |
| 195 ; ARM32: bl {{.*}} memmove |
| 196 |
| 197 define void @test_memmove_very_small_const_len(i32 %iptr_dst, i32 %iptr_src) { |
| 198 entry: |
| 199 %dst = inttoptr i32 %iptr_dst to i8* |
| 200 %src = inttoptr i32 %iptr_src to i8* |
| 201 call void @llvm.memmove.p0i8.p0i8.i32(i8* %dst, i8* %src, |
| 202 i32 2, i32 1, i1 false) |
| 203 ret void |
| 204 } |
| 205 ; CHECK-LABEL: test_memmove_very_small_const_len |
| 206 ; CHECK: mov [[REG:[^,]*]],WORD PTR [{{.*}}] |
| 207 ; CHECK-NEXT: mov WORD PTR [{{.*}}],[[REG]] |
| 208 ; CHECK-NOT: mov |
| 209 ; OM1-LABEL: test_memmove_very_small_const_len |
| 210 ; OM1: call {{.*}} memmove |
| 211 ; ARM32-LABEL: test_memmove_very_small_const_len |
| 212 ; ARM32: bl {{.*}} memmove |
| 213 |
| 214 define void @test_memmove_const_len_3(i32 %iptr_dst, i32 %iptr_src) { |
| 215 entry: |
| 216 %dst = inttoptr i32 %iptr_dst to i8* |
| 217 %src = inttoptr i32 %iptr_src to i8* |
| 218 call void @llvm.memmove.p0i8.p0i8.i32(i8* %dst, i8* %src, |
| 219 i32 3, i32 1, i1 false) |
| 220 ret void |
| 221 } |
| 222 ; CHECK-LABEL: test_memmove_const_len_3 |
| 223 ; CHECK: mov [[REG0:[^,]*]],WORD PTR [{{.*}}] |
| 224 ; CHECK-NEXT: mov [[REG1:[^,]*]],BYTE PTR [{{.*}}+0x2] |
| 225 ; CHECK-NEXT: mov WORD PTR [{{.*}}],[[REG0]] |
| 226 ; CHECK-NEXT: mov BYTE PTR [{{.*}}+0x2],[[REG1]] |
| 227 ; CHECK-NOT: mov |
| 228 ; OM1-LABEL: test_memmove_const_len_3 |
| 229 ; OM1: call {{.*}} memmove |
| 230 ; ARM32-LABEL: test_memmove_const_len_3 |
| 231 ; ARM32: bl {{.*}} memmove |
| 232 |
| 233 define void @test_memmove_mid_const_len(i32 %iptr_dst, i32 %iptr_src) { |
| 234 entry: |
| 235 %dst = inttoptr i32 %iptr_dst to i8* |
| 236 %src = inttoptr i32 %iptr_src to i8* |
| 237 call void @llvm.memmove.p0i8.p0i8.i32(i8* %dst, i8* %src, |
| 238 i32 9, i32 1, i1 false) |
| 239 ret void |
| 240 } |
| 241 ; CHECK-LABEL: test_memmove_mid_const_len |
| 242 ; CHECK: movq [[REG0:xmm[0-9]+]],QWORD PTR [{{.*}}] |
| 243 ; CHECK-NEXT: mov [[REG1:[^,]*]],BYTE PTR [{{.*}}+0x8] |
| 244 ; CHECK-NEXT: movq QWORD PTR [{{.*}}],[[REG0]] |
| 245 ; CHECK-NEXT: mov BYTE PTR [{{.*}}+0x8],[[REG1]] |
| 246 ; CHECK-NOT: mov |
| 247 ; OM1-LABEL: test_memmove_mid_const_len |
| 248 ; OM1: call {{.*}} memmove |
| 249 ; ARM32-LABEL: test_memmove_mid_const_len |
| 250 ; ARM32: bl {{.*}} memmove |
| 251 |
| 252 define void @test_memmove_mid_const_len_overlap(i32 %iptr_dst, i32 %iptr_src) { |
| 253 entry: |
| 254 %dst = inttoptr i32 %iptr_dst to i8* |
| 255 %src = inttoptr i32 %iptr_src to i8* |
| 256 call void @llvm.memmove.p0i8.p0i8.i32(i8* %dst, i8* %src, |
| 257 i32 15, i32 1, i1 false) |
| 258 ret void |
| 259 } |
| 260 ; CHECK-LABEL: test_memmove_mid_const_len_overlap |
| 261 ; CHECK: movq [[REG0:xmm[0-9]+]],QWORD PTR [{{.*}}] |
| 262 ; CHECK-NEXT: movq [[REG1:xmm[0-9]+]],QWORD PTR [{{.*}}+0x7] |
| 263 ; CHECK-NEXT: movq QWORD PTR [{{.*}}],[[REG0]] |
| 264 ; CHECK-NEXT: movq QWORD PTR [{{.*}}+0x7],[[REG1]] |
| 265 ; CHECK-NOT: mov |
| 266 ; OM1-LABEL: test_memmove_mid_const_len_overlap |
| 267 ; OM1: call {{.*}} memmove |
| 268 ; ARM32-LABEL: test_memmove_mid_const_len_overlap |
| 269 ; ARM32: bl {{.*}} memmove |
| 270 |
| 271 define void @test_memmove_big_const_len_overlap(i32 %iptr_dst, i32 %iptr_src) { |
| 272 entry: |
| 273 %dst = inttoptr i32 %iptr_dst to i8* |
| 274 %src = inttoptr i32 %iptr_src to i8* |
| 275 call void @llvm.memmove.p0i8.p0i8.i32(i8* %dst, i8* %src, |
| 276 i32 30, i32 1, i1 false) |
| 277 ret void |
| 278 } |
| 279 ; CHECK-LABEL: test_memmove_big_const_len_overlap |
| 280 ; CHECK: movups [[REG0:xmm[0-9]+]],XMMWORD PTR [{{.*}}] |
| 281 ; CHECK-NEXT: movups [[REG1:xmm[0-9]+]],XMMWORD PTR [{{.*}}+0xe] |
| 282 ; CHECK-NEXT: movups XMMWORD PTR [{{.*}}],[[REG0]] |
| 283 ; CHECK-NEXT: movups XMMWORD PTR [{{.*}}+0xe],[[REG1]] |
| 284 ; CHECK-NOT: mov |
| 285 ; OM1-LABEL: test_memmove_big_const_len_overlap |
| 286 ; OM1: call {{.*}} memmove |
| 287 ; ARM32-LABEL: test_memmove_big_const_len_overlap |
| 288 ; ARM32: bl {{.*}} memmove |
| 289 |
| 290 define void @test_memmove_large_const_len(i32 %iptr_dst, i32 %iptr_src) { |
| 291 entry: |
| 292 %dst = inttoptr i32 %iptr_dst to i8* |
| 293 %src = inttoptr i32 %iptr_src to i8* |
| 294 call void @llvm.memmove.p0i8.p0i8.i32(i8* %dst, i8* %src, |
| 295 i32 33, i32 1, i1 false) |
| 296 ret void |
| 297 } |
| 298 ; CHECK-LABEL: test_memmove_large_const_len |
| 299 ; CHECK: movups [[REG0:xmm[0-9]+]],XMMWORD PTR [{{.*}}+0x10] |
| 300 ; CHECK-NEXT: movups [[REG1:xmm[0-9]+]],XMMWORD PTR [{{.*}}] |
| 301 ; CHECK-NEXT: mov [[REG2:[^,]*]],BYTE PTR [{{.*}}+0x20] |
| 302 ; CHECK-NEXT: movups XMMWORD PTR [{{.*}}+0x10],[[REG0]] |
| 303 ; CHECK-NEXT: movups XMMWORD PTR [{{.*}}],[[REG1]] |
| 304 ; CHECK-NEXT: mov BYTE PTR [{{.*}}+0x20],[[REG2]] |
| 305 ; CHECK-NOT: mov |
| 306 ; OM1-LABEL: test_memmove_large_const_len |
| 307 ; OM1: call {{.*}} memmove |
| 308 ; ARM32-LABEL: test_memmove_large_const_len |
| 174 ; ARM32: bl {{.*}} memmove | 309 ; ARM32: bl {{.*}} memmove |
| 175 | 310 |
| 176 define void @test_memset(i32 %iptr_dst, i32 %wide_val, i32 %len) { | 311 define void @test_memset(i32 %iptr_dst, i32 %wide_val, i32 %len) { |
| 177 entry: | 312 entry: |
| 178 %val = trunc i32 %wide_val to i8 | 313 %val = trunc i32 %wide_val to i8 |
| 179 %dst = inttoptr i32 %iptr_dst to i8* | 314 %dst = inttoptr i32 %iptr_dst to i8* |
| 180 call void @llvm.memset.p0i8.i32(i8* %dst, i8 %val, | 315 call void @llvm.memset.p0i8.i32(i8* %dst, i8 %val, |
| 181 i32 %len, i32 1, i1 false) | 316 i32 %len, i32 1, i1 false) |
| 182 ret void | 317 ret void |
| 183 } | 318 } |
| 184 ; CHECK-LABEL: test_memset | 319 ; CHECK-LABEL: test_memset |
| 185 ; CHECK: movzx | 320 ; CHECK: movzx |
| 186 ; CHECK: call {{.*}} R_{{.*}} memset | 321 ; CHECK: call {{.*}} R_{{.*}} memset |
| 322 ; OM1-LABEL: test_memset |
| 323 ; OM1: movzx |
| 324 ; OM1: call {{.*}} R_{{.*}} memset |
| 187 ; ARM32-LABEL: test_memset | 325 ; ARM32-LABEL: test_memset |
| 188 ; ARM32: uxtb | 326 ; ARM32: uxtb |
| 189 ; ARM32: bl {{.*}} memset | 327 ; ARM32: bl {{.*}} memset |
| 190 | 328 |
| 191 define void @test_memset_const_len_align(i32 %iptr_dst, i32 %wide_val) { | 329 define void @test_memset_const_len_align(i32 %iptr_dst, i32 %wide_val) { |
| 192 entry: | 330 entry: |
| 193 %val = trunc i32 %wide_val to i8 | 331 %val = trunc i32 %wide_val to i8 |
| 194 %dst = inttoptr i32 %iptr_dst to i8* | 332 %dst = inttoptr i32 %iptr_dst to i8* |
| 195 call void @llvm.memset.p0i8.i32(i8* %dst, i8 %val, | 333 call void @llvm.memset.p0i8.i32(i8* %dst, i8 %val, |
| 196 i32 32, i32 1, i1 false) | 334 i32 32, i32 1, i1 false) |
| 197 ret void | 335 ret void |
| 198 } | 336 } |
| 199 ; CHECK-LABEL: test_memset_const_len_align | 337 ; CHECK-LABEL: test_memset_const_len_align |
| 200 ; CHECK: movzx | 338 ; CHECK: movzx |
| 201 ; CHECK: call {{.*}} R_{{.*}} memset | 339 ; CHECK: call {{.*}} R_{{.*}} memset |
| 340 ; OM1-LABEL: test_memset_const_len_align |
| 341 ; OM1: movzx |
| 342 ; OM1: call {{.*}} R_{{.*}} memset |
| 202 ; ARM32-LABEL: test_memset_const_len_align | 343 ; ARM32-LABEL: test_memset_const_len_align |
| 203 ; ARM32: uxtb | 344 ; ARM32: uxtb |
| 204 ; ARM32: bl {{.*}} memset | 345 ; ARM32: bl {{.*}} memset |
| 205 | 346 |
| 206 define void @test_memset_long_const_len_zero_val_align(i32 %iptr_dst) { | 347 define void @test_memset_long_const_len_zero_val_align(i32 %iptr_dst) { |
| 207 entry: | 348 entry: |
| 208 %dst = inttoptr i32 %iptr_dst to i8* | 349 %dst = inttoptr i32 %iptr_dst to i8* |
| 209 call void @llvm.memset.p0i8.i32(i8* %dst, i8 0, | 350 call void @llvm.memset.p0i8.i32(i8* %dst, i8 0, |
| 210 i32 4876, i32 1, i1 false) | 351 i32 4876, i32 1, i1 false) |
| 211 ret void | 352 ret void |
| 212 } | 353 } |
| 213 ; CHECK-LABEL: test_memset_long_const_len_zero_val_align | 354 ; CHECK-LABEL: test_memset_long_const_len_zero_val_align |
| 214 ; CHECK: call {{.*}} R_{{.*}} memset | 355 ; CHECK: call {{.*}} R_{{.*}} memset |
| 356 ; OM1-LABEL: test_memset_long_const_len_zero_val_align |
| 357 ; OM1: call {{.*}} R_{{.*}} memset |
| 215 ; ARM32-LABEL: test_memset_long_const_len_zero_val_align | 358 ; ARM32-LABEL: test_memset_long_const_len_zero_val_align |
| 216 ; ARM32: uxtb | 359 ; ARM32: uxtb |
| 217 ; ARM32: bl {{.*}} memset | 360 ; ARM32: bl {{.*}} memset |
| 218 | 361 |
| 219 define void @test_memset_const_val(i32 %iptr_dst, i32 %len) { | 362 define void @test_memset_const_val(i32 %iptr_dst, i32 %len) { |
| 220 entry: | 363 entry: |
| 221 %dst = inttoptr i32 %iptr_dst to i8* | 364 %dst = inttoptr i32 %iptr_dst to i8* |
| 222 call void @llvm.memset.p0i8.i32(i8* %dst, i8 0, i32 %len, i32 1, i1 false) | 365 call void @llvm.memset.p0i8.i32(i8* %dst, i8 0, i32 %len, i32 1, i1 false) |
| 223 ret void | 366 ret void |
| 224 } | 367 } |
| 225 ; CHECK-LABEL: test_memset_const_val | 368 ; CHECK-LABEL: test_memset_const_val |
| 226 ; CHECK-NOT: movzx | 369 ; CHECK-NOT: movzx |
| 227 ; CHECK: call {{.*}} R_{{.*}} memset | 370 ; CHECK: call {{.*}} R_{{.*}} memset |
| 371 ; OM1-LABEL: test_memset_const_val |
| 372 ; OM1: call {{.*}} R_{{.*}} memset |
| 228 ; ARM32-LABEL: test_memset_const_val | 373 ; ARM32-LABEL: test_memset_const_val |
| 229 ; ARM32: uxtb | 374 ; ARM32: uxtb |
| 230 ; ARM32: bl {{.*}} memset | 375 ; ARM32: bl {{.*}} memset |
| 231 | 376 |
| 232 define void @test_memset_const_val_len_very_small(i32 %iptr_dst) { | 377 define void @test_memset_const_val_len_very_small(i32 %iptr_dst) { |
| 233 entry: | 378 entry: |
| 234 %dst = inttoptr i32 %iptr_dst to i8* | 379 %dst = inttoptr i32 %iptr_dst to i8* |
| 235 call void @llvm.memset.p0i8.i32(i8* %dst, i8 10, i32 2, i32 1, i1 false) | 380 call void @llvm.memset.p0i8.i32(i8* %dst, i8 10, i32 2, i32 1, i1 false) |
| 236 ret void | 381 ret void |
| 237 } | 382 } |
| 238 ; CHECK-LABEL: test_memset_const_val_len_very_small | 383 ; CHECK-LABEL: test_memset_const_val_len_very_small |
| 239 ; CHECK: mov WORD PTR [{{.*}}],0xa0a | 384 ; CHECK: mov WORD PTR [{{.*}}],0xa0a |
| 240 ; CHECK-NOT: mov | 385 ; CHECK-NOT: mov |
| 386 ; OM1-LABEL: test_memset_const_val_len_very_small |
| 387 ; OM1: call {{.*}} R_{{.*}} memset |
| 241 ; ARM32-LABEL: test_memset_const_val_len_very_small | 388 ; ARM32-LABEL: test_memset_const_val_len_very_small |
| 242 ; ARM32: uxtb | 389 ; ARM32: uxtb |
| 243 ; ARM32: bl {{.*}} memset | 390 ; ARM32: bl {{.*}} memset |
| 244 | 391 |
| 245 define void @test_memset_const_val_len_3(i32 %iptr_dst) { | 392 define void @test_memset_const_val_len_3(i32 %iptr_dst) { |
| 246 entry: | 393 entry: |
| 247 %dst = inttoptr i32 %iptr_dst to i8* | 394 %dst = inttoptr i32 %iptr_dst to i8* |
| 248 call void @llvm.memset.p0i8.i32(i8* %dst, i8 16, i32 3, i32 1, i1 false) | 395 call void @llvm.memset.p0i8.i32(i8* %dst, i8 16, i32 3, i32 1, i1 false) |
| 249 ret void | 396 ret void |
| 250 } | 397 } |
| 251 ; CHECK-LABEL: test_memset_const_val_len_3 | 398 ; CHECK-LABEL: test_memset_const_val_len_3 |
| 252 ; CHECK: mov WORD PTR [{{.*}}],0x1010 | 399 ; CHECK: mov WORD PTR [{{.*}}],0x1010 |
| 253 ; CHECK-NEXT: mov BYTE PTR [{{.*}}+0x2],0x10 | 400 ; CHECK-NEXT: mov BYTE PTR [{{.*}}+0x2],0x10 |
| 254 ; CHECK-NOT: mov | 401 ; CHECK-NOT: mov |
| 402 ; OM1-LABEL: test_memset_const_val_len_3 |
| 403 ; OM1: call {{.*}} R_{{.*}} memset |
| 255 ; ARM32-LABEL: test_memset_const_val_len_3 | 404 ; ARM32-LABEL: test_memset_const_val_len_3 |
| 256 ; ARM32: uxtb | 405 ; ARM32: uxtb |
| 257 ; ARM32: bl {{.*}} memset | 406 ; ARM32: bl {{.*}} memset |
| 258 | 407 |
| 259 define void @test_memset_const_val_len_mid(i32 %iptr_dst) { | 408 define void @test_memset_const_val_len_mid(i32 %iptr_dst) { |
| 260 entry: | 409 entry: |
| 261 %dst = inttoptr i32 %iptr_dst to i8* | 410 %dst = inttoptr i32 %iptr_dst to i8* |
| 262 call void @llvm.memset.p0i8.i32(i8* %dst, i8 32, i32 9, i32 1, i1 false) | 411 call void @llvm.memset.p0i8.i32(i8* %dst, i8 32, i32 9, i32 1, i1 false) |
| 263 ret void | 412 ret void |
| 264 } | 413 } |
| 265 ; CHECK-LABEL: test_memset_const_val_len_mid | 414 ; CHECK-LABEL: test_memset_const_val_len_mid |
| 266 ; CHECK: mov DWORD PTR [{{.*}}+0x4],0x20202020 | 415 ; CHECK: mov DWORD PTR [{{.*}}+0x4],0x20202020 |
| 267 ; CHECK: mov DWORD PTR [{{.*}}],0x20202020 | 416 ; CHECK: mov DWORD PTR [{{.*}}],0x20202020 |
| 268 ; CHECK-NEXT: mov BYTE PTR [{{.*}}+0x8],0x20 | 417 ; CHECK-NEXT: mov BYTE PTR [{{.*}}+0x8],0x20 |
| 269 ; CHECK-NOT: mov | 418 ; CHECK-NOT: mov |
| 419 ; OM1-LABEL: test_memset_const_val_len_mid |
| 420 ; OM1: call {{.*}} R_{{.*}} memset |
| 270 ; ARM32-LABEL: test_memset_const_val_len_mid | 421 ; ARM32-LABEL: test_memset_const_val_len_mid |
| 271 ; ARM32: uxtb | 422 ; ARM32: uxtb |
| 272 ; ARM32: bl {{.*}} memset | 423 ; ARM32: bl {{.*}} memset |
| 273 | 424 |
| 274 define void @test_memset_zero_const_len_small(i32 %iptr_dst) { | 425 define void @test_memset_zero_const_len_small(i32 %iptr_dst) { |
| 275 entry: | 426 entry: |
| 276 %dst = inttoptr i32 %iptr_dst to i8* | 427 %dst = inttoptr i32 %iptr_dst to i8* |
| 277 call void @llvm.memset.p0i8.i32(i8* %dst, i8 0, i32 12, i32 1, i1 false) | 428 call void @llvm.memset.p0i8.i32(i8* %dst, i8 0, i32 12, i32 1, i1 false) |
| 278 ret void | 429 ret void |
| 279 } | 430 } |
| 280 ; CHECK-LABEL: test_memset_zero_const_len_small | 431 ; CHECK-LABEL: test_memset_zero_const_len_small |
| 281 ; CHECK: pxor [[ZERO:xmm[0-9]+]],[[ZERO]] | 432 ; CHECK: pxor [[ZERO:xmm[0-9]+]],[[ZERO]] |
| 282 ; CHECK-NEXT: movq QWORD PTR [{{.*}}],[[ZERO]] | 433 ; CHECK-NEXT: movq QWORD PTR [{{.*}}],[[ZERO]] |
| 283 ; CHECK-NEXT: mov DWORD PTR [{{.*}}+0x8],0x0 | 434 ; CHECK-NEXT: mov DWORD PTR [{{.*}}+0x8],0x0 |
| 284 ; CHECK-NOT: mov | 435 ; CHECK-NOT: mov |
| 436 ; OM1-LABEL: test_memset_zero_const_len_small |
| 437 ; OM1: call {{.*}} R_{{.*}} memset |
| 285 ; ARM32-LABEL: test_memset_zero_const_len_small | 438 ; ARM32-LABEL: test_memset_zero_const_len_small |
| 286 ; ARM32: uxtb | 439 ; ARM32: uxtb |
| 287 ; ARM32: bl {{.*}} memset | 440 ; ARM32: bl {{.*}} memset |
| 288 | 441 |
| 289 define void @test_memset_zero_const_len_small_overlap(i32 %iptr_dst) { | 442 define void @test_memset_zero_const_len_small_overlap(i32 %iptr_dst) { |
| 290 entry: | 443 entry: |
| 291 %dst = inttoptr i32 %iptr_dst to i8* | 444 %dst = inttoptr i32 %iptr_dst to i8* |
| 292 call void @llvm.memset.p0i8.i32(i8* %dst, i8 0, i32 15, i32 1, i1 false) | 445 call void @llvm.memset.p0i8.i32(i8* %dst, i8 0, i32 15, i32 1, i1 false) |
| 293 ret void | 446 ret void |
| 294 } | 447 } |
| 295 ; CHECK-LABEL: test_memset_zero_const_len_small_overlap | 448 ; CHECK-LABEL: test_memset_zero_const_len_small_overlap |
| 296 ; CHECK: pxor [[ZERO:xmm[0-9]+]],[[ZERO]] | 449 ; CHECK: pxor [[ZERO:xmm[0-9]+]],[[ZERO]] |
| 297 ; CHECK-NEXT: movq QWORD PTR [{{.*}}],[[ZERO]] | 450 ; CHECK-NEXT: movq QWORD PTR [{{.*}}],[[ZERO]] |
| 298 ; CHECK-NEXT: movq QWORD PTR [{{.*}}+0x7],[[ZERO]] | 451 ; CHECK-NEXT: movq QWORD PTR [{{.*}}+0x7],[[ZERO]] |
| 299 ; CHECK-NOT: mov | 452 ; CHECK-NOT: mov |
| 453 ; OM1-LABEL: test_memset_zero_const_len_small_overlap |
| 454 ; OM1: call {{.*}} R_{{.*}} memset |
| 300 ; ARM32-LABEL: test_memset_zero_const_len_small_overlap | 455 ; ARM32-LABEL: test_memset_zero_const_len_small_overlap |
| 301 ; ARM32: uxtb | 456 ; ARM32: uxtb |
| 302 ; ARM32: bl {{.*}} memset | 457 ; ARM32: bl {{.*}} memset |
| 303 | 458 |
| 304 define void @test_memset_zero_const_len_large_overlap(i32 %iptr_dst) { | 459 define void @test_memset_zero_const_len_big_overlap(i32 %iptr_dst) { |
| 305 entry: | 460 entry: |
| 306 %dst = inttoptr i32 %iptr_dst to i8* | 461 %dst = inttoptr i32 %iptr_dst to i8* |
| 307 call void @llvm.memset.p0i8.i32(i8* %dst, i8 0, i32 30, i32 1, i1 false) | 462 call void @llvm.memset.p0i8.i32(i8* %dst, i8 0, i32 30, i32 1, i1 false) |
| 308 ret void | 463 ret void |
| 309 } | 464 } |
| 310 ; CHECK-LABEL: test_memset_zero_const_len_large_overlap | 465 ; CHECK-LABEL: test_memset_zero_const_len_big_overlap |
| 311 ; CHECK: pxor [[ZERO:xmm[0-9]+]],[[ZERO]] | 466 ; CHECK: pxor [[ZERO:xmm[0-9]+]],[[ZERO]] |
| 312 ; CHECK-NEXT: movups XMMWORD PTR [{{.*}}],[[ZERO]] | 467 ; CHECK-NEXT: movups XMMWORD PTR [{{.*}}],[[ZERO]] |
| 313 ; CHECK-NEXT: movups XMMWORD PTR [{{.*}}+0xe],[[ZERO]] | 468 ; CHECK-NEXT: movups XMMWORD PTR [{{.*}}+0xe],[[ZERO]] |
| 314 ; CHECK-NOT: mov | 469 ; CHECK-NOT: mov |
| 315 ; ARM32-LABEL: test_memset_zero_const_len_large_overlap | 470 ; OM1-LABEL: test_memset_zero_const_len_big_overlap |
| 471 ; OM1: call {{.*}} R_{{.*}} memset |
| 472 ; ARM32-LABEL: test_memset_zero_const_len_big_overlap |
| 316 ; ARM32: uxtb | 473 ; ARM32: uxtb |
| 317 ; ARM32: bl {{.*}} memset | 474 ; ARM32: bl {{.*}} memset |
| 318 | 475 |
| 319 define void @test_memset_zero_const_len_large(i32 %iptr_dst) { | 476 define void @test_memset_zero_const_len_large(i32 %iptr_dst) { |
| 320 entry: | 477 entry: |
| 321 %dst = inttoptr i32 %iptr_dst to i8* | 478 %dst = inttoptr i32 %iptr_dst to i8* |
| 322 call void @llvm.memset.p0i8.i32(i8* %dst, i8 0, i32 33, i32 1, i1 false) | 479 call void @llvm.memset.p0i8.i32(i8* %dst, i8 0, i32 33, i32 1, i1 false) |
| 323 ret void | 480 ret void |
| 324 } | 481 } |
| 325 ; CHECK-LABEL: test_memset_zero_const_len_large | 482 ; CHECK-LABEL: test_memset_zero_const_len_large |
| 326 ; CHECK: pxor [[ZERO:xmm[0-9]+]],[[ZERO]] | 483 ; CHECK: pxor [[ZERO:xmm[0-9]+]],[[ZERO]] |
| 327 ; CHECK-NEXT: movups XMMWORD PTR [{{.*}}+0x10],[[ZERO]] | 484 ; CHECK-NEXT: movups XMMWORD PTR [{{.*}}+0x10],[[ZERO]] |
| 328 ; CHECK-NEXT: movups XMMWORD PTR [{{.*}}],[[ZERO]] | 485 ; CHECK-NEXT: movups XMMWORD PTR [{{.*}}],[[ZERO]] |
| 329 ; CHECK-NEXT: mov BYTE PTR [{{.*}}+0x20],0x0 | 486 ; CHECK-NEXT: mov BYTE PTR [{{.*}}+0x20],0x0 |
| 330 ; CHECK-NOT: mov | 487 ; CHECK-NOT: mov |
| 488 ; OM1-LABEL: test_memset_zero_const_len_large |
| 489 ; OM1: call {{.*}} R_{{.*}} memset |
| 331 ; ARM32-LABEL: test_memset_zero_const_len_large | 490 ; ARM32-LABEL: test_memset_zero_const_len_large |
| 332 ; ARM32: uxtb | 491 ; ARM32: uxtb |
| 333 ; ARM32: bl {{.*}} memset | 492 ; ARM32: bl {{.*}} memset |
| OLD | NEW |