From: Cherry Zhang Date: Tue, 7 Jun 2016 18:18:04 +0000 (-0400) Subject: [dev.ssa] cmd/compile: enable SSA on ARM by default X-Git-Tag: go1.8beta1~1892^2^2~42 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=42181ad852700b790906b4c7ab24c4c23dd874e2;p=gostls13.git [dev.ssa] cmd/compile: enable SSA on ARM by default As Josh mentioned in CL 24716, there has been requests for using SSA for ARM. SSA can still be disabled by setting -ssa=0 for cmd/compile, or partially enabled with GOSSAFUNC, GOSSAPKG, and GOSSAHASH. Not enable SSA by default on NaCl, which is not supported yet. Enable SSA-specific tests on ARM: live_ssa.go and nilptr3_ssa.go; disable non-SSA tests: live.go, nilptr3.go, and slicepot.go. Updates #15365. Change-Id: Ic2ca8d166aeca8517b9d262a55e92f2130683a16 Reviewed-on: https://go-review.googlesource.com/23953 Run-TryBot: Cherry Zhang TryBot-Result: Gobot Gobot Reviewed-by: Josh Bleecher Snyder Reviewed-by: David Chase --- diff --git a/src/cmd/compile/internal/gc/ssa.go b/src/cmd/compile/internal/gc/ssa.go index 90f48dcab4..4942466b71 100644 --- a/src/cmd/compile/internal/gc/ssa.go +++ b/src/cmd/compile/internal/gc/ssa.go @@ -37,8 +37,13 @@ func shouldssa(fn *Node) bool { if os.Getenv("SSATEST") == "" { return false } - // Generally available. + case "arm": + // nacl/arm doesn't work yet + if obj.Getgoos() == "nacl" && os.Getenv("SSATEST") == "" { + return false + } case "amd64": + // Generally available. } if !ssaEnabled { return false diff --git a/test/live.go b/test/live.go index da0606db71..a8e1f28c13 100644 --- a/test/live.go +++ b/test/live.go @@ -1,4 +1,4 @@ -// +build !amd64 +// +build !amd64,!arm nacl,arm // errorcheck -0 -l -live -wb=0 // Copyright 2014 The Go Authors. All rights reserved. diff --git a/test/live_ssa.go b/test/live_ssa.go index bd709246f6..91bad0c8b9 100644 --- a/test/live_ssa.go +++ b/test/live_ssa.go @@ -1,4 +1,4 @@ -// +build amd64 +// +build amd64 arm,!nacl // errorcheck -0 -l -live -wb=0 // Copyright 2014 The Go Authors. All rights reserved. diff --git a/test/nilptr3.go b/test/nilptr3.go index 8922729ec8..75f5a10bd0 100644 --- a/test/nilptr3.go +++ b/test/nilptr3.go @@ -2,7 +2,7 @@ // Fails on ppc64x because of incomplete optimization. // See issues 9058. // Same reason for mips64x and s390x. -// +build !ppc64,!ppc64le,!mips64,!mips64le,!amd64,!s390x +// +build !ppc64,!ppc64le,!mips64,!mips64le,!amd64,!s390x,!arm nacl,arm // Copyright 2013 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style diff --git a/test/nilptr3_ssa.go b/test/nilptr3_ssa.go index 0d690eb446..8482175139 100644 --- a/test/nilptr3_ssa.go +++ b/test/nilptr3_ssa.go @@ -1,7 +1,5 @@ // errorcheck -0 -d=nil -// Fails on ppc64x because of incomplete optimization. -// See issues 9058. -// +build !ppc64,!ppc64le,amd64 +// +build amd64 arm,!nacl // Copyright 2013 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style diff --git a/test/sliceopt.go b/test/sliceopt.go index a830ab7cf6..e60516571b 100644 --- a/test/sliceopt.go +++ b/test/sliceopt.go @@ -1,4 +1,4 @@ -// +build !amd64 +// +build !amd64,!arm nacl,arm // errorcheck -0 -d=append,slice // Copyright 2015 The Go Authors. All rights reserved.