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

Reformat xlang-ir to use a new basic block design #13

Merged
merged 74 commits into from
Aug 9, 2024

Conversation

chorman0773
Copy link
Contributor

XLang IR Changes:

  • Targets are removed, replaced with basic blocks, which contain a list of expressions followed by exactly one terminator
    • Basic Block entries still have an incoming stack
  • Removed expressions that diverge in favour of terminators for basic blocks
    • Removed call, tailcall, exit, asm, branch, branch indirect, and switch expressions
  • Added terminators for basic blocks:
    • Added call and tailcall terminators. In addition to the old syntax, the call terminator accepts a jump-info (target + optional flags) for a "next" block to jump to after the call finishes. tailcall omits next, call requires it.
    • Added exit terminator
    • Added jump terminator which takes a jump-info, and is used for unconditional jumps
    • Added a branch terminator for conditional branches. These take two jump-infos, one when the condition is satisfied, and one when it is not. never and always continue to exist, and act like jumps to the respective targets, but also typecheck the untaken branch.
    • Added jump indirect for indirect jumps.
    • Added asm terminator, which additionally takes a next jump-info to continue to unless the block is noreturn.
    • Added switch terminator.
    • Added new unreachable terminator, which should be favoured over const undef invalid T; exit 1. const undef invalid can still be used when a value is statically needed by the code generator.

Also changed the structure of xlang-backend to handle the new input correctly.

chorman0773 and others added 30 commits January 27, 2024 02:51
feat(xlang-backend): Add support for head values for `make_jump`
@rdrpenguin04
Copy link
Contributor

I'll just approve this

@rdrpenguin04 rdrpenguin04 merged commit 9334641 into main Aug 9, 2024
2 of 4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants