Skip to content

Commit

Permalink
cleanup and rebase fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
eymay committed May 18, 2023
1 parent 7c36897 commit b8ba98e
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 14 deletions.
9 changes: 0 additions & 9 deletions xdsl/dialects/riscv.py
Original file line number Diff line number Diff line change
Expand Up @@ -1064,15 +1064,6 @@ class JalOp(RdImmJumpOperation):

name = "riscv.jal"

def __init__(
self,
immediate: int | AnyIntegerAttr | str | LabelAttr,
*,
rd: RegisterType | Register | None = None,
comment: str | StringAttr | None = None,
):
super().__init__(immediate, rd=rd)


@irdl_op_definition
class JOp(RdImmJumpOperation):
Expand Down
7 changes: 2 additions & 5 deletions xdsl/dialects/riscv_func.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,6 @@ class SyscallOp(IRDLOperation):
args: Annotated[VarOperand, riscv.RegisterType]
syscall_num: OpAttr[IntegerAttr[IntegerType]]
result: Annotated[OptOpResult, riscv.RegisterType]
"""
Some syscalls return values by putting them into a0. If result is not None, then the
contents of a0 will be moved to its register.
"""

def __init__(
self,
Expand Down Expand Up @@ -139,8 +135,9 @@ def __init__(
)


RISCV_FUNC = Dialect(
RISCV_Func = Dialect(
[
SyscallOp,
CallOp,
FuncOp,
ReturnOp,
Expand Down
1 change: 1 addition & 0 deletions xdsl/transforms/lower_riscv_func.py
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,7 @@ class LowerRISCVFunc(ModulePass):
name = "lower-riscv-func"

def apply(self, ctx: MLContext, op: ModuleOp) -> None:
PatternRewriteWalker(LowerSyscallOp()).rewrite_module(op)
PatternRewriteWalker(LowerRISCVFuncReturnOp()).rewrite_module(op)
PatternRewriteWalker(LowerRISCVFuncOp()).rewrite_module(op)
PatternRewriteWalker(LowerRISCVCallOp()).rewrite_module(op)

0 comments on commit b8ba98e

Please sign in to comment.