mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
cmd: use built-in min/max instead of bespoke versions
Now that we're bootstrapping from a toolchain that has min/max builtins. Update #64751 Change-Id: I63eedf3cca00f56f62ca092949cb2dc61db03361 Reviewed-on: https://go-review.googlesource.com/c/go/+/610355 Reviewed-by: Dmitri Shuralyov <dmitshur@google.com> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Keith Randall <khr@google.com> Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org> Reviewed-by: Ian Lance Taylor <iant@golang.org>
This commit is contained in:
parent
820f58a27f
commit
f90f7e90b3
9 changed files with 18 additions and 100 deletions
|
|
@ -511,8 +511,8 @@ func (s *regAllocState) makeSpill(v *Value, b *Block) *Value {
|
|||
vi := &s.values[v.ID]
|
||||
if vi.spill != nil {
|
||||
// Final block not known - keep track of subtree where restores reside.
|
||||
vi.restoreMin = min32(vi.restoreMin, s.sdom[b.ID].entry)
|
||||
vi.restoreMax = max32(vi.restoreMax, s.sdom[b.ID].exit)
|
||||
vi.restoreMin = min(vi.restoreMin, s.sdom[b.ID].entry)
|
||||
vi.restoreMax = max(vi.restoreMax, s.sdom[b.ID].exit)
|
||||
return vi.spill
|
||||
}
|
||||
// Make a spill for v. We don't know where we want
|
||||
|
|
@ -2987,16 +2987,3 @@ func (d *desiredState) merge(x *desiredState) {
|
|||
d.addList(e.ID, e.regs)
|
||||
}
|
||||
}
|
||||
|
||||
func min32(x, y int32) int32 {
|
||||
if x < y {
|
||||
return x
|
||||
}
|
||||
return y
|
||||
}
|
||||
func max32(x, y int32) int32 {
|
||||
if x > y {
|
||||
return x
|
||||
}
|
||||
return y
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue