This is an archive of the discontinued LLVM Phabricator instance.

[ThinLTO] Add option to disable readonly/writeonly attribute propagation
ClosedPublic

Authored by tejohnson on Dec 3 2019, 1:59 PM.

Details

Summary

Add an option to allow the attribute propagation on the index to be
disabled, to allow a workaround for issues (such as that fixed by
D70977). Restructure the code to include all attribute propagation
handling into propagateAttributes() itself (rather than having some in
the caller), which also simplifies handling of the new option.

Event Timeline

tejohnson created this revision.Dec 3 2019, 1:59 PM
Herald added a project: Restricted Project. · View Herald TranscriptDec 3 2019, 1:59 PM
steven_wu added inline comments.Dec 4 2019, 3:28 PM
llvm/lib/IR/ModuleSummaryIndex.cpp
166

Do we still need to drop all the readonly writeonly flag if simply return before setWithAttributePropagation()?

tejohnson marked 2 inline comments as done.Dec 5 2019, 1:00 PM
tejohnson added inline comments.
llvm/lib/IR/ModuleSummaryIndex.cpp
166

Good point, this code predated having the WithAttributePropagation flag on the index, which gates its use. I stripped this stale code out, and moved the check of the ImportEnabled back to the caller. I am still moving the setting of the WithAttributePropagation flag into propagateAttributes where I think it makes more sense.

tejohnson updated this revision to Diff 232436.Dec 5 2019, 1:00 PM
tejohnson marked an inline comment as done.

Address comments

steven_wu accepted this revision.Dec 5 2019, 3:11 PM

LGTM!

This revision is now accepted and ready to land.Dec 5 2019, 3:11 PM
This revision was automatically updated to reflect the committed changes.