[dev.ssa] cmd/compile: better ANDAND and OROR in IF and FOR
For the statement if a && b { target } the old code allocated a new variable v and did: v = a if a { v = b } if v { goto target } The new code does: if a { if b { goto target } } The new arrangement tends to generate much more efficient code. In particular, there is no temporary variable and there is only one join point instead of two. The old code is still used for ANDAND and OROR which are not direct descendents of IF or FOR statements. Change-Id: I082f246d27c823c6f32d1287300e4b0911607507 Reviewed-on: https://go-review.googlesource.com/16584 Run-TryBot: Keith Randall <khr@golang.org> Reviewed-by:David Chase <drchase@google.com>
Showing
Please register or sign in to comment