66 lines
2.3 KiB
LLVM
66 lines
2.3 KiB
LLVM
; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
|
|
; RUN: llc --mtriple=loongarch32 --verify-machineinstrs < %s \
|
|
; RUN: | FileCheck --check-prefix=LA32 %s
|
|
; RUN: llc --mtriple=loongarch64 --verify-machineinstrs < %s \
|
|
; RUN: | FileCheck --check-prefix=LA64 %s
|
|
|
|
define void @merge_load_store(ptr noalias %src, ptr noalias %dst) unnamed_addr {
|
|
; LA32-LABEL: merge_load_store:
|
|
; LA32: # %bb.0: # %start
|
|
; LA32-NEXT: ld.b $a2, $a0, 0
|
|
; LA32-NEXT: ld.b $a3, $a0, 1
|
|
; LA32-NEXT: ld.b $a4, $a0, 2
|
|
; LA32-NEXT: ld.b $a5, $a0, 3
|
|
; LA32-NEXT: st.b $a2, $a1, 0
|
|
; LA32-NEXT: st.b $a3, $a1, 1
|
|
; LA32-NEXT: st.b $a4, $a1, 2
|
|
; LA32-NEXT: st.b $a5, $a1, 3
|
|
; LA32-NEXT: ld.b $a2, $a0, 4
|
|
; LA32-NEXT: ld.b $a3, $a0, 5
|
|
; LA32-NEXT: ld.b $a4, $a0, 6
|
|
; LA32-NEXT: ld.b $a0, $a0, 7
|
|
; LA32-NEXT: st.b $a2, $a1, 4
|
|
; LA32-NEXT: st.b $a3, $a1, 5
|
|
; LA32-NEXT: st.b $a4, $a1, 6
|
|
; LA32-NEXT: st.b $a0, $a1, 7
|
|
; LA32-NEXT: ret
|
|
;
|
|
; LA64-LABEL: merge_load_store:
|
|
; LA64: # %bb.0: # %start
|
|
; LA64-NEXT: ld.d $a0, $a0, 0
|
|
; LA64-NEXT: st.d $a0, $a1, 0
|
|
; LA64-NEXT: ret
|
|
start:
|
|
%_3 = load i8, ptr %src, align 1
|
|
store i8 %_3, ptr %dst, align 1
|
|
%0 = getelementptr inbounds i8, ptr %src, i64 1
|
|
%_4 = load i8, ptr %0, align 1
|
|
%1 = getelementptr inbounds i8, ptr %dst, i64 1
|
|
store i8 %_4, ptr %1, align 1
|
|
%2 = getelementptr inbounds i8, ptr %src, i64 2
|
|
%_5 = load i8, ptr %2, align 1
|
|
%3 = getelementptr inbounds i8, ptr %dst, i64 2
|
|
store i8 %_5, ptr %3, align 1
|
|
%4 = getelementptr inbounds i8, ptr %src, i64 3
|
|
%_6 = load i8, ptr %4, align 1
|
|
%5 = getelementptr inbounds i8, ptr %dst, i64 3
|
|
store i8 %_6, ptr %5, align 1
|
|
%6 = getelementptr inbounds i8, ptr %src, i64 4
|
|
%_7 = load i8, ptr %6, align 1
|
|
%7 = getelementptr inbounds i8, ptr %dst, i64 4
|
|
store i8 %_7, ptr %7, align 1
|
|
%8 = getelementptr inbounds i8, ptr %src, i64 5
|
|
%_8 = load i8, ptr %8, align 1
|
|
%9 = getelementptr inbounds i8, ptr %dst, i64 5
|
|
store i8 %_8, ptr %9, align 1
|
|
%10 = getelementptr inbounds i8, ptr %src, i64 6
|
|
%_9 = load i8, ptr %10, align 1
|
|
%11 = getelementptr inbounds i8, ptr %dst, i64 6
|
|
store i8 %_9, ptr %11, align 1
|
|
%12 = getelementptr inbounds i8, ptr %src, i64 7
|
|
%_10 = load i8, ptr %12, align 1
|
|
%13 = getelementptr inbounds i8, ptr %dst, i64 7
|
|
store i8 %_10, ptr %13, align 1
|
|
ret void
|
|
}
|