[PATCH] D150396: [InlineCost] Check for conflicting target attributes early
Teresa Johnson via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu May 11 13:49:39 PDT 2023
tejohnson added inline comments.
================
Comment at: llvm/lib/Analysis/InlineCost.cpp:2935
// always-inline attribute).
- Function *Caller = Call.getCaller();
- if (!functionsHaveCompatibleAttributes(Caller, Callee, CalleeTTI, GetTLI))
+ if (!functionsHaveCompatibleAttributes(Caller, Callee, GetTLI))
return InlineResult::failure("conflicting attributes");
----------------
kazu wrote:
> tejohnson wrote:
> > Can we move this above the always inline handling and put the new checking in here?
> Could you elaborate this comment a little bit? I am not sure what you mean by "put the new checking in here".
>
> This patch essentially peels the `CalleeTTI.areInlineCompatible` check off of `functionsHaveCompatibleAttributes`. If we are moving the rest of `functionsHaveCompatibleAttributes` above the always inline handling, then we might just call the original unmodified `functionsHaveCompatibleAttributes` above the always inline handling.
Oh I see that it is being removed from functionsHaveCompatibleAttributes. It seems better to simply move the functionsHaveCompatibleAttributes checking above the always inline handling. I don't know the history here though - were you able to figure out why always inline functions skip this checking?
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D150396/new/
https://reviews.llvm.org/D150396
More information about the llvm-commits
mailing list