This is an archive of the discontinued LLVM Phabricator instance.

[Attributor] Use fine-grained liveness in all helpers
ClosedPublic

Authored by jdoerfert on Jan 23 2020, 4:59 PM.

Details

Summary

We used coarse-grained liveness before, thus we looked if the
instruction was executed, but we did not use fine-grained liveness,
hence if the instruction was needed or could be deleted even if the
surrounding ones are live. This patches introduces this level of
liveness checks together with other liveness queries, e.g., for uses.

For more control we enforce that all liveness queries go through the
Attributor.

Test have been adjusted to reflect the changes or augmented to prevent
deletion of the parts we want to check.

Diff Detail

Event Timeline

jdoerfert created this revision.Jan 23 2020, 4:59 PM
Herald added a project: Restricted Project. · View Herald TranscriptJan 23 2020, 4:59 PM

Unit tests: unknown.

clang-tidy: unknown.

clang-format: unknown.

Build artifacts: diff.json, console-log.txt

Pre-merge checks is in beta. Report issue. Please join beta or enable it for your project.

sstefan1 added inline comments.Jan 27 2020, 1:33 AM
llvm/lib/Transforms/IPO/Attributor.cpp
5751

Why not use just DepClass?

Also, IMO, BlockLivenessOnly isn't very useful name here. Not sure what would be the best name, though. Maybe CheckFnLivenessOnly

5787

typo: liveness

jdoerfert marked an inline comment as done.Jan 29 2020, 12:32 PM
jdoerfert added inline comments.
llvm/lib/Transforms/IPO/Attributor.cpp
5751

Why not use just DepClass?

Good question. That might just work, I'll try it and adopt it silently if it does ;)

Also, IMO, BlockLivenessOnly isn't very useful name here. Not sure what would be the best name, though. Maybe CheckFnLivenessOnly

I'm not proud of the name... Maybe CheckBBLivenessOnly? I fear FnLiveness is too "coarse".

Address comments and rebase

jdoerfert marked 2 inline comments as done.Feb 10 2020, 10:30 PM
sstefan1 accepted this revision.Feb 12 2020, 6:15 AM

Small question, but LGTM

llvm/lib/Transforms/IPO/Attributor.cpp
5781

Is this needed then?

This revision is now accepted and ready to land.Feb 12 2020, 6:15 AM
jdoerfert marked an inline comment as done.Feb 12 2020, 9:23 AM
jdoerfert added inline comments.
llvm/lib/Transforms/IPO/Attributor.cpp
5781

Leftover I have to remove. Good catch!

This revision was automatically updated to reflect the committed changes.