]> Cypherpunks repositories - gostls13.git/commit
cmd/compile: insert complicated x86 addressing modes as a separate pass
authorKeith Randall <khr@golang.org>
Thu, 30 Jan 2020 18:17:01 +0000 (10:17 -0800)
committerKeith Randall <khr@golang.org>
Tue, 10 Mar 2020 00:13:21 +0000 (00:13 +0000)
commit98cb76799c3053e779c4e1b61bb50705d25dd77f
treeac2efa24c893645de6787c7375c227b5732b08eb
parentd49fecc474d04a04d1d22851c06099338abd4391
cmd/compile: insert complicated x86 addressing modes as a separate pass

Use a separate compiler pass to introduce complicated x86 addressing
modes.  Loads in the normal architecture rules (for x86 and all other
platforms) can have constant offsets (AuxInt values) and symbols (Aux
values), but no more.

The complex addressing modes (x+y, x+2*y, etc.) are introduced in a
separate pass that combines loads with LEAQx ops.

Organizing rewrites this way simplifies the number of rewrites
required, as there are lots of different rule orderings that have to
be specified to ensure these complex addressing modes are always found
if they are possible.

Update #36468

Change-Id: I5b4bf7b03a1e731d6dfeb9ef19b376175f3b4b44
Reviewed-on: https://go-review.googlesource.com/c/go/+/217097
Run-TryBot: Keith Randall <khr@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Josh Bleecher Snyder <josharian@gmail.com>
src/cmd/compile/internal/ssa/addressingmodes.go [new file with mode: 0644]
src/cmd/compile/internal/ssa/compile.go
src/cmd/compile/internal/ssa/gen/AMD64.rules
src/cmd/compile/internal/ssa/rewrite.go
src/cmd/compile/internal/ssa/rewriteAMD64.go
test/codegen/memops.go