1
0
mirror of https://github.com/golang/go synced 2024-11-18 17:54:57 -07:00

cmd/compile: use dereference boundedness hint during ssa conversion

This has a minor positive effect on generated code,
particularly code using type switches.

Change-Id: I7269769ab0d861ef6fc9e6d7809ffc3573c68340
Reviewed-on: https://go-review.googlesource.com/c/go/+/228885
Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
This commit is contained in:
Josh Bleecher Snyder 2020-04-19 15:34:32 -07:00
parent 5abf5f831e
commit e8518731be

View File

@ -2549,7 +2549,7 @@ func (s *state) expr(n *Node) *ssa.Value {
return s.load(n.Type, addr)
case ODEREF:
p := s.exprPtr(n.Left, false, n.Pos)
p := s.exprPtr(n.Left, n.Bounded(), n.Pos)
return s.load(n.Type, p)
case ODOT:
@ -2574,7 +2574,7 @@ func (s *state) expr(n *Node) *ssa.Value {
return s.newValue1I(ssa.OpStructSelect, n.Type, int64(fieldIdx(n)), v)
case ODOTPTR:
p := s.exprPtr(n.Left, false, n.Pos)
p := s.exprPtr(n.Left, n.Bounded(), n.Pos)
p = s.newValue1I(ssa.OpOffPtr, types.NewPtr(n.Type), n.Xoffset, p)
return s.load(n.Type, p)