summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/MachineCSE.cpp
diff options
context:
space:
mode:
authorAnton Afanasyev <anton.a.afanasyev@gmail.com>2019-06-12 13:51:44 +0000
committerAnton Afanasyev <anton.a.afanasyev@gmail.com>2019-06-12 13:51:44 +0000
commit339b39b7733726634520573c06459de842a7ac64 (patch)
tree3f35b5fe46158a4cdf18c9ae0cf55cdbf200c752 /llvm/lib/CodeGen/MachineCSE.cpp
parent082a41994ac9c3d4be34bb0b3befebd18a0d9781 (diff)
downloadbcm5719-llvm-339b39b7733726634520573c06459de842a7ac64.tar.gz
bcm5719-llvm-339b39b7733726634520573c06459de842a7ac64.zip
[MIR] Skip hoisting to basic block which may throw exception or return
Summary: Fix hoisting to basic block which are not legal for hoisting cause it can be terminated by exception or it is return block. Reviewers: john.brawn, RKSimon, MatzeB Subscribers: hiraditya, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D63148 llvm-svn: 363164
Diffstat (limited to 'llvm/lib/CodeGen/MachineCSE.cpp')
-rw-r--r--llvm/lib/CodeGen/MachineCSE.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/llvm/lib/CodeGen/MachineCSE.cpp b/llvm/lib/CodeGen/MachineCSE.cpp
index d05e7f542d0..2df6d40d929 100644
--- a/llvm/lib/CodeGen/MachineCSE.cpp
+++ b/llvm/lib/CodeGen/MachineCSE.cpp
@@ -799,6 +799,8 @@ bool MachineCSE::ProcessBlockPRE(MachineDominatorTree *DT,
!DT->properlyDominates(MBB, MBB1) &&
"MBB cannot properly dominate MBB1 while DFS through dominators tree!");
auto CMBB = DT->findNearestCommonDominator(MBB, MBB1);
+ if (!CMBB->isLegalToHoistInto())
+ continue;
// Two instrs are partial redundant if their basic blocks are reachable
// from one to another but one doesn't dominate another.
OpenPOWER on IntegriCloud