Only do the suspend check at return and loop latch.

Change-Id: I0c7d2b25288bfb85dfc8a0650b75aff2162f9903
diff --git a/src/compiler_llvm/compilation_unit.h b/src/compiler_llvm/compilation_unit.h
index a92dabe..40a4c73 100644
--- a/src/compiler_llvm/compilation_unit.h
+++ b/src/compiler_llvm/compilation_unit.h
@@ -88,7 +88,10 @@
     return num_elf_funcs_++;
   }
 
-  bool WriteBitcodeToFile(const std::string& bitcode_filename);
+  void SetBitcodeFileName(const std::string& bitcode_filename) {
+    MutexLock GUARD(cunit_lock_);
+    bitcode_filename_ = bitcode_filename;
+  }
 
   bool Materialize(size_t thread_count);
 
@@ -122,6 +125,7 @@
   UniquePtr<RuntimeSupportBuilder> runtime_support_;
   llvm::Module* module_;
 
+  std::string bitcode_filename_;
   std::string elf_image_;
 
   SafeMap<const llvm::Function*, CompiledMethod*> compiled_methods_map_;