From 339b39b7733726634520573c06459de842a7ac64 Mon Sep 17 00:00:00 2001 From: Anton Afanasyev Date: Wed, 12 Jun 2019 13:51:44 +0000 Subject: [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 --- llvm/lib/CodeGen/MachineCSE.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'llvm/lib/CodeGen/MachineCSE.cpp') 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. -- cgit v1.2.3