diff options
author | Joseph Tremoulet <jotrem@microsoft.com> | 2019-04-02 15:48:58 +0000 |
---|---|---|
committer | Joseph Tremoulet <jotrem@microsoft.com> | 2019-04-02 15:48:58 +0000 |
commit | fb4d9f7287c24f16e1916afa8ea58bb8c7f856fc (patch) | |
tree | f2b021ebe2ff0a6fb4f21b90be74b37e0fb27859 /llvm/lib/Transforms/Utils/Local.cpp | |
parent | 6a27c48be223ce25b73eab7a49f4d502cdf24dce (diff) | |
download | llvm-fb4d9f7287c24f16e1916afa8ea58bb8c7f856fc.zip llvm-fb4d9f7287c24f16e1916afa8ea58bb8c7f856fc.tar.gz llvm-fb4d9f7287c24f16e1916afa8ea58bb8c7f856fc.tar.bz2 |
[SimplifyCFG] Don't split musttail call from ret
Summary:
When inserting an `unreachable` after a noreturn call, we must ensure
that it's not a musttail call to avoid breaking the IR invariants for
musttail calls.
Reviewers: fedor.sergeev, majnemer
Reviewed By: majnemer
Subscribers: hiraditya, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D60080
llvm-svn: 357485
Diffstat (limited to 'llvm/lib/Transforms/Utils/Local.cpp')
-rw-r--r-- | llvm/lib/Transforms/Utils/Local.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/llvm/lib/Transforms/Utils/Local.cpp b/llvm/lib/Transforms/Utils/Local.cpp index 429ae85..7024c66 100644 --- a/llvm/lib/Transforms/Utils/Local.cpp +++ b/llvm/lib/Transforms/Utils/Local.cpp @@ -2054,7 +2054,7 @@ static bool markAliveBlocks(Function &F, Changed = true; break; } - if (CI->doesNotReturn()) { + if (CI->doesNotReturn() && !CI->isMustTailCall()) { // If we found a call to a no-return function, insert an unreachable // instruction after it. Make sure there isn't *already* one there // though. |