aboutsummaryrefslogtreecommitdiff
path: root/src/cmd/compile/internal/ssa/opt.go
AgeCommit message (Collapse)Author
2020-08-27cmd/compile: invalidate zero-use values during rewriteKeith Randall
This helps remove uses that aren't needed any more. That in turn helps other rules with Uses==1 conditions fire. Update #39918 Change-Id: I68635b675472f1d59e59604e4d34b949a0016533 Reviewed-on: https://go-review.googlesource.com/c/go/+/249463 Run-TryBot: Keith Randall <khr@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Josh Bleecher Snyder <josharian@gmail.com>
2017-11-05cmd/compile: repair name propagation into aggregate partsDavid Chase
For structs, slices, strings, interfaces, etc, propagation of names to their components (e.g., complex.real, complex.imag) is fragile (depends on phase ordering) and not done right for the "dec" pass. The dec pass is subsumed into decomposeBuiltin, and then names are pushed into the args of all OpFooMake opcodes. compile/ssa/debug_test.go was fixed to pay attention to variable values, and the reference files include checks for the fixes in this CL (which make debugging better). Change-Id: Ic2591ebb1698d78d07292b92c53667e6c37fa0cd Reviewed-on: https://go-review.googlesource.com/73210 Run-TryBot: David Chase <drchase@google.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Heschi Kreinick <heschi@google.com>
2017-04-23cmd/compile: cleanup after IntSize->PtrSize conversionMatthew Dempsky
Also, replace "PtrSize == 4 && Arch != amd64p32" with "RegSize == 4". Passes toolstash-check -all. Updates #19954. Change-Id: I79b2ee9324f4fa53e34c9271d837ea288b5d7829 Reviewed-on: https://go-review.googlesource.com/41491 Run-TryBot: Matthew Dempsky <mdempsky@google.com> Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2017-04-22cmd: remove IntSize and WidthintMatthew Dempsky
Use PtrSize and Widthptr instead. CL prepared mostly with sed and uniq. Passes toolstash-check -all. Fixes #19954. Change-Id: I09371bd7128672885cb8bc4e7f534ad56a88d755 Reviewed-on: https://go-review.googlesource.com/40506 Run-TryBot: Matthew Dempsky <mdempsky@google.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Martin Möhrmann <moehrmann@google.com> Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org> Reviewed-by: Josh Bleecher Snyder <josharian@gmail.com>
2016-08-09[dev.ssa] cmd/compile: port SSA backend to amd64p32Keith Randall
It's not a new backend, just a PtrSize==4 modification of the existing AMD64 backend. Change-Id: Icc63521a5cf4ebb379f7430ef3f070894c09afda Reviewed-on: https://go-review.googlesource.com/25586 Run-TryBot: Keith Randall <khr@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: David Chase <drchase@google.com>
2016-06-02[dev.ssa] cmd/compile: decompose 64-bit integer on ARMCherry Zhang
Introduce dec64 rules to (generically) decompose 64-bit integer on 32-bit architectures. 64-bit integer is composed/decomposed with Int64Make/Hi/Lo ops, as for complex types. The idea of dealing with Add64 is the following: (Add64 (Int64Make xh xl) (Int64Make yh yl)) -> (Int64Make (Add32withcarry xh yh (Select0 (Add32carry xl yl))) (Select1 (Add32carry xl yl))) where Add32carry returns a tuple (flags,uint32). Select0 and Select1 read the first and the second component of the tuple, respectively. The two Add32carry will be CSE'd. Similarly for multiplication, Mul32uhilo returns a tuple (hi, lo). Also add support of KeepAlive, to fix build after merge. Tests addressed_ssa.go, array_ssa.go, break_ssa.go, chan_ssa.go, cmp_ssa.go, ctl_ssa.go, map_ssa.go, and string_ssa.go in cmd/compile/internal/gc/testdata passed. Progress on SSA for ARM. Still not complete. Updates #15365. Change-Id: I7867c76785a456312de5d8398a6b3f7ca5a4f7ec Reviewed-on: https://go-review.googlesource.com/23213 Reviewed-by: Keith Randall <khr@golang.org>
2016-03-09cmd/compile/internal/ssa: lower builtins much laterAlexandru Moșoi
* Move lowering into a separate pass. * SliceLen/SliceCap is now available to various intermediate passes which use useful for bounds checking. * Add a second opt pass to handle the new opportunities Decreases the code size of binaries in pkg/tool/linux_amd64 by ~45K. Updates #14564 #14606 Change-Id: I5b2bd6202181c50623a3585fbf15c0d6db6d4685 Reviewed-on: https://go-review.googlesource.com/20172 Run-TryBot: Alexandru Moșoi <alexandru@mosoi.ro> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: David Chase <drchase@google.com>
2015-06-08[dev.ssa] cmd/compile/internal/ssa: autogenerate opcodesKeith Randall
Revamp autogeneration. Get rid of gogenerate commands, they are more trouble than they are worth. (If the code won't compile, gogenerate doesn't work.) Generate opcode enums & tables. This means we only have to specify opcodes in one place instead of two. Add arch prefixes to opcodes so they will be globally unique. Change-Id: I175d0a89b701b2377bbe699f3756731b7c9f5a9f Reviewed-on: https://go-review.googlesource.com/10812 Reviewed-by: Alan Donovan <adonovan@google.com>
2015-05-30[dev.ssa] cmd/compile/internal/ssa: Implement block rewriting rulesKeith Randall
Change-Id: I47e5349e34fc18118c4d35bf433f875b958cc3e5 Reviewed-on: https://go-review.googlesource.com/10495 Reviewed-by: Alan Donovan <adonovan@google.com>
2015-05-28[dev.ssa] Merge remote-tracking branch 'origin/master' into mergebranchKeith Randall
Semi-regular merge of tip to dev.ssa. Complicated a bit by the move of cmd/internal/* to cmd/compile/internal/*. Change-Id: I1c66d3c29bb95cce4a53c5a3476373aa5245303d