diff options
author | 2014-10-08 21:07:48 +0100 | |
---|---|---|
committer | 2014-10-09 15:21:57 +0100 | |
commit | 360231a056e796c36ffe62348507e904dc9efb9b (patch) | |
tree | a62ff73c11eaa6694649c98e4c2d872e89149b0c /compiler/optimizing/nodes.cc | |
parent | 2072c465cfff077da257bdf14f1f1b2690c946c8 (diff) |
Fix code generation of materialized conditions.
Move the logic for knowing if a condition needs to be materialized
in an optimization pass (so that the information does not change
as a side effect of another optimization).
Also clean-up arm and x86_64 codegen:
- arm: ldr and str are for power-users when a constant is
in play. We should use LoadFromOffset and StoreToOffset.
- x86_64: fix misuses of movq instead of movl.
Change-Id: I01a03b91803624be2281a344a13ad5efbf4f3ef3
Diffstat (limited to 'compiler/optimizing/nodes.cc')
-rw-r--r-- | compiler/optimizing/nodes.cc | 20 |
1 files changed, 1 insertions, 19 deletions
diff --git a/compiler/optimizing/nodes.cc b/compiler/optimizing/nodes.cc index 4cac3198ea..3a0b40c5de 100644 --- a/compiler/optimizing/nodes.cc +++ b/compiler/optimizing/nodes.cc @@ -537,7 +537,7 @@ void HPhi::AddInput(HInstruction* input) { input->AddUseAt(this, inputs_.Size() - 1); } -#define DEFINE_ACCEPT(name) \ +#define DEFINE_ACCEPT(name, super) \ void H##name::Accept(HGraphVisitor* visitor) { \ visitor->Visit##name(this); \ } @@ -575,24 +575,6 @@ HConstant* HBinaryOperation::TryStaticEvaluation(ArenaAllocator* allocator) cons return nullptr; } -bool HCondition::NeedsMaterialization() const { - if (!HasOnlyOneUse()) { - return true; - } - HUseListNode<HInstruction>* uses = GetUses(); - HInstruction* user = uses->GetUser(); - if (!user->IsIf()) { - return true; - } - - // 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()) { |