summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen
diff options
context:
space:
mode:
authorJessica Paquette <jpaquette@apple.com>2018-01-13 00:42:28 +0000
committerJessica Paquette <jpaquette@apple.com>2018-01-13 00:42:28 +0000
commit757e12037954abf78cbf25465494a651791f741e (patch)
tree1620a7f300dde6fed17e4a3a6b3ce3d5dcf138ca /llvm/lib/CodeGen
parent5bbba4875204e718418b75137e0cdd602eefdd41 (diff)
downloadbcm5719-llvm-757e12037954abf78cbf25465494a651791f741e.tar.gz
bcm5719-llvm-757e12037954abf78cbf25465494a651791f741e.zip
[MachineOutliner] Move hasAddressTaken check to MachineOutliner.cpp
*Mostly* NFC. Still updating the test though just for completeness. This moves the hasAddressTaken check to MachineOutliner.cpp and replaces it with a per-basic block test rather than a per-function test. The old test was too conservative and was preventing functions in C programs from being outlined even though they were safe to outline. This was mostly a problem in C sources. llvm-svn: 322425
Diffstat (limited to 'llvm/lib/CodeGen')
-rw-r--r--llvm/lib/CodeGen/MachineOutliner.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/llvm/lib/CodeGen/MachineOutliner.cpp b/llvm/lib/CodeGen/MachineOutliner.cpp
index 58d546158a8..0ee04f7d900 100644
--- a/llvm/lib/CodeGen/MachineOutliner.cpp
+++ b/llvm/lib/CodeGen/MachineOutliner.cpp
@@ -1357,8 +1357,8 @@ bool MachineOutliner::runOnModule(Module &M) {
// If it is, look at each MachineBasicBlock in the function.
for (MachineBasicBlock &MBB : MF) {
- // Is there anything in MBB?
- if (MBB.empty())
+ // Is there anything in MBB? And is it the target of an indirect branch?
+ if (MBB.empty() || MBB.hasAddressTaken())
continue;
// If yes, map it.
OpenPOWER on IntegriCloud