Quick: Avoid unnecessary GVN work in release builds.

In GVN's post-processing phase, compare LVNs only in debug
builds as they should be equal anyway.

Remove the Gate() from GVN cleanup pass and remove the
DCHECK() from MIRGraph::GlobalValueNumberingCleanup()
to make it a no-op if the GVN didn't run.

Bug: 16398693
Change-Id: Ia4f1e7e3ecf12d0305966c86e0e7dbae61dab0b7
diff --git a/compiler/dex/mir_optimization.cc b/compiler/dex/mir_optimization.cc
index 3482602..f7107c1 100644
--- a/compiler/dex/mir_optimization.cc
+++ b/compiler/dex/mir_optimization.cc
@@ -1451,13 +1451,13 @@
 }
 
 void MIRGraph::GlobalValueNumberingCleanup() {
+  // If the GVN didn't run, these pointers should be null and everything is effectively no-op.
   delete temp_.gvn.dce;
   temp_.gvn.dce = nullptr;
   delete temp_.gvn.gvn;
   temp_.gvn.gvn = nullptr;
   temp_.gvn.ifield_ids = nullptr;
   temp_.gvn.sfield_ids = nullptr;
-  DCHECK(temp_scoped_alloc_ != nullptr);
   temp_scoped_alloc_.reset();
 }