This is an archive of the discontinued LLVM Phabricator instance.

[funcattrs] Consistently check call site attributes
ClosedPublic

Authored by reames on Apr 16 2021, 2:53 PM.

Details

Summary

This is mostly stylistic cleanup after D100226, but not entirely. When skimming the code, I found one case where we weren't accounting for attributes on the callsite at all. I'm also suspicious we had some latent bugs related to operand bundles (which are supposed to be able to *override* attributes on declarations), but I don't have concrete test cases for those, just suspicions.

Aside: The only case left in the file which directly checks attributes on the declaration is the norecurse logic. I left that because I didn't understand it; it looks obviously wrong, so I suspect I'm misinterpreting the intended semantics of the attribute.

Diff Detail

Event Timeline

reames created this revision.Apr 16 2021, 2:53 PM
reames requested review of this revision.Apr 16 2021, 2:53 PM
Herald added a project: Restricted Project. · View Herald TranscriptApr 16 2021, 2:53 PM
reames retitled this revision from [funcattrs] Consistent check call site attributes to [funcattrs] Consistently check call site attributes.Apr 16 2021, 2:53 PM
nikic added inline comments.Apr 17 2021, 2:48 AM
llvm/test/Transforms/FunctionAttrs/willreturn-callsites.ll
1

Why is the inferattrs here needed now?

reames added inline comments.Apr 19 2021, 9:04 AM
llvm/test/Transforms/FunctionAttrs/willreturn-callsites.ll
1

Because the declarations are only partially annotated, and func-attrs which is an CGSCC pass does not visit declarations, only inferattrs does.

nikic accepted this revision.Apr 19 2021, 11:42 AM

LG

llvm/test/Transforms/FunctionAttrs/willreturn-callsites.ll
1

I'd personally prefer to add the missing nofree attributes to the declarations, so this only tests one pass. But I'm okay either way...

This revision is now accepted and ready to land.Apr 19 2021, 11:42 AM
This revision was automatically updated to reflect the committed changes.