summaryrefslogtreecommitdiff
path: root/compiler/optimizing/nodes.h
diff options
context:
space:
mode:
author Vladimir Marko <vmarko@google.com> 2015-11-10 18:31:55 +0000
committer Gerrit Code Review <noreply-gerritcodereview@google.com> 2015-11-10 18:31:55 +0000
commitfeaf26db63a62bce5a80550f500efa67ff64424f (patch)
tree4df965d3e647ae9a6d62b28e747e6da03c30c052 /compiler/optimizing/nodes.h
parent969670298516b9316b36270fcc4c21bfcd499595 (diff)
parent9e23df5c21bed53ead79e3131b67105abc8871e4 (diff)
Merge "Optimizing: Improve constant folding + DCE for inlining."
Diffstat (limited to 'compiler/optimizing/nodes.h')
-rw-r--r--compiler/optimizing/nodes.h13
1 files changed, 13 insertions, 0 deletions
diff --git a/compiler/optimizing/nodes.h b/compiler/optimizing/nodes.h
index a3f3d17b9d..7ea6176e96 100644
--- a/compiler/optimizing/nodes.h
+++ b/compiler/optimizing/nodes.h
@@ -2595,6 +2595,11 @@ class HBinaryOperation : public HExpression<2> {
VLOG(compiler) << DebugName() << " is not defined for the (long, int) case.";
return nullptr;
}
+ virtual HConstant* Evaluate(HNullConstant* x ATTRIBUTE_UNUSED,
+ HNullConstant* y ATTRIBUTE_UNUSED) const {
+ VLOG(compiler) << DebugName() << " is not defined for the (null, null) case.";
+ return nullptr;
+ }
// Returns an input that can legally be used as the right input and is
// constant, or null.
@@ -2685,6 +2690,10 @@ class HEqual : public HCondition {
return GetBlock()->GetGraph()->GetIntConstant(
Compute(x->GetValue(), y->GetValue()), GetDexPc());
}
+ HConstant* Evaluate(HNullConstant* x ATTRIBUTE_UNUSED,
+ HNullConstant* y ATTRIBUTE_UNUSED) const OVERRIDE {
+ return GetBlock()->GetGraph()->GetConstant(GetType(), 1);
+ }
DECLARE_INSTRUCTION(Equal);
@@ -2717,6 +2726,10 @@ class HNotEqual : public HCondition {
return GetBlock()->GetGraph()->GetIntConstant(
Compute(x->GetValue(), y->GetValue()), GetDexPc());
}
+ HConstant* Evaluate(HNullConstant* x ATTRIBUTE_UNUSED,
+ HNullConstant* y ATTRIBUTE_UNUSED) const OVERRIDE {
+ return GetBlock()->GetGraph()->GetConstant(GetType(), 0);
+ }
DECLARE_INSTRUCTION(NotEqual);