This is an archive of the discontinued LLVM Phabricator instance.

[Attributor] Allow lookupAAFor to return null on invalid state
ClosedPublic

Authored by jhuber6 on Jun 2 2021, 2:35 PM.

Details

Summary

This patch adds an option to lookupAAFor that allows it to return a
nullptr if the state of the looked up attribute is invalid. This is so
future passes can use this to query other attributes with the guarantee
that they are valid.

Diff Detail

Event Timeline

jhuber6 created this revision.Jun 2 2021, 2:35 PM
jhuber6 requested review of this revision.Jun 2 2021, 2:35 PM
Herald added a reviewer: baziotis. · View Herald Transcript
Herald added a project: Restricted Project. · View Herald Transcript
jhuber6 updated this revision to Diff 349383.Jun 2 2021, 2:35 PM

Forgot to format

I'd change the default and pass a non-default value in getAAFor

jhuber6 updated this revision to Diff 349396.Jun 2 2021, 3:17 PM

Changing default.

jdoerfert accepted this revision.Jun 4 2021, 7:12 AM

LG, one nit

llvm/include/llvm/Transforms/IPO/Attributor.h
1140–1141

/* AllowInvalidState */

This revision is now accepted and ready to land.Jun 4 2021, 7:12 AM