diff --git a/lib/Target/ARM/ARMExport.cpp b/lib/Target/ARM/ARMExport.cpp
index 22a0e8870cff05cac984525da7091034a63481ee..020d097b0ff1d2a9e318c2033a3d53b790aa4b69 100644
--- a/lib/Target/ARM/ARMExport.cpp
+++ b/lib/Target/ARM/ARMExport.cpp
@@ -48,7 +48,12 @@ namespace llvm {
       virtual bool doExportInstruction(const MachineInstr *Ins) {
         return Ins->getOpcode() != ARM::PSEUDO_LOOPBOUND
             && Ins->getOpcode() != ARM::IMPLICIT_DEF
-            && Ins->getOpcode() != ARM::PSEUDO_PLATINA;
+            && Ins->getOpcode() != ARM::PSEUDO_PLATINA
+            && Ins->getOpcode() != TargetOpcode::CFI_INSTRUCTION;
+            // As of 20.04.2018: For obscure reasons, the final
+            // RET instructions are Pseudo instructions. Therefore
+            // the following code is dangerous.
+            //    !(Ins->isPseudo() && !Ins->isInlineAsm())
       }
 
       virtual void serialize(MachineFunction &MF);
@@ -150,7 +155,6 @@ namespace llvm {
           IsBundled = false;
         }
 
-
         if (Ins->getOpcode() == ARM::PSEUDO_PLATINA) {
           assert(Ins->getNumOperands() == 2
               && "PSEUDO_PLATINA takes a type and an expression operand");