[all-commits] [llvm/llvm-project] 1479cd: [ThinLTO] Compile time improvement to propagateAtt...
Teresa Johnson via All-commits
all-commits at lists.llvm.org
Fri Jul 31 10:54:31 PDT 2020
Branch: refs/heads/master
Home: https://github.com/llvm/llvm-project
Commit: 1479cdfe4ff603e7b0140dab3ca08ff095473cbd
https://github.com/llvm/llvm-project/commit/1479cdfe4ff603e7b0140dab3ca08ff095473cbd
Author: Teresa Johnson <tejohnson at google.com>
Date: 2020-07-31 (Fri, 31 Jul 2020)
Changed paths:
M llvm/lib/IR/ModuleSummaryIndex.cpp
M llvm/lib/Transforms/IPO/FunctionImport.cpp
Log Message:
-----------
[ThinLTO] Compile time improvement to propagateAttributes
I found that propagateAttributes was ~23% of a thin link's run time
(almost 4x higher than the second hottest function). The main reason is
that it re-examines a global var each time it is referenced. This
becomes unnecessary once it is marked both non read only and non write
only. I added a set to avoid doing redundant work, which dropped the
runtime of that thin link by almost 15%.
I made a smaller efficiency improvement (no measurable impact) to skip
all summaries for a VI if the first copy is dead. I added an assert to
ensure that all copies are dead if any is. The code in
computeDeadSymbols marks all summaries for a VI as live. There is one
corner case where it was skipping marking an alias as live, that I
fixed. However, since the code earlier marked all copies of a preserved
GUID's VI as live, and each 'visit' marks all copies live, the only case
where this could make a difference is summaries that were marked live
when they were built initially, and that is only a few special compiler
generated symbols and inline assembly symbols, so it likely is never
provoked in practice.
Differential Revision: https://reviews.llvm.org/D84985
More information about the All-commits
mailing list