diff options
| author | 2016-06-07 15:39:45 +0000 | |
|---|---|---|
| committer | 2016-06-07 15:39:45 +0000 | |
| commit | 4fb652a5ca96cdefa6dca6fe739f1ea89d1bb3e4 (patch) | |
| tree | 705141366b8df041b655f154437641031f25343c /compiler/optimizing/nodes.cc | |
| parent | 97b1e6633be800827145c4ffeded1c834082730f (diff) | |
| parent | d6c205eb9b04bcfa072cd5ffdd93deef167ec340 (diff) | |
Merge "ART: Remove redundant MoveInstructionBefore method"
Diffstat (limited to 'compiler/optimizing/nodes.cc')
| -rw-r--r-- | compiler/optimizing/nodes.cc | 21 |
1 files changed, 5 insertions, 16 deletions
diff --git a/compiler/optimizing/nodes.cc b/compiler/optimizing/nodes.cc index 150d6b029b..ae3c4b01e6 100644 --- a/compiler/optimizing/nodes.cc +++ b/compiler/optimizing/nodes.cc @@ -785,22 +785,6 @@ void HBasicBlock::ReplaceAndRemoveInstructionWith(HInstruction* initial, RemoveInstruction(initial); } -void HBasicBlock::MoveInstructionBefore(HInstruction* insn, HInstruction* cursor) { - DCHECK(!cursor->IsPhi()); - DCHECK(!insn->IsPhi()); - DCHECK(!insn->IsControlFlow()); - DCHECK(insn->CanBeMoved()); - DCHECK(!insn->HasSideEffects()); - - HBasicBlock* from_block = insn->GetBlock(); - HBasicBlock* to_block = cursor->GetBlock(); - DCHECK(from_block != to_block); - - from_block->RemoveInstruction(insn, /* ensure_safety */ false); - insn->SetBlock(to_block); - to_block->instructions_.InsertInstructionBefore(insn, cursor); -} - static void Add(HInstructionList* instruction_list, HBasicBlock* block, HInstruction* instruction) { @@ -1352,6 +1336,11 @@ std::ostream& operator<<(std::ostream& os, const HInstruction::InstructionKind& } void HInstruction::MoveBefore(HInstruction* cursor) { + DCHECK(!IsPhi()); + DCHECK(!IsControlFlow()); + DCHECK(CanBeMoved()); + DCHECK(!cursor->IsPhi()); + next_->previous_ = previous_; if (previous_ != nullptr) { previous_->next_ = next_; |