Page MenuHomePhabricator

[Attributor] Pointer privatization attribute (argument promotion)
Needs ReviewPublic

Authored by jdoerfert on Oct 10 2019, 7:36 PM.



A pointer is privatizeable if it can be replaced by a new, private one.
Privatizing pointer reduces the use count, interaction between unrelated
code parts. This is a first step towards replacing argument promotion.
While we can already handle recursion (unlike argument promotion!) we
are restricted to stack allocations for now because we do not analyze
the uses in the callee.

All argument promotion test now run the Attributor as well.

Event Timeline

jdoerfert created this revision.Oct 10 2019, 7:36 PM
Herald added a project: Restricted Project. · View Herald TranscriptOct 10 2019, 7:36 PM

I went through all the tests, added mem2reg/sroa where approriate and modified the source sometimes, mostly to avoid UB. I think the results of the Attributor look good, all problems should have been addressed already.

lebedev.ri added inline comments.Oct 16 2019, 11:59 AM

This is why i'm really pushing on using --check-prefixes=ALL,ARGPROMOTION from the getgo :[


I strongly believe you want to precommit test changes+regeneration first.

jdoerfert marked 2 inline comments as done.
jdoerfert added inline comments.



I will update the test lines after the D68766 update. Do you want me to split test changes, e.g., that remove UB, as well?

Update the tests

jdoerfert updated this revision to Diff 227335.Oct 31 2019, 1:41 PM

Update tests