Optimizing: Improve constant folding + DCE for inlining.
Run constant folding before DCE in inliner to eliminate more
code that can prevent inlining. Improve the constant folding
to evaluate Equals and NotEquals for null inputs.
Change-Id: I876ffb903ef39484370b6c8793f0f8467a977362
diff --git a/compiler/optimizing/nodes.cc b/compiler/optimizing/nodes.cc
index f006df1..1a46853 100644
--- a/compiler/optimizing/nodes.cc
+++ b/compiler/optimizing/nodes.cc
@@ -1090,6 +1090,8 @@
} else if (GetRight()->IsLongConstant()) {
return Evaluate(GetLeft()->AsLongConstant(), GetRight()->AsLongConstant());
}
+ } else if (GetLeft()->IsNullConstant() && GetRight()->IsNullConstant()) {
+ return Evaluate(GetLeft()->AsNullConstant(), GetRight()->AsNullConstant());
}
return nullptr;
}