This is an archive of the discontinued LLVM Phabricator instance.

WIP: experimenting with EH optimizations
Needs ReviewPublic

Authored by GorNishanov on Jun 16 2019, 12:05 PM.

Details

Summary

See companion paper: https://isocpp.org/files/papers/P1676R0.pdf
(or https://wg21.link/p1676 after the mailing is published)

This is not intended for real review. Mostly to keep select few appraised of this effort.

Diff Detail

Event Timeline

GorNishanov created this revision.Jun 16 2019, 12:05 PM
jfb added a comment.Jun 17 2019, 9:09 AM

Tests?

lib/Transforms/IPO/PassManagerBuilder.cpp
348

Nice.

In D63388#1546336, @jfb wrote:

Tests?

Was rushing to the mailing deadline. Will add sometime between now and Cologne.

GorNishanov added a comment.EditedJun 17 2019, 12:34 PM
In D63388#1546335, @jfb wrote:

Mailing has not been published yet. I wonder if this link works?

https://isocpp.org/files/papers/P1676R0.pdf

jfb added a comment.Jun 17 2019, 12:55 PM
In D63388#1546335, @jfb wrote:

Mailing has not been published yet. I wonder if this link works?

https://isocpp.org/files/papers/P1676R0.pdf

Indeed does! Most wonderful, I look forward to optimizations around exception :)

Bigcheese added a subscriber: Bigcheese.

Thanks a lot for working on this. There's a lot of room to improve the performance of exceptions that nobody has done for C++ yet. I've added some reviewers that I'm aware are familiar with the area or that I've talked with about this before.

lib/Transforms/Scalar/CXXSimplifyEH.cpp
624–639

This is a bit concerning. I would much rather either the headers add an attribute saying what they are, or that clang detects what they are and adds an attribute. I don't like llvm interpreting function names.

Also adding the llvm-commits list.

GorNishanov added a comment.EditedJun 17 2019, 1:32 PM

Thanks a lot for working on this. There's a lot of room to improve the performance of exceptions that nobody has done for C++ yet. I've added some reviewers that I'm aware are familiar with the area or that I've talked with about this before.

My apologies for dumping this patch which is very very rough WIP.
I mostly to give a feel of how these optimization might look for those interested.

I hope those who choose to look at it closely would not do more than a cursory look. I intend to do more much more work on it before submitting for real review :-).

GorNishanov edited the summary of this revision. (Show Details)Jun 17 2019, 1:35 PM
GorNishanov added inline comments.Jun 17 2019, 1:40 PM
lib/Transforms/Scalar/CXXSimplifyEH.cpp
624–639

Yes. I am wondering what is the way of tackling the platform/lib specific naming. One approach to take is to add them to TargetLibraryInfo analysis.

On the other hand. Large number of these optimizations are C++ specific, therefore I am not sure if adding them to TLI make sense.

Possibly a dedicated C++EH helper class that collects and maintains the resolved names for all interesting functions related to C++ EH optimizations across platform / stdlib combinations.