Page MenuHomePhabricator

[Attributor] Liveness for values

Authored by jdoerfert on Oct 13 2019, 1:13 AM.



This patch introduces liveness (AAIsDead) for all positions, thus for
all kinds of values. For now, we say an instruction is dead if it would
be removed assuming all users are dead. A call site return is different
as we just look at the users. If all call site returns have been
eliminated, the return values can return undef instead of their original
value, eliminating uses.

We try to recursively delete dead instructions now and we introduce a
simple check-like interface for use-traversal.

More explicit tests will be added.

This is the idea tried out in D68626 but implemented in the right way.

Diff Detail

Event Timeline

jdoerfert created this revision.Oct 13 2019, 1:13 AM
Herald added a project: Restricted Project. · View Herald TranscriptOct 13 2019, 1:13 AM
jdoerfert updated this revision to Diff 224772.Oct 13 2019, 1:24 AM

Non-exact functions fix + more tests

Minor updates and fixes

Some comments


nit: isAssumedDead()


Should this still be here, considering changes from D68934?


Can we have a value parameter here that maybe defaults to nullptr. In the default case we take AssociatedValue and in others the value parameter? Maybe this is not the best solution, but for example, h2s doesn't work with AssociatedValue.

jdoerfert marked 2 inline comments as done.Oct 14 2019, 12:06 PM
jdoerfert added inline comments.

I think D68934 replaces all this, I will undo this change here.


Sure, we don't even need a default. Though we can also do this after the patch. I'll change the interface now here though.

sstefan1 accepted this revision.Oct 14 2019, 1:21 PM

LGTM then!

This revision is now accepted and ready to land.Oct 14 2019, 1:21 PM
This revision was automatically updated to reflect the committed changes.