[PATCH] D129860: Inliner: don't mark call sites as 'nounwind' if that would be redundant

Nicolai Hähnle via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Jul 15 08:18:12 PDT 2022


nhaehnle created this revision.
nhaehnle added reviewers: rnk, foad.
Herald added a subscriber: hiraditya.
Herald added a project: All.
nhaehnle requested review of this revision.
Herald added a project: LLVM.

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.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D129860

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

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D129860.444990.patch
Type: text/x-patch
Size: 13878 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220715/b1703df5/attachment.bin>


More information about the llvm-commits mailing list