]> Cypherpunks repositories - gostls13.git/commitdiff
cmd/compile: fix no-opt build after moving decomposing user functions
authorAlexandru Moșoi <mosoi@google.com>
Mon, 14 Mar 2016 18:11:19 +0000 (19:11 +0100)
committerAlexandru Moșoi <alexandru@mosoi.ro>
Mon, 14 Mar 2016 18:44:10 +0000 (18:44 +0000)
decompose-builtin pass requires an opt pass, but -N disables
late-opt, the only opt pass (out of two) that happens
after decompose-builtin.  This CL enables both 'opt' and 'late opt'
passes. The extra compile time for 'late opt' in negligible
since most rewrites were already done in the first 'opt'
(also measured before). We should put some effort in splitting the
generic rules into required and optional.

Also update generic.rules comments about lowering
of StringMake and SliceMake.

Tested with GO_GCFLAGS=-N ./all.bash

Change-Id: I92999681aaa02587b6dc6e32ce997a91f1fc9499
Reviewed-on: https://go-review.googlesource.com/20682
Run-TryBot: Alexandru Moșoi <alexandru@mosoi.ro>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
src/cmd/compile/internal/ssa/compile.go
src/cmd/compile/internal/ssa/gen/generic.rules

index cbef6ea645a78abd97df207246f5c701b1be1829..8080b7aabaf66acf4a6f528ddc221318bb61af40 100644 (file)
@@ -183,7 +183,7 @@ var passes = [...]pass{
        {name: "prove", fn: prove},
        {name: "decompose builtin", fn: decomposeBuiltIn, required: true},
        {name: "dec", fn: dec, required: true},
-       {name: "late opt", fn: opt}, // TODO: split required rules and optimizing rules
+       {name: "late opt", fn: opt, required: true}, // TODO: split required rules and optimizing rules
        {name: "generic deadcode", fn: deadcode},
        {name: "fuse", fn: fuse},
        {name: "dse", fn: dse},
index cc24269418587144509012e90c7085c173e58c4c..2186d8921c409efc289706a4b618a88d399416a5 100644 (file)
     (Store [8] dst real mem))
 
 // string ops
+// Decomposing StringMake and lowering of StringPtr and StringLen
+// happens in a later pass, dec, so that these operations are available
+// to otherpasses for optimizations.
 (StringPtr (StringMake (Const64 <t> [c]) _)) -> (Const64 <t> [c])
 (StringLen (StringMake _ (Const64 <t> [c]))) -> (Const64 <t> [c])
 (ConstString {s}) && config.PtrSize == 4 && s.(string) == "" ->
     (Store [config.PtrSize] dst ptr mem))
 
 // slice ops
+// Decomposing SliceMake, and lowering of SlicePtr, SliceLen, and SliceCap
+// happens in a later pass, dec, so that these operations are available
+// to other passes for optimizations.
 (SlicePtr (SliceMake (Const64 <t> [c]) _ _)) -> (Const64 <t> [c])
 (SliceLen (SliceMake _ (Const64 <t> [c]) _)) -> (Const64 <t> [c])
 (SliceCap (SliceMake _ _ (Const64 <t> [c]))) -> (Const64 <t> [c])