Skip to content

Commit 459b541

Browse files
author
chenqian
committed
[Test] memcpy src 16|8 align dst 16|8 align variable size
1 parent 0aeeb30 commit 459b541

File tree

1 file changed

+55
-0
lines changed

1 file changed

+55
-0
lines changed
Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --version 5
2+
; RUN: opt -S -mtriple=riscv32-esp-unknown-elf < %s | FileCheck %s --check-prefix=NOPASS
3+
target datalayout = "e-m:e-p:32:32-i64:64-n32-S128"
4+
target triple = "riscv32-esp-unknown-elf"
5+
6+
define void @test_src16_dst16_variable_size(ptr %a, ptr %b, i32 %size) {
7+
; NOPASS-LABEL: define void @test_src16_dst16_variable_size(
8+
; NOPASS-SAME: ptr [[A:%.*]], ptr [[B:%.*]], i32 [[SIZE:%.*]]) {
9+
; NOPASS-NEXT: [[ENTRY:.*:]]
10+
; NOPASS-NEXT: tail call void @llvm.memcpy.p0.p0.i32(ptr noundef nonnull align 16 [[A]], ptr noundef nonnull align 16 [[B]], i32 [[SIZE]], i1 false)
11+
; NOPASS-NEXT: ret void
12+
;
13+
entry:
14+
tail call void @llvm.memcpy.p0.p0.i32(ptr noundef nonnull align 16 %a, ptr noundef nonnull align 16 %b, i32 %size, i1 false)
15+
ret void
16+
}
17+
18+
define void @test_src16_dst8_variable_size(ptr %a, ptr %b, i32 %size) {
19+
; NOPASS-LABEL: define void @test_src16_dst8_variable_size(
20+
; NOPASS-SAME: ptr [[A:%.*]], ptr [[B:%.*]], i32 [[SIZE:%.*]]) {
21+
; NOPASS-NEXT: [[ENTRY:.*:]]
22+
; NOPASS-NEXT: tail call void @llvm.memcpy.p0.p0.i32(ptr noundef nonnull align 8 [[A]], ptr noundef nonnull align 16 [[B]], i32 [[SIZE]], i1 false)
23+
; NOPASS-NEXT: ret void
24+
;
25+
entry:
26+
tail call void @llvm.memcpy.p0.p0.i32(ptr noundef nonnull align 8 %a, ptr noundef nonnull align 16 %b, i32 %size, i1 false)
27+
ret void
28+
}
29+
30+
define void @test_src8_dst16_variable_size(ptr %a, ptr %b, i32 %size) {
31+
; NOPASS-LABEL: define void @test_src8_dst16_variable_size(
32+
; NOPASS-SAME: ptr [[A:%.*]], ptr [[B:%.*]], i32 [[SIZE:%.*]]) {
33+
; NOPASS-NEXT: [[ENTRY:.*:]]
34+
; NOPASS-NEXT: tail call void @llvm.memcpy.p0.p0.i32(ptr noundef nonnull align 16 [[A]], ptr noundef nonnull align 8 [[B]], i32 [[SIZE]], i1 false)
35+
; NOPASS-NEXT: ret void
36+
;
37+
entry:
38+
tail call void @llvm.memcpy.p0.p0.i32(ptr noundef nonnull align 16 %a, ptr noundef nonnull align 8 %b, i32 %size, i1 false)
39+
ret void
40+
}
41+
42+
define void @test_src8_dst8_variable_size(ptr %a, ptr %b, i32 %size) {
43+
; NOPASS-LABEL: define void @test_src8_dst8_variable_size(
44+
; NOPASS-SAME: ptr [[A:%.*]], ptr [[B:%.*]], i32 [[SIZE:%.*]]) {
45+
; NOPASS-NEXT: [[ENTRY:.*:]]
46+
; NOPASS-NEXT: tail call void @llvm.memcpy.p0.p0.i32(ptr noundef nonnull align 8 [[A]], ptr noundef nonnull align 8 [[B]], i32 [[SIZE]], i1 false)
47+
; NOPASS-NEXT: ret void
48+
;
49+
entry:
50+
tail call void @llvm.memcpy.p0.p0.i32(ptr noundef nonnull align 8 %a, ptr noundef nonnull align 8 %b, i32 %size, i1 false)
51+
ret void
52+
}
53+
54+
declare void @llvm.memcpy.p0.p0.i32(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i32, i1 immarg)
55+

0 commit comments

Comments
 (0)