DescriptionImprove the x64 Load and Store access instruction selection to include immediate offsets.
Currently GetEffectiveAddressMemoryOperand() uses
BaseWithIndexAndDisplacement64Match. However this does not recognize
the ChangeUint32ToUint64 operation which is applied to the index. It
looks like a lot of work to rework BaseWithIndexAndDisplacement64Match,
and BaseWithIndexAndDisplacement32Match seems ok as-is, so it seems more
appropriate to add x64 backend specific code to match the patterns
which is done inline in GetEffectiveAddressMemoryOperand().
Some of the code in VisitChangeUint32ToUint64() has been refactored
into OpZeroExtends() and is needed in the pattern matching.
The BaseWithIndexAndDisplacementMatch code has some OwnedBy()
tests. It's not immediately clear if these are to maintain some
invariant or if they are just a heuristic? It seems generally better
to dehoist the index offsets aggressively so the OwnedBy() test is
omitted in this patch. This could use some reviewer scrutiny?
A TODO note is included to explore the scaled-index patterns matched
by BaseWithIndexAndDisplacement64Match. Such patterns are less likely
to be proven within bounds and thus not taken by these paths anyway,
so they are left for future work.
This patch gives a useful x0.92 improvement in run time for an asm.js
zlib benchmark when using index masking to avoid bounds checks.
BUG=
Patch Set 1 #
Total comments: 3
Patch Set 2 : Address reviewer feedback #Patch Set 3 : Guard against the int32 addition argument being negative. #Patch Set 4 : Match scaled indexes #Patch Set 5 : Rebase #Messages
Total messages: 16 (4 generated)
|