]> Cypherpunks repositories - gostls13.git/commit
cmd/compile: add more runtime funcs to inline test
authorDaniel Martí <mvdan@mvdan.cc>
Fri, 22 Sep 2017 11:21:36 +0000 (12:21 +0100)
committerDaniel Martí <mvdan@mvdan.cc>
Fri, 22 Sep 2017 17:19:01 +0000 (17:19 +0000)
commitf366379d847274158bd14e160c85c7e2bc0f2bc1
tree7d88bbf85dc3dbc9e925390a0345d84735990ce5
parent6db697950eeab6d6ea4076bd97f6572918a2d5a7
cmd/compile: add more runtime funcs to inline test

This is based from a list that Keith Randall provided in mid-2016. These
are all funcs that, at the time, were important and small enough that
they should be clearly inlined.

The runtime has changed a bit since then. Ctz16 and Ctz8 were removed,
so don't add them. stringtoslicebytetmp was moved to the backend, so
it's no longer a Go function. And itabhash was moved to itabHashFunc.

The only other outlier is adjustctxt, which is not inlineable at the
moment. I've added a TODO and will address it myself in a separate
commit.

While at it, error if any funcs in the input table are duplicated.
They're never useful and typos could lead to unintentionally thinking a
function is inlineable when it actually isn't.

And, since the lists are getting long, start sorting alphabetically.

Finally, rotl_31 is only defined on 64-bit architectures, and the added
runtime/internal/sys funcs are assembly on 386 and thus non-inlineable
in that case.

Updates #21851.

Change-Id: Ib99ab53d777860270e8fd4aefc41adb448f13662
Reviewed-on: https://go-review.googlesource.com/65351
Run-TryBot: Daniel Martí <mvdan@mvdan.cc>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
Reviewed-by: Keith Randall <khr@golang.org>
src/cmd/compile/internal/gc/inl_test.go