This is an archive of the discontinued LLVM Phabricator instance.

[Attributor] Fix AANoUndef initialization
ClosedPublic

Authored by okura on Sep 1 2020, 3:27 PM.

Details

Summary

When the associated value is undef, we immediately forced to indicate a pessimistic fixpoint so far.
This patch changes the initialization to check the attribute given in IR at first and to indicate an optimistic fixpoint when it is given.
This change will enable us to catch , for example, the following case in AAUB.

call void @foo(i32 noundef undef)

Diff Detail

Event Timeline

okura created this revision.Sep 1 2020, 3:27 PM
Herald added a reviewer: homerdin. · View Herald Transcript
Herald added a project: Restricted Project. · View Herald Transcript
okura requested review of this revision.Sep 1 2020, 3:27 PM
jdoerfert added inline comments.Sep 1 2020, 5:55 PM
llvm/lib/Transforms/IPO/AttributorAttributes.cpp
7797

can we move the AANoUndef::initialize(A); unconditionally to the beginning of this function?

okura added inline comments.Sep 1 2020, 10:52 PM
llvm/lib/Transforms/IPO/AttributorAttributes.cpp
7797

I think we cannot because IRAttribute::initialize indicates an optimistic fixpoint when the associated value is undef.

This revision is now accepted and ready to land.Sep 1 2020, 11:21 PM
This revision was automatically updated to reflect the committed changes.