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

Lower SwitchExpressionOp #45

Closed
wants to merge 14 commits into from

Conversation

mabbay
Copy link
Member

@mabbay mabbay commented Apr 3, 2024

Lowering of SwitchExpressionOp


Progress

  • Change must not contain extraneous whitespace

Reviewers

Reviewing

Using git

Checkout this PR locally:
$ git fetch https://git.openjdk.org/babylon.git pull/45/head:pull/45
$ git checkout pull/45

Update a local copy of the PR:
$ git checkout pull/45
$ git pull https://git.openjdk.org/babylon.git pull/45/head

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 45

View PR using the GUI difftool:
$ git pr show -t 45

Using diff file

Download this PR as a diff file:
https://git.openjdk.org/babylon/pull/45.diff

Webrev

Link to Webrev Comment

@mabbay mabbay self-assigned this Apr 3, 2024
@bridgekeeper
Copy link

bridgekeeper bot commented Apr 3, 2024

👋 Welcome back mabbay! A progress list of the required criteria for merging this PR into code-reflection will be added to the body of your pull request. There are additional pull request commands available for use with this pull request.

@openjdk
Copy link

openjdk bot commented Apr 3, 2024

@mabbay This change now passes all automated pre-integration checks.

ℹ️ This project also has non-automated pre-integration requirements. Please see the file CONTRIBUTING.md for details.

After integration, the commit message for the final commit will be:

Lower SwitchExpressionOp

Reviewed-by: psandoz

You can use pull request commands such as /summary, /contributor and /issue to adjust it as needed.

At the time when this comment was updated there had been 9 new commits pushed to the code-reflection branch:

  • 0cafc73: Bytecode round 6 - lifting lambdas
  • ba4e9a1: Add support for enclosing class types
  • 7c83887: Converting healing brush to use HAT also offered a headless variant f…
  • 6b6ef00: fix std::string to char * for kernel names
  • a3bd91f: cuda fixes for violajones
  • 23471fb: Fixed up ptx backend (native) so that PTX work can begin
  • a8e16a7: Found CUDA issue. This is the fix part1
  • 75cd586: added 16 byte alignment of buffers and tail markers to help detect ar…
  • e78c408: Updated code for dumping schema (debugging cuda violajones)

Please see this link for an up-to-date comparison between the source branch of this pull request and the code-reflection branch.
As there are no conflicts, your changes will automatically be rebased on top of these commits when integrating. If you prefer to avoid this automatic rebasing, please check the documentation for the /integrate command for further details.

➡️ To integrate this PR with the above commit message to the code-reflection branch, type /integrate in a new comment.

@openjdk openjdk bot added ready Pull request is ready to be integrated rfr Pull request is ready for review labels Apr 4, 2024
@mlbridge
Copy link

mlbridge bot commented Apr 4, 2024

Webrevs

@asotona
Copy link
Member

asotona commented Apr 5, 2024

How do we distinguish (lowering of) complex switch expressions from basic tableswitch and lookupswitch?
I think it is not intended to always explode every tableswitch and lookupswitch into conditional blocks.

Copy link
Member

@PaulSandoz PaulSandoz left a comment

Choose a reason for hiding this comment

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

That looks a good start. Also add a test case for a switch expression with case statement that falls through to the next case statement. (See constantCaseLabelFallthrough in SwitchExpressionTest).

Also, what if the switch target is null?

@PaulSandoz
Copy link
Member

How do we distinguish (lowering of) complex switch expressions from basic tableswitch and lookupswitch? I think it is not intended to always explode every tableswitch and lookupswitch into conditional blocks.

Do you mean generating bytecode similar to what javac would? If so in this case the lowering should always produce ops in the core dialect, from which we can generate bytecode (program behavior preserved), but not of the same quality as javac. To do the latter we will need a more nuanced approach to generating bytecode, where some ops are lowered to core ops and some are not and are directly operated on by the bytecode generator. I don't know if the current modeling of switch is sufficient for generating equivalent bytecode. I suspect it will take a few rounds of modeling to get it right.

@openjdk
Copy link

openjdk bot commented May 21, 2024

@mabbay this pull request can not be integrated into code-reflection due to one or more merge conflicts. To resolve these merge conflicts and update this pull request you can run the following commands in the local repository for your personal fork:

git checkout lower-switch-expr
git fetch https://git.openjdk.org/babylon.git code-reflection
git merge FETCH_HEAD
# resolve conflicts and follow the instructions given by git merge
git commit -m "Merge code-reflection"
git push

@openjdk openjdk bot added merge-conflict Pull request has merge conflict with target branch and removed ready Pull request is ready to be integrated rfr Pull request is ready for review labels May 21, 2024
@openjdk openjdk bot added ready Pull request is ready to be integrated rfr Pull request is ready for review and removed merge-conflict Pull request has merge conflict with target branch labels May 29, 2024
Copy link
Member

@PaulSandoz PaulSandoz 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 good. Just some minor code changes. Subsequent PRs can add more test cases.

@mabbay
Copy link
Member Author

mabbay commented Jun 3, 2024

/integrate

@openjdk
Copy link

openjdk bot commented Jun 3, 2024

Going to push as commit deebe32.
Since your change was applied there have been 9 commits pushed to the code-reflection branch:

  • 0cafc73: Bytecode round 6 - lifting lambdas
  • ba4e9a1: Add support for enclosing class types
  • 7c83887: Converting healing brush to use HAT also offered a headless variant f…
  • 6b6ef00: fix std::string to char * for kernel names
  • a3bd91f: cuda fixes for violajones
  • 23471fb: Fixed up ptx backend (native) so that PTX work can begin
  • a8e16a7: Found CUDA issue. This is the fix part1
  • 75cd586: added 16 byte alignment of buffers and tail markers to help detect ar…
  • e78c408: Updated code for dumping schema (debugging cuda violajones)

Your commit was automatically rebased without conflicts.

@openjdk openjdk bot added the integrated Pull request has been integrated label Jun 3, 2024
@openjdk openjdk bot closed this Jun 3, 2024
@openjdk openjdk bot removed ready Pull request is ready to be integrated rfr Pull request is ready for review labels Jun 3, 2024
@openjdk
Copy link

openjdk bot commented Jun 3, 2024

@mabbay Pushed as commit deebe32.

💡 You may see a message that your pull request was closed with unmerged commits. This can be safely ignored.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
integrated Pull request has been integrated
3 participants