[dev.ssa] cmd/compile: Handle ONOT in conditionals as well

Might as well, for a && !(b && c) and the like.

Change-Id: I2548b6e6ee5870e074bcef6edd56a7db6e81d70f
Reviewed-on: https://go-review.googlesource.com/16600
Reviewed-by: David Chase <drchase@google.com>
Run-TryBot: David Chase <drchase@google.com>
This commit is contained in:
Keith Randall 2015-11-03 09:30:17 -08:00
parent 02f4d0a130
commit d19bfc3b68
1 changed files with 5 additions and 0 deletions

View File

@ -2026,6 +2026,11 @@ func (s *state) condBranch(cond *Node, yes, no *ssa.Block, likely int8) {
// If likely==1, then we don't have enough info to decide
// the likelihood of the first branch.
}
if cond.Op == ONOT {
s.stmtList(cond.Ninit)
s.condBranch(cond.Left, no, yes, -likely)
return
}
c := s.expr(cond)
b := s.endBlock()
b.Kind = ssa.BlockIf