]> granicus.if.org Git - llvm/commit
[MachineOutliner] Disable outlining from noreturn functions
authorJessica Paquette <jpaquette@apple.com>
Fri, 4 Oct 2019 21:24:12 +0000 (21:24 +0000)
committerJessica Paquette <jpaquette@apple.com>
Fri, 4 Oct 2019 21:24:12 +0000 (21:24 +0000)
commit08c6feac7d1cebedeb651479712badef7e0ca71f
tree1d930a286f39253b4a478ca7fa95dc44b7c4be6f
parentb935c4c52a7c3641ea3ca5f51d24e001ae1a567b
[MachineOutliner] Disable outlining from noreturn functions

Outlining from noreturn functions doesn't do the correct thing right now. The
outliner should respect that the caller is marked noreturn. In the event that
we have a noreturn function, and the outlined code is in tail position, the
outliner will not see that the outlined function should be tail called. As a
result, you end up with a regular call containing a return.

Fixing this requires that we check that all candidates live inside noreturn
functions. So, for the sake of correctness, don't outline from noreturn
functions right now.

Add machine-outliner-noreturn.mir to test this.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@373791 91177308-0d34-0410-b5e6-96231b3b80d8
lib/CodeGen/MachineOutliner.cpp
test/CodeGen/AArch64/machine-outliner-noreturn.mir [new file with mode: 0644]