]> git.ipfire.org Git - thirdparty/gcc.git/commit
compiler: improve escape analysis on interface conversions
authorian <ian@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 16 May 2019 04:35:15 +0000 (04:35 +0000)
committerian <ian@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 16 May 2019 04:35:15 +0000 (04:35 +0000)
commite007b1ebbb42bf2a7f2808f1da1467d82ed43b76
tree042ec42badf35137c4249ed7ab62797a8a50cf48
parent1f6baa77d829614f2ce0400d9966e1538e43931e
compiler: improve escape analysis on interface conversions

    If an interface does not escape, it doesn't need a heap
    allocation to hold the data (for non-direct interface type).
    This CL improves the escape analysis to track interface
    conversions, and reduces these allocations.

    Implicit interface conversions were mostly added late in the
    compilation pipeline, after the escape analysis. For the escape
    analysis to see them, we move the introduction of these
    conversions earlier, right before the escape analysis.

    Now that the compiler can generate interface conversions inlined,
    gcc/testsuite/go.test/test/nilptr2.go needs to be adjusted as in
    golang.org/cl/176579, so the use function does an actual use.

    Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/176459

* go.test/test/nilptr2.go: Change use function to actually do
something.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@271276 138bc75d-0d04-0410-961f-82ee72b054a4
gcc/go/gofrontend/MERGE
gcc/go/gofrontend/escape.cc
gcc/go/gofrontend/expressions.cc
gcc/go/gofrontend/expressions.h
gcc/go/gofrontend/go.cc
gcc/go/gofrontend/gogo.cc
gcc/go/gofrontend/gogo.h
gcc/go/gofrontend/statements.cc
gcc/go/gofrontend/statements.h
gcc/testsuite/ChangeLog
gcc/testsuite/go.test/test/nilptr2.go