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

Llir Builder for HKMC2 #261

Merged
merged 24 commits into from
Jan 16, 2025
Merged

Llir Builder for HKMC2 #261

merged 24 commits into from
Jan 16, 2025

Conversation

waterlens
Copy link
Member

No description provided.

@LPTK LPTK mentioned this pull request Jan 10, 2025
@waterlens waterlens marked this pull request as ready for review January 14, 2025 06:24
@waterlens waterlens requested a review from LPTK January 14, 2025 06:25
@LPTK
Copy link
Contributor

LPTK commented Jan 16, 2025

It looks like the CI failed for the same reason as in #257 (comment)

Copy link
Contributor

@LPTK LPTK left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks mostly good, but I found some worrying cases. Sometimes the LLIR generates references to parameter names from outside the join point:

:sllir
:scpp
let x = 10
if true do
  set x += 1
x
//│ = 11
//│ x = 11
//│ LLIR:
//│   
//│   def j$0(x$2) =
//│     x$2
//│   let x$0 = 10 in
//│   let x$1 = true in
//│   case x$1 of
//│     BoolLit(true) =>
//│       let x$3 = +(x$2,1) in
//│       let x$4 = undefined in
//│       jump j$0(x$3)
//│     _ =>
//│       let x$5 = undefined in
//│       jump j$0(x$2)

If you don't want to support mutation, it's fine, but then you should cleanly abort compilation.

But the fact that it generates a reference to a parameter that's not in scope also hints at a deeper logic problem in the IR builder, which should probably be fixed as well.

Copy link
Contributor

@LPTK LPTK left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@LPTK LPTK merged commit dedfc2d into hkust-taco:hkmc2 Jan 16, 2025
1 check passed
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 this pull request may close these issues.

2 participants