llvm-project/llvm
Taewook Oh e0db533feb [CallSiteSplitting] Do not perform callsite splitting inside landing pad
Summary:
If the callsite is inside landing pad, do not perform callsite splitting.

Callsite splitting uses utility function llvm::DuplicateInstructionsInSplitBetween, which eventually calls llvm::SplitEdge. llvm::SplitEdge calls llvm::SplitCriticalEdge with an assumption that the function returns nullptr only when the target edge is not a critical edge (and further assumes that if the return value was not nullptr, the predecessor of the original target edge always has a single successor because critical edge splitting was successful). However, this assumtion is not true because SplitCriticalEdge returns nullptr if the destination block is a landing pad. This invalid assumption results assertion failure.

Fundamental solution might be fixing llvm::SplitEdge to not to rely on the invalid assumption. However, it'll involve a lot of work because current API assumes that llvm::SplitEdge never fails. Instead, this patch makes callsite splitting to not to attempt splitting if the callsite is in a landing pad.

Attached test case will crash with assertion failure without the fix.

Reviewers: fhahn, junbuml, dberlin

Subscribers: llvm-commits

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

llvm-svn: 329250
2018-04-05 04:16:23 +00:00
..
bindings Fix Go IR test for changes in DIBuilder API 2018-04-02 21:45:35 +00:00
cmake Re-land r329156 "Add llvm-exegesis tool." 2018-04-04 11:37:06 +00:00
docs Add AMDPAL Code Conventions section to AMD docs 2018-04-04 13:02:09 +00:00
examples [ORC] Create a new SymbolStringPool by default in ExecutionSession constructor. 2018-04-02 20:57:56 +00:00
include [IR] Upgrade comment token in objc retain release marker 2018-04-05 02:44:46 +00:00
lib [CallSiteSplitting] Do not perform callsite splitting inside landing pad 2018-04-05 04:16:23 +00:00
projects
resources
runtimes
test [CallSiteSplitting] Do not perform callsite splitting inside landing pad 2018-04-05 04:16:23 +00:00
tools [gold] Add debug-pass-manager option, and use it to test new-pass-manager 2018-04-05 03:16:57 +00:00
unittests [Analysis] Support aligned new/delete functions. 2018-04-04 19:01:51 +00:00
utils Remove llvm-build's --write-make-fragment which looks like a remnant from the autoconf build. 2018-04-04 13:23:24 +00:00
.arcconfig
.clang-format
.clang-tidy
.gitattributes
.gitignore
CMakeLists.txt Assume existence of inttypes.h and stdint.h in DataTypes.h. 2018-04-02 13:22:26 +00:00
CODE_OWNERS.TXT
CREDITS.TXT
LICENSE.TXT
LLVMBuild.txt
README.txt
RELEASE_TESTERS.TXT
configure
llvm.spec.in

README.txt

Low Level Virtual Machine (LLVM)
================================

This directory and its subdirectories contain source code for LLVM,
a toolkit for the construction of highly optimized compilers,
optimizers, and runtime environments.

LLVM is open source software. You may freely distribute it under the terms of
the license agreement found in LICENSE.txt.

Please see the documentation provided in docs/ for further
assistance with LLVM, and in particular docs/GettingStarted.rst for getting
started with LLVM and docs/README.txt for an overview of LLVM's
documentation setup.

If you are writing a package for LLVM, see docs/Packaging.rst for our
suggestions.