[InlineFunction] Handle return attributes on call within inlined body
authorAnna Thomas <anna@azul.com>
Sun, 22 Mar 2020 17:59:10 +0000 (13:59 -0400)
committerAnna Thomas <anna@azul.com>
Tue, 31 Mar 2020 18:35:40 +0000 (14:35 -0400)
commit28518d9ae39ff5c6044e230d58b6ae28b0252cae
treea2059ed648bbfa547d6dbf57c0d01e6bcfb72c2b
parent128c0d037d32c929c58d63fd7f324038430f73ba
[InlineFunction] Handle return attributes on call within inlined body

Consider a callee function that has a call (C) within it which feeds
into the return.  When we inline that callee into a callsite that has
return attributes, we can backward propagate those attributes to the
call (C) within that inlined callee body.

This is safe to do so only if we can guarantee transfer of execution to
successor in the window of instructions between return value (i.e. the
call C) and the return instruction.

See added test cases.

Reviewed-By: reames, jdoerfert
Differential Revision: https://reviews.llvm.org/D76140
clang/test/CodeGen/builtins-systemz-zvector.c
clang/test/CodeGen/builtins-systemz-zvector2.c
clang/test/CodeGen/movbe-builtins.c
clang/test/CodeGen/rot-intrinsics.c
llvm/lib/Transforms/Utils/InlineFunction.cpp
llvm/test/Transforms/Inline/ret_attr_update.ll [new file with mode: 0644]