This is an archive of the discontinued LLVM Phabricator instance.

[TTI][Sink] Add target support for sinking more reads
AbandonedPublic

Authored by critson on Oct 3 2022, 4:04 AM.

Details

Summary

Allow target to indicate some reads may be sunk along critical
edges. This is useful for applications which have invariant
data loads or can establish apriori absence of memory writes.

Diff Detail

Event Timeline

critson created this revision.Oct 3 2022, 4:04 AM
Herald added a project: Restricted Project. · View Herald TranscriptOct 3 2022, 4:04 AM
critson requested review of this revision.Oct 3 2022, 4:04 AM
Herald added a project: Restricted Project. · View Herald TranscriptOct 3 2022, 4:04 AM
foad added inline comments.Oct 3 2022, 4:44 AM
llvm/lib/Transforms/Scalar/Sink.cpp
84

Why not check MD_invariant_load directly here, rather than forcing every target to check it in their own canAlwaysSinkRead hook?

arsenm added a subscriber: arsenm.Oct 3 2022, 10:14 AM
arsenm added inline comments.
llvm/lib/Transforms/Scalar/Sink.cpp
84

I agree, I don't see why this needs to be a target hook. We already have AA checks for invariant memory

critson abandoned this revision.Oct 4 2022, 1:03 AM

Logically I'd like some kind of control over the sinking process, but I guess that can be handled by removing invariant metadata as appropriate.

-> D135133