This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: One line performance tweak
>>>>> "Zack" == Zack Weinberg <zackw@Stanford.EDU> writes:
Zack> Unfortunately I don't see any easy way to speed up
Zack> fixup_var_refs. It scans the entire insn chain looking for
The basic problem is that it is O(n^2). The hash table was a thing I
did so that when we call fixup_var_refs during the
addressof-elimination pass it becomes linear time. Conceptually, what
we should do is postpone fixing up things until after all RTL is
generated -- and then fix everything at once. That will eliminate the
O(n^2) behavior. Unfortunately, that's non-trivial -- but if you can
figure out how to do it, that would be great. This quadratic behavior
will affect any large (in terms of number of INSNs) function.
--
Mark Mitchell mark@codesourcery.com
CodeSourcery, LLC http://www.codesourcery.com