[PATCH] D37626: [ELF] Scan .eh_frame sections precisely in order to eliminate unused LSDAs and personality routines.

Igor Kudrin via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Oct 26 05:02:06 PDT 2017


ikudrin marked 3 inline comments as done.
ikudrin added a comment.

I believe that the complexity in both cases is similar. Here we have two kinds of edges with distinct traversal functions. There we have to convert these edges in advance so that we can use only one traversal function. And distinct traversal function is not that different from the conversion function. But conversion always requires additional space and time to store edges, while the traversal function might be called several times. But my opinion might be biased.



================
Comment at: ELF/MarkLive.cpp:269-271
+  // The flag is set if an executable section is added to the queue.
+  // We scan .eh_frame sections only if the flag is set.
+  bool ExecInQueue = false;
----------------
ruiu wrote:
> ikudrin wrote:
> > ruiu wrote:
> > > Isn't this a premature optimization? I wouldn't add this unless it is proved to be actually effective.
> > I don't think so. It really helps to avoid the second scan of EH frames in most cases.
> But how much time you can save? I feel like we shouldn't optimize it at the moment.
According to my tests, with this optimization the execution time of `doGcSections()` becomes about 1% longer if the linked program does not use EH (like `clang`) and about 2.5% shorter in the other case (like `omnetpp`). The effect is not significant, so I've removed it.


https://reviews.llvm.org/D37626





More information about the llvm-commits mailing list