[PATCH] D101011: [Attr] Add "noipa" function attribute

David Blaikie via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Apr 22 12:21:54 PDT 2021


dblaikie added a comment.

In D101011#2709808 <https://reviews.llvm.org/D101011#2709808>, @xbolva00 wrote:

>>> so the output IR is different from the input IR
>
> No I dont mean input IR. I mean
>
>   int foo(int x) __attribute__((noipa)) {
>       return x * 2;
>   }
>   
>   int a(int x) {
>       return foo(x);
>   }
>
> Clang would codegen:
>
>   define dso_local i32 @foo(i32 %0) #0 {
>     %2 = shl nsw i32 %0, 1
>     ret i32 %2
>   }
>   
>   attributes #0 = { noipa noinline }
>
> WDYT?

Oh, sure - that'll happen in Clang (& I agree it should be done - both to match the GCC behavior, and because it seems like good behavior/likely what the user expects regardless), not in this LLVM patch,.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D101011/new/

https://reviews.llvm.org/D101011



More information about the llvm-commits mailing list