]> Cypherpunks.ru repositories - gostls13.git/commit
[dev.regabi] cmd/compile: swap inlining order of if then vs else blocks
authorRuss Cox <rsc@golang.org>
Thu, 3 Dec 2020 20:40:46 +0000 (15:40 -0500)
committerRuss Cox <rsc@golang.org>
Fri, 4 Dec 2020 16:52:45 +0000 (16:52 +0000)
commit99ecfcae31e52a297195b2c1d1d9326e16d6c775
tree77b74d303656d3bbc7a4c52dda5952ee762689e5
parent84cb51d7d7a936d56d6287ca075dd578097499a9
[dev.regabi] cmd/compile: swap inlining order of if then vs else blocks

The upcoming general iterators will process nodes in
source code order, meaning that the "then" block comes
before the "else" block. But for an if node, "then" is Body
while "else" is Rlist, and the inliner processes Rlist first.

The order of processing changes the order of inlining decisions,
which can affect which functions are inlined, but in general
won't affect much. (It's not like we know that we should prefer
to inline functions in else bodies over then bodies.)

Swapping these is not safe for toolstash -cmp.
Doing it in a separate CL lets the upcoming CLs all be toolstash-safe.

Change-Id: Id16172849239b0564930d2bbff1260ad6d03d5ab
Reviewed-on: https://go-review.googlesource.com/c/go/+/275308
Trust: Russ Cox <rsc@golang.org>
Run-TryBot: Russ Cox <rsc@golang.org>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
src/cmd/compile/internal/gc/inl.go