This is an archive of the discontinued LLVM Phabricator instance.

[Attributor] Deduction based on recursive path exploration
Changes PlannedPublic

Authored by uenoku on Mar 10 2020, 7:21 AM.

Details

Summary

This is the next patch of D65593. This patch enables us to explore must-be-executed-context recursively.

Diff Detail

Event Timeline

uenoku created this revision.Mar 10 2020, 7:21 AM
Herald added a project: Restricted Project. · View Herald TranscriptMar 10 2020, 7:22 AM
jdoerfert added inline comments.Mar 10 2020, 11:13 AM
llvm/lib/Transforms/IPO/Attributor.cpp
1067

Nit: Move right after follow uses in ctx.

llvm/test/Transforms/Attributor/dereferenceable-1.ll
451

We should investigate if it is sound to use assumed information in the exploration to catch this case.

jdoerfert added inline comments.Mar 10 2020, 11:33 AM
llvm/lib/Transforms/IPO/Attributor.cpp
1064

What happens if there is a different terminator here? I mean do we handle them all correctly?

uenoku marked 2 inline comments as done.Mar 12 2020, 3:05 AM
uenoku added inline comments.
llvm/lib/Transforms/IPO/Attributor.cpp
1064

Does "different terminator" mean like switch or other terminator? If you mean so, I think it can handle such cases.

llvm/test/Transforms/Attributor/dereferenceable-1.ll
451

I feel it is difficult to use assumed information in this deduction scheme.
I'll investigate more but I think it would be really complex reasoning to maintain the soundness.

If we don't consider the cost, I think running Attributor twice will be bug free and effective solution because we can easily use assume information of 1st iteration as known information of 2nd iteration.

uenoku planned changes to this revision.Mar 12 2020, 3:32 AM

This patch traverses the same context multiple times so the cost might get huge.
I'll create something like a cache.

jdoerfert added inline comments.Mar 12 2020, 3:43 PM
llvm/lib/Transforms/IPO/Attributor.cpp
1064

Yes, switch, ret, ..., need to be handled correctly

llvm/test/Transforms/Attributor/dereferenceable-1.ll
451

If we don't consider the cost, I think running Attributor twice will be bug free and effective solution because we can easily use assume information of 1st iteration as known information of 2nd iteration.

I'm not sure I follow but re-running does generally not solve the problem. We need optimistic initialization to solve problems, e.g., the dereferenceable deduction in this test case.

fhahn added a subscriber: fhahn.Jul 14 2020, 4:56 AM