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

Convert getinstancevariable to new backend IR #352

Merged
merged 9 commits into from Aug 4, 2022

Conversation

k0kubun
Copy link
Member

@k0kubun k0kubun commented Aug 2, 2022

I merged Maxime's register allocator fix to @noahgibbs's branch and addressed another panic in Opnd::mem.

@k0kubun k0kubun marked this pull request as ready for review August 2, 2022 21:04
yjit/src/backend/ir.rs Outdated Show resolved Hide resolved
yjit/src/backend/tests.rs Outdated Show resolved Hide resolved
yjit/src/codegen.rs Outdated Show resolved Hide resolved
yjit/src/codegen.rs Outdated Show resolved Hide resolved
yjit/src/codegen.rs Outdated Show resolved Hide resolved
Copy link

@maximecb maximecb left a comment

Choose a reason for hiding this comment

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

Added a few comments. I think we should probably add a few getivar tests to test_yjit_new_backend.rb as well.

@k0kubun k0kubun force-pushed the noah_getinstancevariable_fix branch from 48ca5e0 to bc5c388 Compare August 3, 2022 18:09
@k0kubun k0kubun force-pushed the noah_getinstancevariable_fix branch 2 times, most recently from 2ee107d to 6b4423a Compare August 3, 2022 18:12
@k0kubun k0kubun force-pushed the noah_getinstancevariable_fix branch from 6b4423a to 99bc2fe Compare August 3, 2022 18:12
@k0kubun k0kubun force-pushed the noah_getinstancevariable_fix branch from db7e434 to c3b7828 Compare August 3, 2022 21:52
@k0kubun
Copy link
Member Author

k0kubun commented Aug 3, 2022

Addressed the comments, and fixed one thing that was probably a mistake c3b7828.

CSelE generates cmovne, and CSelNE generates cmove; the opposite of what IR says. Since we want to move Qnil when it's equal to Qundef, I believe it needs to be cmove (CSelNE, given how the IR is implemented).

@noahgibbs
Copy link

noahgibbs commented Aug 4, 2022

CSelE generates cmovne, and CSelNE generates cmove; the opposite of what IR says. Since we want to move Qnil when it's equal to Qundef, I believe it needs to be cmove (CSelNE, given how the IR is implemented).

I believe this is intentional. I had read CSelE as "Select if Equal", so you'd get the first item if the equal/zero flag is true, and the second one if not. Which turns into a MOV <firstitem> / CMOVNE <seconditem> on x86 to get the same effect.

yjit/src/codegen.rs Outdated Show resolved Hide resolved
@k0kubun
Copy link
Member Author

k0kubun commented Aug 4, 2022

I think I addressed all the past reviews, including two ivar test paths in test_yjit_new_backend.rb. Since I ended up relying on this branch from #357 and some conflict resolution effort would be needed after squash merge, let me merge this one 🙇 YJIT CIs are already passing, and I can address any further feedback after merging it. Thank you for having a look.

@k0kubun k0kubun merged commit b5a7543 into yjit_backend_ir Aug 4, 2022
@k0kubun k0kubun deleted the noah_getinstancevariable_fix branch August 4, 2022 16:02
noahgibbs pushed a commit that referenced this pull request Aug 24, 2022
* Convert getinstancevariable to new backend IR

* Support mem-based mem

* Use more into()

* Add tests for getivar

* Just load obj_opnd to a register

* Apply another into()

* Flip the nil-out condition

* Fix duplicated counts of side_exit

PR: #352
noahgibbs pushed a commit that referenced this pull request Aug 25, 2022
* Convert getinstancevariable to new backend IR

* Support mem-based mem

* Use more into()

* Add tests for getivar

* Just load obj_opnd to a register

* Apply another into()

* Flip the nil-out condition

* Fix duplicated counts of side_exit

PR: #352
noahgibbs pushed a commit that referenced this pull request Aug 25, 2022
* Convert getinstancevariable to new backend IR

* Support mem-based mem

* Use more into()

* Add tests for getivar

* Just load obj_opnd to a register

* Apply another into()

* Flip the nil-out condition

* Fix duplicated counts of side_exit

PR: #352
k0kubun added a commit that referenced this pull request Aug 25, 2022
* Convert getinstancevariable to new backend IR

* Support mem-based mem

* Use more into()

* Add tests for getivar

* Just load obj_opnd to a register

* Apply another into()

* Flip the nil-out condition

* Fix duplicated counts of side_exit

PR: #352
k0kubun added a commit that referenced this pull request Aug 25, 2022
* Convert getinstancevariable to new backend IR

* Support mem-based mem

* Use more into()

* Add tests for getivar

* Just load obj_opnd to a register

* Apply another into()

* Flip the nil-out condition

* Fix duplicated counts of side_exit
k0kubun added a commit that referenced this pull request Aug 25, 2022
* Convert getinstancevariable to new backend IR

* Support mem-based mem

* Use more into()

* Add tests for getivar

* Just load obj_opnd to a register

* Apply another into()

* Flip the nil-out condition

* Fix duplicated counts of side_exit
k0kubun added a commit that referenced this pull request Aug 25, 2022
* Convert getinstancevariable to new backend IR

* Support mem-based mem

* Use more into()

* Add tests for getivar

* Just load obj_opnd to a register

* Apply another into()

* Flip the nil-out condition

* Fix duplicated counts of side_exit
k0kubun added a commit that referenced this pull request Aug 25, 2022
* Convert getinstancevariable to new backend IR

* Support mem-based mem

* Use more into()

* Add tests for getivar

* Just load obj_opnd to a register

* Apply another into()

* Flip the nil-out condition

* Fix duplicated counts of side_exit
k0kubun added a commit that referenced this pull request Aug 26, 2022
* Convert getinstancevariable to new backend IR

* Support mem-based mem

* Use more into()

* Add tests for getivar

* Just load obj_opnd to a register

* Apply another into()

* Flip the nil-out condition

* Fix duplicated counts of side_exit
noahgibbs pushed a commit that referenced this pull request Aug 26, 2022
* Convert getinstancevariable to new backend IR

* Support mem-based mem

* Use more into()

* Add tests for getivar

* Just load obj_opnd to a register

* Apply another into()

* Flip the nil-out condition

* Fix duplicated counts of side_exit
k0kubun added a commit that referenced this pull request Aug 26, 2022
* Convert getinstancevariable to new backend IR

* Support mem-based mem

* Use more into()

* Add tests for getivar

* Just load obj_opnd to a register

* Apply another into()

* Flip the nil-out condition

* Fix duplicated counts of side_exit
k0kubun added a commit that referenced this pull request Aug 29, 2022
* Convert getinstancevariable to new backend IR

* Support mem-based mem

* Use more into()

* Add tests for getivar

* Just load obj_opnd to a register

* Apply another into()

* Flip the nil-out condition

* Fix duplicated counts of side_exit
k0kubun added a commit that referenced this pull request Aug 29, 2022
* Convert getinstancevariable to new backend IR

* Support mem-based mem

* Use more into()

* Add tests for getivar

* Just load obj_opnd to a register

* Apply another into()

* Flip the nil-out condition

* Fix duplicated counts of side_exit
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.

None yet

3 participants