[PATCH] D93539: [VE] Support STACKSAVE and STACKRESTORE
Kazushi Marukawa via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Mon Dec 21 03:16:12 PST 2020
This revision was landed with ongoing or failed builds.
This revision was automatically updated to reflect the committed changes.
Closed by commit rG5e273b845bc4: [VE] Support STACKSAVE and STACKRESTORE (authored by kaz7).
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D93539/new/
https://reviews.llvm.org/D93539
Files:
llvm/lib/Target/VE/VEISelLowering.cpp
llvm/test/CodeGen/VE/Scalar/stacksave.ll
Index: llvm/test/CodeGen/VE/Scalar/stacksave.ll
===================================================================
--- /dev/null
+++ 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*)
Index: llvm/lib/Target/VE/VEISelLowering.cpp
===================================================================
--- llvm/lib/Target/VE/VEISelLowering.cpp
+++ llvm/lib/Target/VE/VEISelLowering.cpp
@@ -135,6 +135,10 @@
/// 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 {
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D93539.313065.patch
Type: text/x-patch
Size: 1456 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20201221/ff048d7f/attachment.bin>
More information about the llvm-commits
mailing list