This is an archive of the discontinued LLVM Phabricator instance.

[funcatts] Rewrite callsite operand handling in memory access inference
AbandonedPublic

Authored by reames on Dec 2 2021, 7:43 PM.

Details

Summary

This is a rewrite of the existing code. It isn't even close to NFC as it fixes several problems with the existing code. Changes detailed below.

  1. Argument attributes on an indirect call site are honored. We'd previously only been honoring these on unknown direct calls, which is just weird.
  2. Consistently treat calling a function pointer as an operation which reads the function pointer. Previously, we gave it different treatment based on which attributes were on the callsite. (e.g. a readonly callsite vs a writeonly callsite changed the intepretation of the function pointer access for an indirect call)
  3. Honor attributes on vararg function declarations when visiting a vararg argument. (Previously, we aborted the entire analysis.)

In addition to the previously described functional changes, the resulting code is both shorter, and easier to follow.

Diff Detail

Event Timeline

reames created this revision.Dec 2 2021, 7:43 PM
reames requested review of this revision.Dec 2 2021, 7:43 PM
Herald added projects: Restricted Project, Restricted Project. · View Herald TranscriptDec 2 2021, 7:43 PM
Herald added a subscriber: cfe-commits. · View Herald Transcript
reames planned changes to this revision.Dec 3 2021, 10:31 AM

Needs reworked over previous patch in stack.

I'm starting to split this into individual pieces with the writeonly dependence removed. The first one handles indirect calls, and is posted as D115916.

D115961 and D115964 were the next two pieces of this, both have now landed.

The last bit is honoring call site parameter attributes on indirect calls outside the SCC. I'll post that separately and then close this review because everything will have been covered.

reames abandoned this revision.Dec 21 2021, 10:07 AM

This has been replaced by a series of smaller patches implementing individual parts.

The last of which - parameter attributes on indirect calls - is out for review as D116118.