[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>
diff --git a/src/cmd/compile/internal/gc/ssa.go b/src/cmd/compile/internal/gc/ssa.go
index 2c935b7..90abd8e 100644
--- a/src/cmd/compile/internal/gc/ssa.go
+++ b/src/cmd/compile/internal/gc/ssa.go
@@ -2026,6 +2026,11 @@
// 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