Enable FastISel on ARM for Linux and NaCl, not MCJIT
[oota-llvm.git] / lib / ExecutionEngine / TargetSelect.cpp
index ca4330fa22b0443296c586334f36a1c729b2948c..558d8b37af12585e89e8f90d16b2bdef86fa5906 100644 (file)
@@ -88,6 +88,14 @@ TargetMachine *EngineBuilder::selectTarget(const Triple &TargetTriple,
     FeaturesStr = Features.getString();
   }
 
+  // FIXME: non-iOS ARM FastISel is broken with MCJIT.
+  if (UseMCJIT &&
+      TheTriple.getArch() == Triple::arm &&
+      TheTriple.getOS() != Triple::IOS &&
+      OptLevel == CodeGenOpt::None) {
+    OptLevel = CodeGenOpt::Less;
+  }
+
   // Allocate a target...
   TargetMachine *Target = TheTarget->createTargetMachine(TheTriple.getTriple(),
                                                          MCPU, FeaturesStr,