Fix codegen_test after DCE fix.
Change-Id: I16c64abc26c64815da4cb4034276d60e9bfb6996
diff --git a/compiler/optimizing/codegen_test.cc b/compiler/optimizing/codegen_test.cc
index ca85cf5..4fbb51d 100644
--- a/compiler/optimizing/codegen_test.cc
+++ b/compiler/optimizing/codegen_test.cc
@@ -192,7 +192,10 @@
std::function<void(HGraph*)> hook_before_codegen,
bool has_result,
Expected expected) {
- graph->BuildDominatorTree();
+ // Tests may have already computed it.
+ if (graph->GetReversePostOrder().IsEmpty()) {
+ graph->BuildDominatorTree();
+ }
SsaLivenessAnalysis liveness(graph, codegen);
liveness.Analyze();