[SimplifyCFG] When eliminating `unreachable` landing pads, mark `call`s as `nounwind`
authorRoman Lebedev <lebedev.ri@gmail.com>
Thu, 12 Jan 2023 21:05:19 +0000 (00:05 +0300)
committerRoman Lebedev <lebedev.ri@gmail.com>
Thu, 12 Jan 2023 21:41:58 +0000 (00:41 +0300)
commit3c5b1f2d94d021005ce3769a4402d4a4ae843989
treed4edd4ac4633efe13accb33a2aef6271311a22a1
parenta5c23d55842a31eb83b7968866e69d1731411580
[SimplifyCFG] When eliminating `unreachable` landing pads, mark `call`s as `nounwind`

We really can't recover that knowledge, and `nounwind` knowledge,
(and not just a lack of the unwind edge, aka `call` instead of `invoke`),
is e.g. part of the reasoning in e.g. `mayHaveSideEffects()`.

Note that this is call-site-specific knowledge,
just because some callsite had an `unreachable`
unwind edge, does not mean that all will.
13 files changed:
llvm/include/llvm/Transforms/Utils/Local.h
llvm/lib/Transforms/Utils/Local.cpp
llvm/lib/Transforms/Utils/SimplifyCFG.cpp
llvm/test/Transforms/SimplifyCFG/2011-09-05-TrivialLPad.ll
llvm/test/Transforms/SimplifyCFG/UnreachableEliminate.ll
llvm/test/Transforms/SimplifyCFG/X86/2010-03-30-InvokeCrash.ll
llvm/test/Transforms/SimplifyCFG/X86/bug-25299.ll
llvm/test/Transforms/SimplifyCFG/X86/empty-cleanuppad.ll
llvm/test/Transforms/SimplifyCFG/empty-catchpad.ll
llvm/test/Transforms/SimplifyCFG/invoke_unwind.ll
llvm/test/Transforms/SimplifyCFG/invoke_unwind_lifetime.ll
llvm/test/Transforms/SimplifyCFG/lifetime-landingpad.ll
llvm/test/Transforms/SimplifyCFG/wineh-unreachable.ll