diff options
Diffstat (limited to 'ARMeilleure/CodeGen/RegisterAllocators/LinearScanAllocator.cs')
| -rw-r--r-- | ARMeilleure/CodeGen/RegisterAllocators/LinearScanAllocator.cs | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/ARMeilleure/CodeGen/RegisterAllocators/LinearScanAllocator.cs b/ARMeilleure/CodeGen/RegisterAllocators/LinearScanAllocator.cs index 1127ccd5..1dc6ad73 100644 --- a/ARMeilleure/CodeGen/RegisterAllocators/LinearScanAllocator.cs +++ b/ARMeilleure/CodeGen/RegisterAllocators/LinearScanAllocator.cs @@ -711,6 +711,20 @@ namespace ARMeilleure.CodeGen.RegisterAllocators { operation.SetSource(index, register); } + else if (source.Kind == OperandKind.Memory) + { + MemoryOperand memOp = (MemoryOperand)source; + + if (memOp.BaseAddress == current.Local) + { + memOp.BaseAddress = register; + } + + if (memOp.Index == current.Local) + { + memOp.Index = register; + } + } } for (int index = 0; index < operation.DestinationsCount; index++) @@ -1011,6 +1025,20 @@ namespace ARMeilleure.CodeGen.RegisterAllocators { yield return source; } + else if (source.Kind == OperandKind.Memory) + { + MemoryOperand memOp = (MemoryOperand)source; + + if (memOp.BaseAddress != null) + { + yield return memOp.BaseAddress; + } + + if (memOp.Index != null) + { + yield return memOp.Index; + } + } } } |
