This is an archive of the discontinued LLVM Phabricator instance.

(NFC) Track global summary liveness in GVFlags.
ClosedPublic

Authored by eugenis on May 31 2017, 4:06 PM.

Details

Summary

Replace GVFlags::LiveRoot with GVFlags::Live and use that instead of
all the DeadSymbols sets. This is refactoring in order to make
liveness information available in the RegularLTO pipeline

Diff Detail

Repository
rL LLVM

Event Timeline

eugenis created this revision.May 31 2017, 4:06 PM
pcc added inline comments.May 31 2017, 4:39 PM
lib/Transforms/IPO/FunctionImport.cpp
435–436

Can this code be simplified to use a for loop? All it needs to do is add a ValueInfo to the worklist if it sees at least one live summary, right?

439

Can we return if we see at least one live summary? I think there is an invariant in this function that if at least one summary for a GUID is live, all are live.

eugenis updated this revision to Diff 100947.May 31 2017, 5:16 PM
eugenis marked 2 inline comments as done.
pcc added inline comments.May 31 2017, 5:51 PM
lib/Transforms/IPO/FunctionImport.cpp
439

I was thinking just push ValueInfo(&Entry) onto the worklist here. Then you can replace the other call to makeLiveRoot with the loop that sets summaries to live and remove makeLiveRoot entirely.

eugenis added inline comments.Jun 1 2017, 12:49 PM
lib/Transforms/IPO/FunctionImport.cpp
439

But then we also need to do ++LiveSymbols in both places. I'm not sure it's a net win.

pcc added inline comments.Jun 1 2017, 12:52 PM
lib/Transforms/IPO/FunctionImport.cpp
439

We just need to do it here, no? Otherwise we'd end up double counting live roots.

eugenis updated this revision to Diff 101085.Jun 1 2017, 12:52 PM
eugenis added inline comments.
lib/Transforms/IPO/FunctionImport.cpp
439

Oh right, good point.

pcc accepted this revision.Jun 1 2017, 1:18 PM

LGTM

This revision is now accepted and ready to land.Jun 1 2017, 1:18 PM
eugenis closed this revision.Jun 1 2017, 1:30 PM

r304466