[dev.ssa] cmd/compile: fix -N build

The OpSB hack didn't quite work.  We need to really
CSE these ops to make regalloc happy.

Change-Id: I9f4d7bfb0929407c84ee60c9e25ff0c0fbea84af
Reviewed-on: https://go-review.googlesource.com/19083
Run-TryBot: Keith Randall <khr@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: David Chase <drchase@google.com>
This commit is contained in:
Keith Randall 2016-01-28 17:43:45 -08:00
parent 056c09bb88
commit 8a961aee28
3 changed files with 29 additions and 7 deletions

View file

@ -316,12 +316,6 @@ func (s *regAllocState) assignReg(r register, v *Value, c *Value) {
fmt.Printf("assignReg %s %s/%s\n", registers[r].Name(), v, c)
}
if s.regs[r].v != nil {
if v.Op == OpSB && !v.Block.Func.Config.optimize {
// Rewrite rules may introduce multiple OpSB, and with
// -N they don't get CSEd. Ignore the extra assignments.
s.f.setHome(c, &registers[r])
return
}
s.f.Fatalf("tried to assign register %d to %s/%s but it is already used by %s", r, v, c, s.regs[r].v)
}