[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.

llvm-svn: 342751
This commit is contained in:
Krzysztof Parzyszek 2018-09-21 17:40:35 +00:00
parent 72c475276e
commit 5805def9c8
1 changed files with 5 additions and 0 deletions

View File

@ -1933,6 +1933,11 @@ const MachineOperand &HCE::getStoredValueOp(const MachineInstr &MI) const {
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();