When inlining, also look whether we can allocate registers.

arm and x86 currently don't allocate registers for floating point
and long operations, so we can't inline methods with these operations.

Change-Id: I11e4b97ddbe90f4978f2abe1081fb0f849acb811
diff --git a/compiler/optimizing/inliner.cc b/compiler/optimizing/inliner.cc
index 73eb521..493d93f 100644
--- a/compiler/optimizing/inliner.cc
+++ b/compiler/optimizing/inliner.cc
@@ -27,6 +27,7 @@
 #include "mirror/class_loader.h"
 #include "mirror/dex_cache.h"
 #include "nodes.h"
+#include "register_allocator.h"
 #include "ssa_phi_elimination.h"
 #include "scoped_thread_state_change.h"
 #include "thread.h"
@@ -143,6 +144,13 @@
     return false;
   }
 
+  if (!RegisterAllocator::CanAllocateRegistersFor(*callee_graph,
+                                                  compiler_driver_->GetInstructionSet())) {
+    VLOG(compiler) << "Method " << PrettyMethod(method_index, outer_dex_file)
+                   << " cannot be inlined because of the register allocator";
+    return false;
+  }
+
   if (!callee_graph->TryBuildingSsa()) {
     VLOG(compiler) << "Method " << PrettyMethod(method_index, outer_dex_file)
                    << " could not be transformed to SSA";