[all-commits] [llvm/llvm-project] 8aee28: [IR] remove assert since always_inline can appear ...
Nick Desaulniers via All-commits
all-commits at lists.llvm.org
Mon Jun 28 13:59:29 PDT 2021
Branch: refs/heads/main
Home: https://github.com/llvm/llvm-project
Commit: 8aee282f57f42773570fc5d29f03a03361ff7fb4
https://github.com/llvm/llvm-project/commit/8aee282f57f42773570fc5d29f03a03361ff7fb4
Author: Nick Desaulniers <ndesaulniers at google.com>
Date: 2021-06-28 (Mon, 28 Jun 2021)
Changed paths:
M llvm/docs/LangRef.rst
M llvm/lib/IR/Attributes.cpp
M llvm/test/Transforms/Inline/inline_nossp.ll
Log Message:
-----------
[IR] remove assert since always_inline can appear on CallBase
I added an assertion in D91816 (documenting behavior added in 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.
Another curiosity is that the always_inline Attribute on Instructions is
only expanded by the inline pass, not the always_inline pass.
Thanks to @pcc on this report when building Android's RunTime (ART)
interpreter.
Reviewed By: pcc, MaskRay
Differential Revision: https://reviews.llvm.org/D104944
More information about the All-commits
mailing list