Y-Nak opened PR #1697 from fix-licm-jt-bug
to master
:
Resolve #1648 and resolve #1080.
- [x] This has been discussed in issue #1648 and #1080
- [x] A short description of what this does, why it is needed;
- Fix inconsistency between
branch_destination
andbranch_destination_mut
(Just addingIndirectJump
case tobranch_destination_mut
).- Modify jump table entry if it points at loop header, and also modify destination if it points at loop header.
[x] This PR contains test cases, if meaningful.
[x] A reviewer from the core maintainer team has been assigned for this PR.
@iximeow Could you review this please? I know you are aware of the issue, so please feel free to close this PR if you have started looking into.
Y-Nak submitted PR Review.
Y-Nak created PR Review Comment:
Oh, thanks!
Y-Nak updated PR #1697 from fix-licm-jt-bug
to master
:
Resolve #1648 and resolve #1080.
- [x] This has been discussed in issue #1648 and #1080
- [x] A short description of what this does, why it is needed;
- Fix inconsistency between
branch_destination
andbranch_destination_mut
(Just addingIndirectJump
case tobranch_destination_mut
).- Modify jump table entry if it points at loop header, and also modify destination if it points at loop header.
[x] This PR contains test cases, if meaningful.
[x] A reviewer from the core maintainer team has been assigned for this PR.
@iximeow Could you review this please? I know you are aware of the issue, so please feel free to close this PR if you have started looking into.
alexcrichton edited PR #1697 from fix-licm-jt-bug
to main
:
Resolve #1648 and resolve #1080.
- [x] This has been discussed in issue #1648 and #1080
- [x] A short description of what this does, why it is needed;
- Fix inconsistency between
branch_destination
andbranch_destination_mut
(Just addingIndirectJump
case tobranch_destination_mut
).- Modify jump table entry if it points at loop header, and also modify destination if it points at loop header.
[x] This PR contains test cases, if meaningful.
[x] A reviewer from the core maintainer team has been assigned for this PR.
@iximeow Could you review this please? I know you are aware of the issue, so please feel free to close this PR if you have started looking into.
cfallin submitted PR Review.
cfallin submitted PR Review.
cfallin created PR Review Comment:
It seems we could fold this into a helper alongside
change_branch_destination
onFunction
, by defining arewrite_branch_destination(inst, old_target, new_target)
that replaces anyold_target
target in the instruction withnew_target
, doing the replacement on any target(s) that exist in the instruction. Thoughts? This would also remove the awkward match below.
cfallin created PR Review Comment:
Can we remove the encodings here? They'll cause issues when we switch to the new backend by default and I don't think they're needed for the test.
Y-Nak submitted PR Review.
Y-Nak created PR Review Comment:
We can remove the encodings iff the test runs with the new backend, otherwise
Verifier::verify_encodings
fails because somejump
insts with encodings is inserted here.
https://github.com/bytecodealliance/wasmtime/blob/2cec20aa57037ecdfaef46176f31fe8f6b33c2d8/cranelift/codegen/src/licm.rs#L94-L98
So, I'm inclined to remove all encodings from the test and change the target machine toaarch64
fromx86-64
, what do you think about it?
Y-Nak submitted PR Review.
Y-Nak created PR Review Comment:
Exactly! Thanks for pointing out.
I'll addFunction::rewrite_branch_destination
.
cfallin submitted PR Review.
cfallin created PR Review Comment:
Yes, that sounds good, thanks!
Y-Nak updated PR #1697 from fix-licm-jt-bug
to main
:
Resolve #1648 and resolve #1080.
- [x] This has been discussed in issue #1648 and #1080
- [x] A short description of what this does, why it is needed;
- Fix inconsistency between
branch_destination
andbranch_destination_mut
(Just addingIndirectJump
case tobranch_destination_mut
).- Modify jump table entry if it points at loop header, and also modify destination if it points at loop header.
[x] This PR contains test cases, if meaningful.
[x] A reviewer from the core maintainer team has been assigned for this PR.
@iximeow Could you review this please? I know you are aware of the issue, so please feel free to close this PR if you have started looking into.
cfallin submitted PR Review.
cfallin merged PR #1697.
Last updated: Nov 22 2024 at 17:03 UTC