summaryrefslogtreecommitdiff
path: root/compiler/optimizing/nodes.cc
diff options
context:
space:
mode:
author Dave Allison <dallison@google.com> 2014-06-24 16:08:12 +0000
committer Gerrit Code Review <noreply-gerritcodereview@google.com> 2014-06-23 21:45:06 +0000
commit1528b02c4d5241e785bb680f13de70c355e67429 (patch)
tree79eefb2dd1ae2cade357ef5d8367973bd08b0a34 /compiler/optimizing/nodes.cc
parenta76724f4bc4a8d36c6c99243835b8e3ddf1eb2d7 (diff)
parent20dfc797dc631bf8d655dcf123f46f13332d3074 (diff)
Merge "Add some more instruction support to optimizing compiler."
Diffstat (limited to 'compiler/optimizing/nodes.cc')
-rw-r--r--compiler/optimizing/nodes.cc19
1 files changed, 19 insertions, 0 deletions
diff --git a/compiler/optimizing/nodes.cc b/compiler/optimizing/nodes.cc
index 2a97fadbaf..490d345826 100644
--- a/compiler/optimizing/nodes.cc
+++ b/compiler/optimizing/nodes.cc
@@ -445,4 +445,23 @@ void HGraphVisitor::VisitBasicBlock(HBasicBlock* block) {
}
}
+
+bool HCondition::NeedsMaterialization() const {
+ if (!HasOnlyOneUse()) {
+ return true;
+ }
+ HUseListNode<HInstruction>* uses = GetUses();
+ HInstruction* user = uses->GetUser();
+ if (!user->IsIf()) {
+ return true;
+ }
+
+ // TODO: should we allow intervening instructions with no side-effect between this condition
+ // and the If instruction?
+ if (GetNext() != user) {
+ return true;
+ }
+ return false;
+}
+
} // namespace art