Fix ids and remove invoke when inlining.

Bugs found by Razvan Lupusoru.

Change-Id: I3a5a9af280d8700d18f52abb4a2cff0e3a9aac74
diff --git a/compiler/optimizing/graph_checker.cc b/compiler/optimizing/graph_checker.cc
index 5d712fe..e55175f 100644
--- a/compiler/optimizing/graph_checker.cc
+++ b/compiler/optimizing/graph_checker.cc
@@ -16,9 +16,9 @@
 
 #include "graph_checker.h"
 
-#include <string>
 #include <map>
 #include <sstream>
+#include <string>
 
 #include "base/bit_vector-inl.h"
 
@@ -123,6 +123,14 @@
 }
 
 void GraphChecker::VisitInstruction(HInstruction* instruction) {
+  if (seen_ids_.IsBitSet(instruction->GetId())) {
+    std::stringstream error;
+    error << "Duplicate id in graph " << instruction->GetId() << ".";
+    errors_.push_back(error.str());
+  } else {
+    seen_ids_.SetBit(instruction->GetId());
+  }
+
   // Ensure `instruction` is associated with `current_block_`.
   if (instruction->GetBlock() != current_block_) {
     std::stringstream error;