From 740475d5f45b8caa2c3c6fc51e657ecf4f3547e5 Mon Sep 17 00:00:00 2001 From: Nicolas Geoffray Date: Mon, 29 Sep 2014 10:33:25 +0100 Subject: Fix a bug in the insertion of parallel move. To make sure we do not connect interval siblings in the same parallel move, I added a new field in MoveOperands that tells for which instruction this move is for. A parallel move should not contains moves for the same instructions. The checks revealed a bug when connecting siblings, where we would choose the wrong parallel move. Change-Id: I70f27ec120886745c187071453c78da4c47c1dd2 --- compiler/optimizing/register_allocator.h | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) (limited to 'compiler/optimizing/register_allocator.h') diff --git a/compiler/optimizing/register_allocator.h b/compiler/optimizing/register_allocator.h index b97b6fc591..d4c233a7f8 100644 --- a/compiler/optimizing/register_allocator.h +++ b/compiler/optimizing/register_allocator.h @@ -108,11 +108,20 @@ class RegisterAllocator { void ConnectSplitSiblings(LiveInterval* interval, HBasicBlock* from, HBasicBlock* to) const; // Helper methods to insert parallel moves in the graph. - void InsertParallelMoveAtExitOf(HBasicBlock* block, Location source, Location destination) const; - void InsertParallelMoveAtEntryOf(HBasicBlock* block, Location source, Location destination) const; + void InsertParallelMoveAtExitOf(HBasicBlock* block, + HInstruction* instruction, + Location source, + Location destination) const; + void InsertParallelMoveAtEntryOf(HBasicBlock* block, + HInstruction* instruction, + Location source, + Location destination) const; void InsertMoveAfter(HInstruction* instruction, Location source, Location destination) const; - void AddInputMoveFor(HInstruction* instruction, Location source, Location destination) const; - void InsertParallelMoveAt(size_t position, Location source, Location destination) const; + void AddInputMoveFor(HInstruction* user, Location source, Location destination) const; + void InsertParallelMoveAt(size_t position, + HInstruction* instruction, + Location source, + Location destination) const; // Helper methods. void AllocateRegistersInternal(); -- cgit v1.2.3-59-g8ed1b