cfallin requested julian-seward1 for a review on PR #2376.
cfallin opened PR #2376 from loadsplat
to main
:
This PR uses the isel changes introduced in #2366 that allows loads to sink and merge with other operations in order to replace the
LoadSplat
instruction with more general pattern-matching.
LoadSplat
was added as an incremental step to improve AArch64 code quality in #2278. At the time, we did not have a way to pattern-match the load + splat opcode sequence that the relevant Wasm opcodes lowered to. However, now with PR #2366, we can merge effectful instructions such as loads into other ops, and so we can do this pattern matching directly.PR includes commit from #2366 to allow simultaneous review/CI.
cc @julian-seward1 @akirilov-arm @abrown
cfallin updated PR #2376 from loadsplat
to main
:
This PR uses the isel changes introduced in #2366 that allows loads to sink and merge with other operations in order to replace the
LoadSplat
instruction with more general pattern-matching.
LoadSplat
was added as an incremental step to improve AArch64 code quality in #2278. At the time, we did not have a way to pattern-match the load + splat opcode sequence that the relevant Wasm opcodes lowered to. However, now with PR #2366, we can merge effectful instructions such as loads into other ops, and so we can do this pattern matching directly.PR includes commit from #2366 to allow simultaneous review/CI.
cc @julian-seward1 @akirilov-arm @abrown
akirilov-arm submitted PR Review.
akirilov-arm created PR Review Comment:
Shouldn't we keep these helpers in
lower.rs
? I thought thatlower_inst.rs
was created to contain just the big functionslower_insn_to_regs()
andlower_branch()
.
akirilov-arm created PR Review Comment:
I just had a quick look at #2366, so I might be missing something, but the description says:
This can only be done to an instruction with no uses of its result register(s), because it will cause the instruction not to be codegen'd at its original location.
(I guess the meaning is that there are no uses of its result except the instruction it has been merged into)
It is not clear to me how we ensure that here; at the very least shouldn't there be a test case where the result of a load is used both by a splat and by another operation?
akirilov-arm submitted PR Review.
cfallin submitted PR Review.
cfallin created PR Review Comment:
Indeed, no other uses than the one by the input merging the op (I'll clarify that, and add a test for the multi-use case).
The condition is ensured by the logic in
maybe_get_input_as_source_or_const()
: it will returnNone
as theinst
field in the returnedLowerInput
if any of the conditions for code motion are not satisfied. So, things just transparently work in the pattern-matching: we won't see any source op at all if we aren't allowed to merge it.
abrown submitted PR Review.
abrown created PR Review Comment:
:+1: for fewer CLIF instructions!
abrown submitted PR Review.
abrown created PR Review Comment:
So a separate PR will do the same for x64?
cfallin submitted PR Review.
cfallin created PR Review Comment:
Indeed, that's my plan for today :-)
cfallin updated PR #2376 from loadsplat
to main
:
This PR uses the isel changes introduced in #2366 that allows loads to sink and merge with other operations in order to replace the
LoadSplat
instruction with more general pattern-matching.
LoadSplat
was added as an incremental step to improve AArch64 code quality in #2278. At the time, we did not have a way to pattern-match the load + splat opcode sequence that the relevant Wasm opcodes lowered to. However, now with PR #2366, we can merge effectful instructions such as loads into other ops, and so we can do this pattern matching directly.PR includes commit from #2366 to allow simultaneous review/CI.
cc @julian-seward1 @akirilov-arm @abrown
cfallin submitted PR Review.
cfallin created PR Review Comment:
Yes, good point, we've gotten a bit sloppy about this -- moved the added helpers as well as the one above this code.
cfallin updated PR #2376 from loadsplat
to main
:
This PR uses the isel changes introduced in #2366 that allows loads to sink and merge with other operations in order to replace the
LoadSplat
instruction with more general pattern-matching.
LoadSplat
was added as an incremental step to improve AArch64 code quality in #2278. At the time, we did not have a way to pattern-match the load + splat opcode sequence that the relevant Wasm opcodes lowered to. However, now with PR #2366, we can merge effectful instructions such as loads into other ops, and so we can do this pattern matching directly.PR includes commit from #2366 to allow simultaneous review/CI.
cc @julian-seward1 @akirilov-arm @abrown
cfallin updated PR #2376 from loadsplat
to main
:
This PR uses the isel changes introduced in #2366 that allows loads to sink and merge with other operations in order to replace the
LoadSplat
instruction with more general pattern-matching.
LoadSplat
was added as an incremental step to improve AArch64 code quality in #2278. At the time, we did not have a way to pattern-match the load + splat opcode sequence that the relevant Wasm opcodes lowered to. However, now with PR #2366, we can merge effectful instructions such as loads into other ops, and so we can do this pattern matching directly.PR includes commit from #2366 to allow simultaneous review/CI.
cc @julian-seward1 @akirilov-arm @abrown
cfallin updated PR #2376 from loadsplat
to main
:
This PR uses the isel changes introduced in #2366 that allows loads to sink and merge with other operations in order to replace the
LoadSplat
instruction with more general pattern-matching.
LoadSplat
was added as an incremental step to improve AArch64 code quality in #2278. At the time, we did not have a way to pattern-match the load + splat opcode sequence that the relevant Wasm opcodes lowered to. However, now with PR #2366, we can merge effectful instructions such as loads into other ops, and so we can do this pattern matching directly.PR includes commit from #2366 to allow simultaneous review/CI.
cc @julian-seward1 @akirilov-arm @abrown
akirilov-arm submitted PR Review.
cfallin updated PR #2376 from loadsplat
to main
:
This PR uses the isel changes introduced in #2366 that allows loads to sink and merge with other operations in order to replace the
LoadSplat
instruction with more general pattern-matching.
LoadSplat
was added as an incremental step to improve AArch64 code quality in #2278. At the time, we did not have a way to pattern-match the load + splat opcode sequence that the relevant Wasm opcodes lowered to. However, now with PR #2366, we can merge effectful instructions such as loads into other ops, and so we can do this pattern matching directly.PR includes commit from #2366 to allow simultaneous review/CI.
cc @julian-seward1 @akirilov-arm @abrown
cfallin updated PR #2376 from loadsplat
to main
:
This PR uses the isel changes introduced in #2366 that allows loads to sink and merge with other operations in order to replace the
LoadSplat
instruction with more general pattern-matching.
LoadSplat
was added as an incremental step to improve AArch64 code quality in #2278. At the time, we did not have a way to pattern-match the load + splat opcode sequence that the relevant Wasm opcodes lowered to. However, now with PR #2366, we can merge effectful instructions such as loads into other ops, and so we can do this pattern matching directly.PR includes commit from #2366 to allow simultaneous review/CI.
cc @julian-seward1 @akirilov-arm @abrown
cfallin updated PR #2376 from loadsplat
to main
:
This PR uses the isel changes introduced in #2366 that allows loads to sink and merge with other operations in order to replace the
LoadSplat
instruction with more general pattern-matching.
LoadSplat
was added as an incremental step to improve AArch64 code quality in #2278. At the time, we did not have a way to pattern-match the load + splat opcode sequence that the relevant Wasm opcodes lowered to. However, now with PR #2366, we can merge effectful instructions such as loads into other ops, and so we can do this pattern matching directly.PR includes commit from #2366 to allow simultaneous review/CI.
cc @julian-seward1 @akirilov-arm @abrown
cfallin updated PR #2376 from loadsplat
to main
:
This PR uses the isel changes introduced in #2366 that allows loads to sink and merge with other operations in order to replace the
LoadSplat
instruction with more general pattern-matching.
LoadSplat
was added as an incremental step to improve AArch64 code quality in #2278. At the time, we did not have a way to pattern-match the load + splat opcode sequence that the relevant Wasm opcodes lowered to. However, now with PR #2366, we can merge effectful instructions such as loads into other ops, and so we can do this pattern matching directly.PR includes commit from #2366 to allow simultaneous review/CI.
cc @julian-seward1 @akirilov-arm @abrown
julian-seward1 submitted PR Review.
cfallin merged PR #2376.
Last updated: Nov 22 2024 at 16:03 UTC