diff options
| author | Quentin Colombet <qcolombet@apple.com> | 2015-11-12 18:13:42 +0000 |
|---|---|---|
| committer | Quentin Colombet <qcolombet@apple.com> | 2015-11-12 18:13:42 +0000 |
| commit | 94dc1e0d34ac510b7570ee25902d8ca841d9b088 (patch) | |
| tree | d0f5f167d17736ccab4052cc875a232ac7405f17 /llvm/lib/CodeGen/ShrinkWrap.cpp | |
| parent | f0e107e38ad1acdf800216d877a82686cfc20143 (diff) | |
| download | bcm5719-llvm-94dc1e0d34ac510b7570ee25902d8ca841d9b088.tar.gz bcm5719-llvm-94dc1e0d34ac510b7570ee25902d8ca841d9b088.zip | |
[ShrinkWrap] Make sure we do not mess up with EH funclet lowering.
ShrinkWrapping does not understand exception handling constraints for now, so
make sure we do not mess with them by aborting on functions that use EH
funclets.
llvm-svn: 252917
Diffstat (limited to 'llvm/lib/CodeGen/ShrinkWrap.cpp')
| -rw-r--r-- | llvm/lib/CodeGen/ShrinkWrap.cpp | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/llvm/lib/CodeGen/ShrinkWrap.cpp b/llvm/lib/CodeGen/ShrinkWrap.cpp index 8261caa4f84..368f138f959 100644 --- a/llvm/lib/CodeGen/ShrinkWrap.cpp +++ b/llvm/lib/CodeGen/ShrinkWrap.cpp @@ -63,11 +63,13 @@ #include "llvm/CodeGen/Passes.h" // To know about callee-saved. #include "llvm/CodeGen/RegisterClassInfo.h" +#include "llvm/MC/MCAsmInfo.h" #include "llvm/Support/Debug.h" // To query the target about frame lowering. #include "llvm/Target/TargetFrameLowering.h" // To know about frame setup operation. #include "llvm/Target/TargetInstrInfo.h" +#include "llvm/Target/TargetMachine.h" // To access TargetInstrInfo. #include "llvm/Target/TargetSubtargetInfo.h" @@ -377,6 +379,11 @@ bool ShrinkWrap::runOnMachineFunction(MachineFunction &MF) { DEBUG(dbgs() << "Look into: " << MBB.getNumber() << ' ' << MBB.getName() << '\n'); + if (MBB.isEHFuncletEntry()) { + DEBUG(dbgs() << "EH Funclets are not supported yet.\n"); + return false; + } + for (const MachineInstr &MI : MBB) { if (!useOrDefCSROrFI(MI)) continue; @@ -458,7 +465,10 @@ bool ShrinkWrap::isShrinkWrapEnabled(const MachineFunction &MF) { switch (EnableShrinkWrapOpt) { case cl::BOU_UNSET: - return TFI->enableShrinkWrapping(MF); + return TFI->enableShrinkWrapping(MF) && + // Windows with CFI has some limitations that makes it impossible + // to use shrink-wrapping. + !MF.getTarget().getMCAsmInfo()->usesWindowsCFI(); // If EnableShrinkWrap is set, it takes precedence on whatever the // target sets. The rational is that we assume we want to test // something related to shrink-wrapping. |

