This is an archive of the discontinued LLVM Phabricator instance.

[Attributor] Change AANoUndef not to deduce noundef for dead returned positions
AbandonedPublic

Authored by okura on Aug 22 2020, 5:27 AM.

Details

Summary

When a returned position is dead, returned values will be replaced with undef values by AAIsDead.
Therefore we should not deduce noundef for the position. Otherwise, AAUndefinedBehavior caught that and replace them with unreachable incorrectly.

Diff Detail

Event Timeline

okura created this revision.Aug 22 2020, 5:27 AM
Herald added a reviewer: homerdin. · View Herald Transcript
Herald added a project: Restricted Project. · View Herald Transcript
okura requested review of this revision.Aug 22 2020, 5:27 AM
sstefan1 accepted this revision.Aug 22 2020, 7:41 AM

LGTM, thanks!

@jdoerfert ?

This revision is now accepted and ready to land.Aug 22 2020, 7:41 AM

When I fix the identification of AANoUndef in identifyDefaultAbstractAttributes, I noticed that noundef should not be deduced for dead argument and dead call site argument position too. (I found wrong transformation in e.g. callbacks.ll)
Not to deduce for dead positions, we should not indicate optimistic fixpoint in initialize because once fixpoint is indicated we cannot change the state. However, it weakens the deduction significantly.
So I want to suggest that we check not only noundef but also liveness in AAUndefinedBehavior.

When I fix the identification of AANoUndef in identifyDefaultAbstractAttributes, I noticed that noundef should not be deduced for dead argument and dead call site argument position too. (I found wrong transformation in e.g. callbacks.ll)
Not to deduce for dead positions, we should not indicate optimistic fixpoint in initialize because once fixpoint is indicated we cannot change the state. However, it weakens the deduction significantly.
So I want to suggest that we check not only noundef but also liveness in AAUndefinedBehavior.

I don't understand the comment.

Should we check in the manifest of AANoUndef if the position is dead and not manifest it? I'm not sure we necessarily call updateImpl before with a known dead state, so this approach might not always work.

jdoerfert requested changes to this revision.Aug 25 2020, 10:32 AM

(change status so it shows up on my review list again)

This revision now requires changes to proceed.Aug 25 2020, 10:32 AM
okura added a comment.Aug 26 2020, 6:10 AM

When I fix the identification of AANoUndef in identifyDefaultAbstractAttributes, I noticed that noundef should not be deduced for dead argument and dead call site argument position too. (I found wrong transformation in e.g. callbacks.ll)
Not to deduce for dead positions, we should not indicate optimistic fixpoint in initialize because once fixpoint is indicated we cannot change the state. However, it weakens the deduction significantly.
So I want to suggest that we check not only noundef but also liveness in AAUndefinedBehavior.

I don't understand the comment.
Should we check in the manifest of AANoUndef if the position is dead and not manifest it?

I investigated the problem seen in the module slice patch again. And I realize now that checking liveness in manifestation is sufficient to settle the problem.
I misunderstood we need more things to do so. I was overthinking, sorry.

I will abandon this revision because I have made D86565 for the problem.

okura abandoned this revision.Aug 27 2020, 2:04 PM