]> git.ipfire.org Git - thirdparty/gcc.git/commit
rtl-optimization/105028 - fix compile-time hog in form_threads_from_copies
authorRichard Biener <rguenther@suse.de>
Wed, 23 Mar 2022 11:21:32 +0000 (12:21 +0100)
committerRichard Biener <rguenther@suse.de>
Thu, 7 Apr 2022 08:19:43 +0000 (10:19 +0200)
commitb3eb889978c6a28961511bd70f3cc177df54fde7
tree3039772fa7b4ab86d6b4a4d323df3890423c6d60
parentcf6c812718673cbf89bb96fb2427ee9923bf2a90
rtl-optimization/105028 - fix compile-time hog in form_threads_from_copies

form_threads_from_copies processes a sorted array of copies, skipping
those with the same thread and conflicting threads and merging the
first non-conflicting ones.  After that it terminates the loop and
gathers the remaining elements of the array, skipping same thread
copies, re-starting the process.  For a large number of copies this
gathering of the rest takes considerable time and it also appears
pointless.  The following simply continues processing the array
which should be equivalent as far as I can see.

This takes form_threads_from_copies off the profile radar from
previously taking ~50% of the compile-time.

2022-03-23  Richard Biener  <rguenther@suse.de>

PR rtl-optimization/105028
* ira-color.c (form_threads_from_copies): Remove unnecessary
copying of the sorted_copies tail.

(cherry picked from commit 1daa198aafd72925ca8dd8616385f523ff180d4a)
gcc/ira-color.c