Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update dialect to be able to roundtrip alloca, load and store #2

Open
wants to merge 1 commit into
base: mlir-18
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 11 additions & 7 deletions include/JLM/JLMOps.td
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@ def JLM_Load: JLM_Op<"load", []> {
}];

let arguments = (ins
LLVM_AnyPointer:$pointer,
RVSDG_Pointer:$pointer,
UI32Attr:$alignment,
Variadic<RVSDG_MemState>:$inputMemStates
);

Expand All @@ -37,8 +38,9 @@ def JLM_Store: JLM_Op<"store"> {
}];

let arguments = (ins
LLVM_AnyPointer:$pointer,
RVSDG_Pointer:$pointer,
AnyType:$value,
UI32Attr:$alignment,
Variadic<RVSDG_MemState>:$inputMemStates
);

Expand All @@ -57,16 +59,18 @@ def JLM_Alloca: JLM_Op<"alloca"> {
}];

let arguments = (ins
TypeAttr:$typeAttr,
TypeAttr:$valueType,
AnySignlessInteger:$size,
UI32Attr:$alignment,
Variadic<RVSDG_MemState>:$inputMemStates
);

let results = (outs
AnyTypeOf<[RVSDG_Pointer, LLVMPointerType]>:$output,
RVSDG_Pointer:$output,
RVSDG_MemState:$outputMemState
);

let assemblyFormat = "attr-dict $typeAttr `(` $inputMemStates `)` `->` type($output) `,` type($outputMemState)";
// let assemblyFormat = "attr-dict $size, $alignment `(` $inputMemStates `)` `->` type($output) `,` type($outputMemState)";
let hasVerifier = 1;
}

Expand All @@ -78,8 +82,8 @@ def JLM_Memcpy: JLM_Op<"memcpy"> {
}];

let arguments = (ins
LLVM_AnyPointer:$dst,
LLVM_AnyPointer:$src,
RVSDG_Pointer:$dst,
RVSDG_Pointer:$src,
AnySignlessInteger:$len,
AnyTypeOf<[I1, RVSDG_Ctrl<2>]>: $isVolatile,
Variadic<RVSDG_MemState>:$inputMemStates
Expand Down