This is an archive of the discontinued LLVM Phabricator instance.

[Attributor] Fix callsite check in AAUndefinedBehavior
ClosedPublic

Authored by okura on Aug 29 2020, 7:13 PM.

Details

Summary

This is the next patch of D86842
When we check noundef attribute violation at callsites, we do not have to require nonnull in the following two cases.

  1. An argument is known to be simplified to undef
  2. An argument is known to be dead

Diff Detail

Event Timeline

okura created this revision.Aug 29 2020, 7:13 PM
Herald added a reviewer: homerdin. · View Herald Transcript
Herald added a project: Restricted Project. · View Herald Transcript
okura requested review of this revision.Aug 29 2020, 7:13 PM
okura updated this revision to Diff 288826.Aug 29 2020, 7:19 PM

delete unnecessary brackets

okura updated this revision to Diff 288829.Aug 29 2020, 8:33 PM

add test

jdoerfert accepted this revision.Aug 29 2020, 8:46 PM

LGTM

llvm/lib/Transforms/IPO/AttributorAttributes.cpp
2050

While you are here, move the isa into the conditional above. No need to create/query an AA if it's not a nullptr.

This revision is now accepted and ready to land.Aug 29 2020, 8:46 PM
okura updated this revision to Diff 288832.Aug 29 2020, 9:15 PM

address comment

This revision was automatically updated to reflect the committed changes.