[llvm] r342751 - [Hexagon] Avoid functions with exception handling in HexagonConstExtenders

Krzysztof Parzyszek via llvm-commits llvm-commits at lists.llvm.org
Fri Sep 21 10:40:35 PDT 2018


Author: kparzysz
Date: Fri Sep 21 10:40:35 2018
New Revision: 342751

URL: http://llvm.org/viewvc/llvm-project?rev=342751&view=rev
Log:
[Hexagon] Avoid functions with exception handling in HexagonConstExtenders

The constant-extender optimization does a form of code motion, which is
complicated in the presence of exception handling.

Modified:
    llvm/trunk/lib/Target/Hexagon/HexagonConstExtenders.cpp

Modified: llvm/trunk/lib/Target/Hexagon/HexagonConstExtenders.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Hexagon/HexagonConstExtenders.cpp?rev=342751&r1=342750&r2=342751&view=diff
==============================================================================
--- llvm/trunk/lib/Target/Hexagon/HexagonConstExtenders.cpp (original)
+++ llvm/trunk/lib/Target/Hexagon/HexagonConstExtenders.cpp Fri Sep 21 10:40:35 2018
@@ -1933,6 +1933,11 @@ const MachineOperand &HCE::getStoredValu
 bool HCE::runOnMachineFunction(MachineFunction &MF) {
   if (skipFunction(MF.getFunction()))
     return false;
+  if (MF.getFunction().hasPersonalityFn()) {
+    LLVM_DEBUG(dbgs() << getPassName() << ": skipping " << MF.getName()
+                      << " due to exception handling\n");
+    return false;
+  }
   LLVM_DEBUG(MF.print(dbgs() << "Before " << getPassName() << '\n', nullptr));
 
   HII = MF.getSubtarget<HexagonSubtarget>().getInstrInfo();




More information about the llvm-commits mailing list