babylon icon indicating copy to clipboard operation
babylon copied to clipboard

Lower SwitchExpressionOp

Open mabbay opened this issue 1 year ago • 6 comments

Lowering of SwitchExpressionOp


Progress

  • [ ] Change must not contain extraneous whitespace

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 avatar Apr 03 '24 23:04 mabbay

:wave: 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.

bridgekeeper[bot] avatar Apr 03 '24 23:04 bridgekeeper[bot]

@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:

  • 0cafc73c9556e7d6269f85bf43dd3610d99228b5: Bytecode round 6 - lifting lambdas
  • ba4e9a15de5f598c934d300d6314b999153af888: Add support for enclosing class types
  • 7c838871c8ceca9dcd1486b5be68cd54856b0bc4: Converting healing brush to use HAT also offered a headless variant f…
  • 6b6ef00e4bb2bb92df408dfa07f84a3619807308: fix std::string to char * for kernel names
  • a3bd91f1c84726df5c024a2976aba3d2a30e3feb: cuda fixes for violajones
  • 23471fb4b7bc38d161f6f9babf2496ae6bfdf1b7: Fixed up ptx backend (native) so that PTX work can begin
  • a8e16a75e629f2620d05318baa16b9739618575d: Found CUDA issue. This is the fix part1
  • 75cd5868e7b7b574cc4036991438f18f3de86976: added 16 byte alignment of buffers and tail markers to help detect ar…
  • e78c408a0765f21fd39c01c7e60f5abfcdbe1cad: 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[bot] avatar Apr 03 '24 23:04 openjdk[bot]

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.

asotona avatar Apr 05 '24 08:04 asotona

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.

PaulSandoz avatar Apr 05 '24 21:04 PaulSandoz

@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[bot] avatar May 21 '24 17:05 openjdk[bot]

/integrate

mabbay avatar Jun 03 '24 17:06 mabbay

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

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

Your commit was automatically rebased without conflicts.

openjdk[bot] avatar Jun 03 '24 17:06 openjdk[bot]

@mabbay Pushed as commit deebe32acf20eaf2679b811b7caafa7b71704d26.

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

openjdk[bot] avatar Jun 03 '24 17:06 openjdk[bot]