Skip to content

Commit 87f2f66

Browse files
committed
[ThinLTO] optimize propagateAttributes performance
ModuleSummaryIndex::propagateAttributes() was observed to take about 25 minutes to complete on a ThinLTO application. Profiling revealed that the majority of this time was spent operating on the MarkedNonReadWriteOnly set. By improving the hashing quality for ValueInfo, the execution time is dramatically reduced to less than 10 seconds.
1 parent 3086546 commit 87f2f66

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

llvm/include/llvm/IR/ModuleSummaryIndex.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -300,7 +300,7 @@ template <> struct DenseMapInfo<ValueInfo> {
300300
assert(isSpecialKey(L) || isSpecialKey(R) || (L.haveGVs() == R.haveGVs()));
301301
return L.getRef() == R.getRef();
302302
}
303-
static unsigned getHashValue(ValueInfo I) { return (uintptr_t)I.getRef(); }
303+
static unsigned getHashValue(ValueInfo I) { return hash_value(I.getRef()); }
304304
};
305305

306306
// For optional hinted size reporting, holds a pair of the full stack id

0 commit comments

Comments
 (0)