RESOLVED WONTFIX92249
Auto-vectorize compiler hint
https://bugs.webkit.org/show_bug.cgi?id=92249
Summary Auto-vectorize compiler hint
Allan Sandfeld Jensen
Reported 2012-07-25 07:13:18 PDT
GCC has the ability to perform auto-vectorization, but only does so at -O3 or when explicitly told to. If we add a flag that tells GCC to perform auto-vectorization on specific functions, we can enabled it on those functions alone that would benifit from it, and thereby do not risk the potential binary bloat or performance degradation that can come from using -O3 indiscriminately.
Attachments
Patch (44.32 KB, patch)
2012-07-25 07:15 PDT, Allan Sandfeld Jensen
no flags
Patch (44.45 KB, patch)
2012-07-25 08:41 PDT, Allan Sandfeld Jensen
benjamin: review-
Allan Sandfeld Jensen
Comment 1 2012-07-25 07:15:08 PDT
WebKit Review Bot
Comment 2 2012-07-25 07:51:55 PDT
Comment on attachment 154346 [details] Patch Attachment 154346 [details] did not pass chromium-ews (chromium-xvfb): Output: http://queues.webkit.org/results/13343275
Allan Sandfeld Jensen
Comment 3 2012-07-25 08:09:05 PDT
(In reply to comment #2) > (From update of attachment 154346 [details]) > Attachment 154346 [details] did not pass chromium-ews (chromium-xvfb): > Output: http://queues.webkit.org/results/13343275 Internal compiler error? Jeebers.. Update your compiler, guys! I guess I can add a check to only enable this on GCC 4.6 or newer.
Allan Sandfeld Jensen
Comment 4 2012-07-25 08:41:48 PDT
Allan Sandfeld Jensen
Comment 5 2012-08-06 05:17:03 PDT
I should add that the patches landed for bug #91398 and bug #92123 depends on this patch to take full advantage of their improvements.
Eric Seidel (no email)
Comment 6 2012-08-07 15:59:19 PDT
This seems like a lot of use of this function. Are each of these a win? If so, how much? Just like LIKELY and UNLIKELY, I would expect we'd only want to use this on hot code paths where we new it to be a win. Otherwise we're just setting ourselves up for overly constrained/confused compilers in the future.
Allan Sandfeld Jensen
Comment 7 2012-08-08 01:16:03 PDT
(In reply to comment #6) > This seems like a lot of use of this function. Are each of these a win? If so, how much? Just like LIKELY and UNLIKELY, I would expect we'd only want to use this on hot code paths where we new it to be a win. Otherwise we're just setting ourselves up for overly constrained/confused compilers in the future. I thought this was actually very little use at this point, this is only eight places. Two of the places just has many variant versions of the inner function.
Benjamin Poulain
Comment 8 2013-04-16 12:51:33 PDT
Comment on attachment 154368 [details] Patch Because it disable the inlining, it is not a win-or-neutral situation, you can easily get slower by adding the attribute. I think it is best to enable it on a case by case basis by backing it with the benchmark numbers.
Allan Sandfeld Jensen
Comment 9 2013-04-16 13:38:06 PDT
(In reply to comment #8) > (From update of attachment 154368 [details]) > Because it disable the inlining, it is not a win-or-neutral situation, you can easily get slower by adding the attribute. > > I think it is best to enable it on a case by case basis by backing it with the benchmark numbers. Yes. I had some discussion on the gcc mailing list over the issue. The didn't recommend trying to enable optimization for individual functions. Using PRAGMAs will not work either. At best we could identify files and enable extra optimization on a file by file basis. Sorry that I forgot to close the bug.
Note You need to log in before you can comment on or make changes to this bug.