[all-commits] [llvm/llvm-project] 9905c3: Inliner: don't mark call sites as 'nounwind' if th...

Nicolai Hähnle via All-commits all-commits at lists.llvm.org
Mon Jul 18 08:29:59 PDT 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 9905c379819fafdc2246bcd24dd7165bd72d7659
      https://github.com/llvm/llvm-project/commit/9905c379819fafdc2246bcd24dd7165bd72d7659
  Author: Nicolai Hähnle <nicolai.haehnle at amd.com>
  Date:   2022-07-18 (Mon, 18 Jul 2022)

  Changed paths:
    M llvm/lib/Transforms/Utils/InlineFunction.cpp
    M llvm/test/Transforms/Coroutines/coro-retcon-once-value.ll
    M llvm/test/Transforms/Inline/noalias-calls-always.ll
    M llvm/test/Transforms/Inline/noalias-calls.ll
    M llvm/test/Transforms/Inline/noalias-cs.ll
    M llvm/test/Transforms/Inline/noalias2.ll
    M llvm/test/Transforms/PhaseOrdering/ARM/arm_mult_q15.ll
    M llvm/test/Transforms/PhaseOrdering/deletion-of-loops-that-became-side-effect-free.ll

  Log Message:
  -----------
  Inliner: don't mark call sites as 'nounwind' if that would be redundant

When F calls G calls H, G is nounwind, and G is inlined into F, then the
inlined call-site to H should be effectively nounwind so as not to lose
information during inlining.

If H itself is nounwind (which often happens when H is an intrinsic), we
no longer mark the callsite explicitly as nounwind. Previously, there
were cases where the inlined call-site of H differs from a pre-existing
call-site of H in F *only* in the explicitly added nounwind attribute,
thus preventing common subexpression elimination.

v2:
- just check CI->doesNotThrow

Differential Revision: https://reviews.llvm.org/D129860




More information about the All-commits mailing list