summaryrefslogtreecommitdiff
path: root/compiler/optimizing/nodes.cc
diff options
context:
space:
mode:
author Roland Levillain <rpl@google.com> 2015-08-05 10:03:46 +0000
committer Gerrit Code Review <noreply-gerritcodereview@google.com> 2015-08-05 10:03:46 +0000
commit902ec264e1040cbfd783c44809ed10b261bd78ee (patch)
tree915f7d23caf192e440a585b9495f4d787e8d26bf /compiler/optimizing/nodes.cc
parentd4fd591406f356dcb8feaa262c19983cacb9116d (diff)
parentc90bc7c07f9bd24b5424cfb1e3f064fbae5334d6 (diff)
Merge "Add constant folding for long unary operations in opt. compiler."
Diffstat (limited to 'compiler/optimizing/nodes.cc')
-rw-r--r--compiler/optimizing/nodes.cc8
1 files changed, 2 insertions, 6 deletions
diff --git a/compiler/optimizing/nodes.cc b/compiler/optimizing/nodes.cc
index 61dadc2704..d7795f9dff 100644
--- a/compiler/optimizing/nodes.cc
+++ b/compiler/optimizing/nodes.cc
@@ -1015,12 +1015,8 @@ HConstant* HUnaryOperation::TryStaticEvaluation() const {
int32_t value = Evaluate(GetInput()->AsIntConstant()->GetValue());
return GetBlock()->GetGraph()->GetIntConstant(value);
} else if (GetInput()->IsLongConstant()) {
- // TODO: Implement static evaluation of long unary operations.
- //
- // Do not exit with a fatal condition here. Instead, simply
- // return `null' to notify the caller that this instruction
- // cannot (yet) be statically evaluated.
- return nullptr;
+ int64_t value = Evaluate(GetInput()->AsLongConstant()->GetValue());
+ return GetBlock()->GetGraph()->GetLongConstant(value);
}
return nullptr;
}