This is an archive of the discontinued LLVM Phabricator instance.

[Attributor] Deduce memory behavior
ClosedPublic

Authored by jdoerfert on Sep 9 2019, 8:06 PM.

Details

Summary

Deduce the memory behavior, aka "read-none", "read-only", or
"write-only", for functions and arguments.

Event Timeline

jdoerfert created this revision.Sep 9 2019, 8:06 PM
Herald added a project: Restricted Project. · View Herald TranscriptSep 9 2019, 8:06 PM

Overall, I think the logic is sound.

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

It is based on the explicit rule that SubsumingPositionIterator must iterate the corresponding IRPosition first. I think you should mention this rule somewhere in SubsumingPositionIterator implementation or header.

3228–3230

style: remove bracket

3306–3312

Maybe it is necessary to look at other atomic memory instructions also.

jdoerfert marked 3 inline comments as done.Sep 19 2019, 3:02 PM

Any other objects or requests?

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

I will make the behavior of the flag in the header clear and add a comment here.

3228–3230

will do

3306–3312

I will add a TODO. We should eventually have all instructions explicit here.

uenoku accepted this revision.Sep 20 2019, 6:52 AM

Any other objects or requests?

I don't have. It's LGTM.

This revision is now accepted and ready to land.Sep 20 2019, 6:52 AM
This revision was automatically updated to reflect the committed changes.