This is an archive of the discontinued LLVM Phabricator instance.

[funcattrs] Infer writeonly argument attribute
ClosedPublic

Authored by reames on Dec 2 2021, 8:37 AM.

Details

Summary

This change extends the current logic for inferring readonly and readnone argument attributes to also infer writeonly.

This change is deliberately minimal; there's a couple of areas for follow up.

  1. I left out all call handling and thus any benefit from the SCC walk. When examining the test changes, I realized the existing code is imprecise, and am going to fix that in it's own revision before adding in the writeonly handling. (Mostly because updating the tests is hard when I, the human, can't figure out whether the result is correct.)
  2. I left out handling for storing a value (as opposed to storing to a pointer). This should benefit readonly/readnone as well, and applies to a bunch of other instructions. Seemed worth having as a separate review.

Diff Detail

Event Timeline

reames created this revision.Dec 2 2021, 8:37 AM
reames requested review of this revision.Dec 2 2021, 8:37 AM
Herald added a project: Restricted Project. · View Herald TranscriptDec 2 2021, 8:37 AM
aeubanks accepted this revision.Dec 2 2021, 9:56 AM

some clang tests are failing

This revision is now accepted and ready to land.Dec 2 2021, 9:56 AM
This revision was landed with ongoing or failed builds.Dec 2 2021, 1:05 PM
This revision was automatically updated to reflect the committed changes.
Herald added a project: Restricted Project. · View Herald TranscriptDec 2 2021, 1:05 PM