[PATCH] D70366: Add new 'flatten' LLVM attribute to fix clang's 'flatten' function attribute
    Johannes Doerfert via Phabricator via cfe-commits 
    cfe-commits at lists.llvm.org
       
    Wed Apr  8 16:52:22 PDT 2020
    
    
  
jdoerfert added a comment.
In D70366#1970526 <https://reviews.llvm.org/D70366#1970526>, @dexonsmith wrote:
> In D70366#1970299 <https://reviews.llvm.org/D70366#1970299>, @LevitatingLion wrote:
>
> > Maybe we can add an additional string attribute when adding the noinline attribute to functions which are not marked noinline in the source code, something like "noinline-added-by-clang". I don't know if that's a legitimate use case for a string attribute, but it wouldn't be very invasive. What do you think?
>
>
> Another option (not sure if it's better) would be to add a `noopt` LLVM attribute that Clang adds for `-O0` instead of `noinline`.  Two possibilities would be to update the inliner to pay attention to that as well (with special logic for `flatten`), or to change the always-inliner to add `noinline` to anything marked `noopt`.
`noopt == optnone`? Both `optnone` and `noinline` are set in O0, so we could just not place `noinline` (I think).
CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D70366/new/
https://reviews.llvm.org/D70366
    
    
More information about the cfe-commits
mailing list