Kixiron opened issue #5564:
Currently functions like
FunctionBuilder::emit_small_memory_copy()
andFunctionBuilder::emit_small_memory_compare()
only allow giving a singleMemFlags
that (presumably) applies to both pointers when allowing disjoint flags could be beneficial, e.g. in the case where you're copying from areadonly
pointer to a non-readonly
pointer, or comparisons where only one side isreadonly
.Additionally, the normal
FunctionBuilder::call_memcmp()
andFunctionBuilder::call_memcpy()
functions don't take flag arguments which could be beneficial for potentially de-duplicating calls
bjorn3 commented on issue #5564:
call_memcmp
andcall_memcpy
directly generate a call instruction, so there is nothing to attach theMemFlags
too.
jameysharp commented on issue #5564:
This is a good point! I'd guess
aligned
could have a significant impact even if it's only set on one operand.However just last month @bjorn3 proposed to introduce dedicated Cranelift IR instructions for these operations (#5479). I think we'll want to get rid of the corresponding cranelift-frontend functions entirely at that point. Also, off-hand I'm guessing we can't do many of the optimizations that dual mem-flags would enable without first plumbing these operations all the way to the backend.
So I'm going to close this, folding it into that issue as a suggestion that the new instructions should have one
MemFlags
for each pointer operand.
jameysharp closed issue #5564:
Currently functions like
FunctionBuilder::emit_small_memory_copy()
andFunctionBuilder::emit_small_memory_compare()
only allow giving a singleMemFlags
that (presumably) applies to both pointers when allowing disjoint flags could be beneficial, e.g. in the case where you're copying from areadonly
pointer to a non-readonly
pointer, or comparisons where only one side isreadonly
.Additionally, the normal
FunctionBuilder::call_memcmp()
andFunctionBuilder::call_memcpy()
functions don't take flag arguments which could be beneficial for potentially de-duplicating calls
Last updated: Dec 23 2024 at 12:05 UTC