Kazushi (Jam) Marukawa 5e273b845b [VE] Support STACKSAVE and STACKRESTORE
Change to use default expanded code.  Add regression tests also.

Reviewed By: simoll

Differential Revision: https://reviews.llvm.org/D93539
2020-12-21 20:15:50 +09:00

27 lines
679 B
LLVM

; RUN: llc < %s -mtriple=ve | FileCheck %s
; Function Attrs: noinline nounwind optnone
define i8* @stacksave() {
; CHECK-LABEL: stacksave:
; CHECK: .LBB{{[0-9]+}}_2:
; CHECK-NEXT: or %s0, 0, %s11
; CHECK-NEXT: or %s11, 0, %s9
%ret = call i8* @llvm.stacksave()
ret i8* %ret
}
; Function Attrs: noinline nounwind optnone
define void @stackrestore(i8* %ptr) {
; CHECK-LABEL: stackrestore:
; CHECK: .LBB{{[0-9]+}}_2:
; CHECK-NEXT: or %s11, 0, %s0
; CHECK-NEXT: or %s11, 0, %s9
call void @llvm.stackrestore(i8* %ptr)
ret void
}
; Function Attrs: nounwind
declare i8* @llvm.stacksave()
; Function Attrs: nounwind
declare void @llvm.stackrestore(i8*)