From 360231a056e796c36ffe62348507e904dc9efb9b Mon Sep 17 00:00:00 2001 From: Nicolas Geoffray Date: Wed, 8 Oct 2014 21:07:48 +0100 Subject: 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 --- compiler/optimizing/nodes.cc | 20 +------------------- 1 file changed, 1 insertion(+), 19 deletions(-) (limited to 'compiler/optimizing/nodes.cc') 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* 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()) { -- cgit v1.2.3-59-g8ed1b