]> Cypherpunks repositories - gostls13.git/commit
cmd/compile: order nil checks by source position
authorKeith Randall <khr@google.com>
Tue, 27 Nov 2018 22:15:51 +0000 (14:15 -0800)
committerKeith Randall <khr@golang.org>
Wed, 28 Nov 2018 16:49:31 +0000 (16:49 +0000)
commitff9481ec0d684b4f00670d40e869b5d40c54f162
treecade28670da485be3d6fb6388129f86666c89876
parent71f9f4b84b2974acf723ea78c1c6eb82d6755794
cmd/compile: order nil checks by source position

There's nothing enforcing ordering between redundant nil checks when
they may occur during the same memory state. Commit to using the
earliest one in source order.

Otherwise the choice of which to remove depends on the ordering of
values in a block (before scheduling). That's unfortunate when trying
to ensure that the compiler doesn't depend on that ordering for
anything.

Update #20178

Change-Id: I2cdd5be10618accd9d91fa07406c90cbd023ffba
Reviewed-on: https://go-review.googlesource.com/c/151517
Run-TryBot: Keith Randall <khr@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: David Chase <drchase@google.com>
Reviewed-by: Cherry Zhang <cherryyz@google.com>
src/cmd/compile/internal/ssa/schedule.go