mirror of
https://github.com/capstone-engine/llvm-capstone.git
synced 2024-11-26 15:11:00 +00:00
[mlir] Add stacksave, stackrestore to llvm dialect
Reviewed By: ftynse Differential Revision: https://reviews.llvm.org/D96333
This commit is contained in:
parent
98146c1f5d
commit
fa581f9438
@ -1277,6 +1277,19 @@ def LLVM_CoroResumeOp : LLVM_IntrOp<"coro.resume", [], [], [], 0> {
|
||||
let assemblyFormat = "$handle attr-dict";
|
||||
}
|
||||
|
||||
//
|
||||
// Stack save/restore intrinsics.
|
||||
//
|
||||
|
||||
def LLVM_StackSaveOp : LLVM_OneResultIntrOp<"stacksave"> {
|
||||
let assemblyFormat = "attr-dict `:` type($res)";
|
||||
}
|
||||
|
||||
def LLVM_StackRestoreOp : LLVM_ZeroResultIntrOp<"stackrestore"> {
|
||||
let arguments = (ins LLVM_i8Ptr:$ptr);
|
||||
let assemblyFormat = "$ptr attr-dict";
|
||||
}
|
||||
|
||||
//
|
||||
// Vector Reductions.
|
||||
//
|
||||
|
@ -405,6 +405,20 @@ llvm.func @coro_resume(%arg0: !llvm.ptr<i8>) {
|
||||
llvm.return
|
||||
}
|
||||
|
||||
// CHECK-LABEL: @stack_save
|
||||
llvm.func @stack_save() {
|
||||
// CHECK: call i8* @llvm.stacksave
|
||||
%0 = llvm.intr.stacksave : !llvm.ptr<i8>
|
||||
llvm.return
|
||||
}
|
||||
|
||||
// CHECK-LABEL: @stack_restore
|
||||
llvm.func @stack_restore(%arg0: !llvm.ptr<i8>) {
|
||||
// CHECK: call void @llvm.stackrestore
|
||||
llvm.intr.stackrestore %arg0
|
||||
llvm.return
|
||||
}
|
||||
|
||||
// Check that intrinsics are declared with appropriate types.
|
||||
// CHECK-DAG: declare float @llvm.fma.f32(float, float, float)
|
||||
// CHECK-DAG: declare <8 x float> @llvm.fma.v8f32(<8 x float>, <8 x float>, <8 x float>) #0
|
||||
|
Loading…
Reference in New Issue
Block a user