[PATCH] D76140: [InlineFunction] update attributes during inlining

Anna Thomas via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Mar 13 14:34:27 PDT 2020


anna added a comment.

hmm. yes, I can see this getting complicated for design and correctness. Thanks for the example @jdoerfert.

Basically, the usecase I'm interested in is the following:

  callee(i8* %arg) {
    %r = call i8* @foo(i8* %arg)
     ret i8* %r
  }

And a follow-on example:

  callee(i8** %arg) {
    %r = load i8*, i8** %arg <-- here we can add the !nonnull metadata if callsite for callee has nonnull return attr
     ret i8* %r
  }

The caller is:

  caller {
    ...
    call nonnull i8* @callee(i8** %arg) 
  }

AFAICT, this should be fine because the only operations in callee context is the load and return. We are not backward propagating something incorrect into the callee context. W.r.t the caller context, what was true before inlining, remains true after inlining as well.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D76140





More information about the llvm-commits mailing list