[PATCH] D104944: [IR] remove assert since always_inline can appear on CallBase

Nick Desaulniers via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Jun 25 12:38:06 PDT 2021


nickdesaulniers created this revision.
nickdesaulniers added reviewers: pcc, MaskRay, rnk.
Herald added subscribers: dexonsmith, jdoerfert, hiraditya.
nickdesaulniers requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

I added an assertion in D91816 <https://reviews.llvm.org/D91816> (documenting behavior added in D93422 <https://reviews.llvm.org/D93422>)
that callers and callees with mismatched fn attr's related to stack
protectors should not occur unless the callee was attributed
always_inline.

This falls apart when a call, invoke, or callbr (any instruction
inheriting from CallBase) itself has an always_inline attribute. Clang
will emit such attributes on Instructions when __attribute__((flatten))
is used to recursively force inlining from a caller.

Since these assertions only had the caller and callee Functions, and not
the call site (CallBase derived classes), we would have to search the
caller for such instructions to reconstruct the call site information.
But at that point, inlining has already occurred; the call site has
already been removed from the caller.

Remove the assertions, add a unit test for always_inline call sites, and
update the LangRef.

Thanks to @pcc on this report when building Android's RunTime (ART)
interpreter.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D104944

Files:
  llvm/docs/LangRef.rst
  llvm/lib/IR/Attributes.cpp
  llvm/test/Transforms/Inline/inline_nossp.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D104944.354582.patch
Type: text/x-patch
Size: 5140 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210625/527a1b41/attachment.bin>


More information about the llvm-commits mailing list