This is an archive of the discontinued LLVM Phabricator instance.

[ELF] - Remove CIE if all FDEs referencing it were removed (.eh_frame).
AbandonedPublic

Authored by grimar on Jun 24 2016, 8:30 AM.

Details

Reviewers
ruiu
rafael
Summary

About 7 month ago we had a patch D15564 ("[ELF] - Optimize .eh_frame section: remove
CIE if all FDEs referencing it were removed."). It was committed but then reverted.
I didn't commit a piece of code and testcase did not catxh this, I wanted to improve it before
recommit.
But nowadays this patch seems to be few lines trivial. And I think it is ok now.

Diff Detail

Event Timeline

grimar updated this revision to Diff 61797.Jun 24 2016, 8:30 AM
grimar retitled this revision from to [ELF] - Remove CIE if all FDEs referencing it were removed (.eh_frame)..
grimar updated this object.
grimar added reviewers: ruiu, rafael.
grimar added subscribers: llvm-commits, grimar.
ruiu edited edge metadata.Jun 24 2016, 9:30 PM

It may be a good change, but honestly do we care about this case? How realistic is it?

In D21687#467147, @ruiu wrote:

It may be a good change, but honestly do we care about this case? How realistic is it?

Since that was really long time ago, I do not remember my motivation to prepare this patch.
That is something what gold do for sure. Let me perform some investigation about
this then to find how much that is usefull.

grimar abandoned this revision.Jun 28 2016, 8:57 AM

Looks that is not useful. I tried to selflink clang and lld with and without this change and size of .eh_frame did not change for me.

davide added a subscriber: davide.Jun 28 2016, 1:25 PM

I wouldn't jump to conclusions too quickly. I don't think clang uses exceptions (at least I haven't seen any use of that).
Also, even if I'm wrong about clang, I'd rather test multiple programs (finding some which (ab)use exceptions) before deciding if this feature is "useful" or not.
I bet it will be, FWIW.

I wouldn't jump to conclusions too quickly. I don't think clang uses exceptions (at least I haven't seen any use of that).
Also, even if I'm wrong about clang, I'd rather test multiple programs (finding some which (ab)use exceptions) before deciding if this feature is "useful" or not.
I bet it will be, FWIW.

I`ll try to find something to perform more tests for this a bit later.

ruiu added a comment.Jun 29 2016, 5:28 AM

This is not important, I think. CIE records are small, and we have only one CIE for each input file, so removing them wound't save that much space.