r261284 - in /trunk/gcc/go/gofrontend: MERGE go...

ian@gcc.gnu.org ian@gcc.gnu.org
Thu Jun 7 16:56:00 GMT 2018


Author: ian
Date: Thu Jun  7 16:56:09 2018
New Revision: 261284

URL: https://gcc.gnu.org/viewcvs?rev=261284&root=gcc&view=rev
Log:
    compiler: speed up variable initializer sorting
    
    The compiler used to do variable initializer sorting by looping
    through all the initialized variables and, for each one, looping
    through all the initialized variables and checking for a dependency.
    For very large packages with thousands of initialized global
    variables, this quadratic loop could take quite a long time.
    
    Change the approach to first loop through all the initialized
    variables and fetch all the references to other variables from the
    initialization code.  Then, loop through them again and this time add
    a dependency for each referenced, initialized, variable, while
    checking for initialization loops.  We still have a nested loop, but
    this time the inner loop should normally be short--just the list of
    referenced variables, not the list of all variables.
    
    Reviewed-on: https://go-review.googlesource.com/116816

Modified:
    trunk/gcc/go/gofrontend/MERGE
    trunk/gcc/go/gofrontend/gogo.cc



More information about the Gcc-cvs mailing list