Author: Kazushi (Jam) Marukawa Date: 2020-12-21T20:15:50+09:00 New Revision: 5e273b845bc4411c23f5da0ebbf5d4dfd6b91f13
URL: https://github.com/llvm/llvm-project/commit/5e273b845bc4411c23f5da0ebbf5d4dfd6b91f13 DIFF: https://github.com/llvm/llvm-project/commit/5e273b845bc4411c23f5da0ebbf5d4dfd6b91f13.diff LOG: [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 Added: llvm/test/CodeGen/VE/Scalar/stacksave.ll Modified: llvm/lib/Target/VE/VEISelLowering.cpp Removed: ################################################################################ diff --git a/llvm/lib/Target/VE/VEISelLowering.cpp b/llvm/lib/Target/VE/VEISelLowering.cpp index da5b6422f53d..ea9281a00502 100644 --- a/llvm/lib/Target/VE/VEISelLowering.cpp +++ b/llvm/lib/Target/VE/VEISelLowering.cpp @@ -135,6 +135,10 @@ void VETargetLowering::initSPUActions() { /// Stack { setOperationAction(ISD::DYNAMIC_STACKALLOC, MVT::i32, Custom); setOperationAction(ISD::DYNAMIC_STACKALLOC, MVT::i64, Custom); + + // Use the default implementation. + setOperationAction(ISD::STACKSAVE, MVT::Other, Expand); + setOperationAction(ISD::STACKRESTORE, MVT::Other, Expand); /// } Stack /// Branch { diff --git a/llvm/test/CodeGen/VE/Scalar/stacksave.ll b/llvm/test/CodeGen/VE/Scalar/stacksave.ll new file mode 100644 index 000000000000..336f9b83455f --- /dev/null +++ b/llvm/test/CodeGen/VE/Scalar/stacksave.ll @@ -0,0 +1,26 @@ +; 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*) _______________________________________________ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits