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

IR Verifier #11

Open
2 of 7 tasks
julian-hartl opened this issue Mar 23, 2024 · 0 comments · May be fixed by #13
Open
2 of 7 tasks

IR Verifier #11

julian-hartl opened this issue Mar 23, 2024 · 0 comments · May be fixed by #13
Assignees
Milestone

Comments

@julian-hartl
Copy link
Owner

julian-hartl commented Mar 23, 2024

Implement verifier for higher level intermediate representation in codegen ir

Motivation

We want to introduce a pass on the higher level ir of the natrix codegen backend, that validates the semantical correctness of the program. We hope that this will

  1. Improve the developer experience as the compiler itself will tell you about an error in the ir and you don't have to figure it out yourself
  2. make finding bugs easier. E.g., by running the verifier after each optimization pass, we can validate that the optimization did not leave the program in an undefined state
  3. decrease the amount of work a language frontend has to do by itself by providing additional warnings (e.g. for unreachable code, ...) and coupling them with their original source code location

Definition of done

  • Check for use before def
  • Check for semantically correct types in instructions
  • Check for missing terminator
  • Check branch args
  • Report with source code location
  • Add warnings (like unreachable code)
  • Check entry basic block exists
@julian-hartl julian-hartl modified the milestones: Nicer public api for intermediate representation, Alpha Mar 23, 2024
@julian-hartl julian-hartl self-assigned this Mar 24, 2024
@julian-hartl julian-hartl linked a pull request Mar 24, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant