summaryrefslogtreecommitdiff
path: root/compiler/optimizing/nodes.cc
diff options
context:
space:
mode:
author Nicolas Geoffray <ngeoffray@google.com> 2014-09-23 11:25:56 +0000
committer Gerrit Code Review <noreply-gerritcodereview@google.com> 2014-09-23 11:25:56 +0000
commit2e1391b9abdafdbe7e0ef5ef116c49f812394056 (patch)
treebdac0775c4f9290741f9583c2acbd53655c63fb0 /compiler/optimizing/nodes.cc
parent0f6016557d300a5a07c972465aef1ab2a125f5d1 (diff)
parent18efde5017369e005f1e8bcd3bbfb04e85053640 (diff)
Merge "Fix code generation with materialized conditions."
Diffstat (limited to 'compiler/optimizing/nodes.cc')
-rw-r--r--compiler/optimizing/nodes.cc12
1 files changed, 10 insertions, 2 deletions
diff --git a/compiler/optimizing/nodes.cc b/compiler/optimizing/nodes.cc
index 72c5834a8c..09412a9c86 100644
--- a/compiler/optimizing/nodes.cc
+++ b/compiler/optimizing/nodes.cc
@@ -555,14 +555,22 @@ bool HCondition::NeedsMaterialization() const {
return true;
}
- // TODO: should we allow intervening instructions with no side-effect between this condition
- // and the If instruction?
+ // TODO: if there is no intervening instructions with side-effect between this condition
+ // and the If instruction, we should move the condition just before the If.
if (GetNext() != user) {
return true;
}
return false;
}
+bool HCondition::IsBeforeWhenDisregardMoves(HIf* if_) const {
+ HInstruction* previous = if_->GetPrevious();
+ while (previous != nullptr && previous->IsParallelMove()) {
+ previous = previous->GetPrevious();
+ }
+ return previous == this;
+}
+
bool HInstruction::Equals(HInstruction* other) const {
if (!InstructionTypeEquals(other)) return false;
DCHECK_EQ(GetKind(), other->GetKind());