Commit 88c1fd64 authored by Iskander Sharipov's avatar Iskander Sharipov Committed by Iskander Sharipov

cmd/compile/internal/gc: remove redundant for label

Since there are no nested loops and/or switches,
loop label can be removed and "bare continue" can be used.

Change-Id: Id642a0859299e4470af544d59884fec51dbb31ee
Reviewed-on: https://go-review.googlesource.com/135837Reviewed-by: default avatarKeith Randall <khr@golang.org>
Run-TryBot: Iskander Sharipov <iskander.sharipov@intel.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
parent c03d0e4f
...@@ -234,7 +234,6 @@ func canMergeLoad(target, load, x *Value) bool { ...@@ -234,7 +234,6 @@ func canMergeLoad(target, load, x *Value) bool {
// memPreds contains memory states known to be predecessors of load's // memPreds contains memory states known to be predecessors of load's
// memory state. It is lazily initialized. // memory state. It is lazily initialized.
var memPreds map[*Value]bool var memPreds map[*Value]bool
search:
for i := 0; len(args) > 0; i++ { for i := 0; len(args) > 0; i++ {
const limit = 100 const limit = 100
if i >= limit { if i >= limit {
...@@ -246,13 +245,13 @@ search: ...@@ -246,13 +245,13 @@ search:
if target.Block.ID != v.Block.ID { if target.Block.ID != v.Block.ID {
// Since target and load are in the same block // Since target and load are in the same block
// we can stop searching when we leave the block. // we can stop searching when we leave the block.
continue search continue
} }
if v.Op == OpPhi { if v.Op == OpPhi {
// A Phi implies we have reached the top of the block. // A Phi implies we have reached the top of the block.
// The memory phi, if it exists, is always // The memory phi, if it exists, is always
// the first logical store in the block. // the first logical store in the block.
continue search continue
} }
if v.Type.IsTuple() && v.Type.FieldType(1).IsMemory() { if v.Type.IsTuple() && v.Type.FieldType(1).IsMemory() {
// We could handle this situation however it is likely // We could handle this situation however it is likely
...@@ -296,14 +295,14 @@ search: ...@@ -296,14 +295,14 @@ search:
// load = read ... mem // load = read ... mem
// target = add x load // target = add x load
if memPreds[v] { if memPreds[v] {
continue search continue
} }
return false return false
} }
if len(v.Args) > 0 && v.Args[len(v.Args)-1] == mem { if len(v.Args) > 0 && v.Args[len(v.Args)-1] == mem {
// If v takes mem as an input then we know mem // If v takes mem as an input then we know mem
// is valid at this point. // is valid at this point.
continue search continue
} }
for _, a := range v.Args { for _, a := range v.Args {
if target.Block.ID == a.Block.ID { if target.Block.ID == a.Block.ID {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment