-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
cranelift: Port bitselect
over to ISLE on x64
#3653
Conversation
Subscribe to Label Action
This issue or pull request has been labeled: "cranelift", "cranelift:area:x64", "isle"
Thus the following users have been cc'd because of the following labels:
To subscribe or unsubscribe from this label, edit the |
It looks like the initial
@cfallin any idea why regalloc might not be able to coalesce/elide this move? (See OP for full code) |
It looks like regalloc correctly determines that these virtual registers (
|
247a0fe
to
3de8a92
Compare
Hmm, interesting. My understanding is that regalloc.rs computes equivalence classes to use in a strictly heuristic way during allocation (of virtual-reg ranges to registers, and then separately to spillslots). The former (mainly in this file) traverses equivalence classes looking for register hints (move to/from fixed reg), and to avoid some evictions. But two vregs existing in the same eclass does not guarantee that the move between them will be elided; in fact, one can construct inputs where this is not possible, as liveranges in an eclass can overlap. Elements in an eclass are joined by an "equivalence" that's kind of misnamed, I guess: it just means that at one point, one of the vregs was assigned to the other. Consider e.g. a loop where two vregs are swapped every iteration ( Zooming out a bit, I would expect that once in a while, we get perturbations like this as ISLE's SSA lowering works just a bit differently. As long as we don't see regressions overall, I think this is fine to accept. |
Swapped the operands to the two commutative instructions (which I noticed was the only difference between the pre-regalloc vcode on Yay 😬 |
But yeah, agreed on this point 👍 |
3de8a92
to
815407d
Compare
f943e01
to
073ac6e
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks great, thanks!
I very much like the compile-test style (check pxor, not xorps, not xorpd) -- this is the right way to use compile-tests going forward, I think, verifying actual properties of the compilation 👍
Subscribe to Label Actioncc @peterhuene
This issue or pull request has been labeled: "wasmtime:api"
Thus the following users have been cc'd because of the following labels:
To subscribe or unsubscribe from this label, edit the |
073ac6e
to
6e0f732
Compare
This is causing a test failure, as we are generating some unnecessary
movdqa
s now. Haven't had time to look into why this is happening, but I figured I would put this WIP PR up for posterity, along with info on the failing test and unnecessary moves.CLIF:
Before:
After: