[PATCH] D63148: [MIR] Skip hoisting to throwable or return machine basic blocks

Anton Afanasyev via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jun 11 10:05:55 PDT 2019


anton-afanasyev created this revision.
anton-afanasyev added reviewers: john.brawn, RKSimon, MatzeB.
Herald added subscribers: llvm-commits, hiraditya.
Herald added a project: LLVM.

Fix hoisting to basic block which are not legal for hoisting cause
it can be terminated by exception or it is return block.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D63148

Files:
  llvm/lib/CodeGen/MachineCSE.cpp


Index: llvm/lib/CodeGen/MachineCSE.cpp
===================================================================
--- llvm/lib/CodeGen/MachineCSE.cpp
+++ llvm/lib/CodeGen/MachineCSE.cpp
@@ -799,6 +799,8 @@
         !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.


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D63148.204094.patch
Type: text/x-patch
Size: 583 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190611/cc42a536/attachment.bin>


More information about the llvm-commits mailing list