[PATCH] D102726: [IR][AutoUpgrade] Drop alignment from non-pointer parameters and returns

Duncan P. N. Exon Smith via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri May 21 17:49:45 PDT 2021


dexonsmith added a comment.

In D102726#2774689 <https://reviews.llvm.org/D102726#2774689>, @jdoerfert wrote:

> In D102726#2774657 <https://reviews.llvm.org/D102726#2774657>, @nikic wrote:
>
>> FYI, this change causes a non-trivial compile-time regression in LTO builds: https://llvm-compile-time-tracker.com/compare.php?from=136ced498ba84f6b6126051626e319f18ba740f5&to=5b6cae5524905bc43cfc21a515f828528d1f2e68&stat=instructions (Worst regression seems to be the ThinLTO kc.link step, which is up 4%.)
>>
>> LLVM attributes are optimized for immutable usage, and it's hard to overstate just how slow the mutable APIs on them are...
>
> I suggested not to check for attributes just to remove them. I still think that's the right thing *but* we can check for them in the remove functions.
> @nikic you think that will resolve the compile time issue?

Three other ideas, which can all be applied, but the compile time regression might be fixed without doing them all:

1. Serialize somewhere an "attribute list version", which can be used to skip attribute-upgrading entirely if the current and serialized versions match. This avoids any slowdown in the typical LTO case (old archived object files notwithstanding).

2. Keep a map when upgrading from `(AttributeList,FunctionType*)` to `AttributeList` to cache the computation.

3. Construct a new attribute list in bulk rather than going through intermediate states and mutating the old one piecemeal.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D102726/new/

https://reviews.llvm.org/D102726



More information about the llvm-commits mailing list