[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
Loading
Please sign in to comment