diff --git a/src/mapleall/maple_be/src/cg/aarch64/aarch64_color_ra.cpp b/src/mapleall/maple_be/src/cg/aarch64/aarch64_color_ra.cpp index a873e0c38b7ec22100569bb77d73075cf9d0afd3..7ce769e40ab303c5e7fd06a7be10aad2d08106d3 100644 --- a/src/mapleall/maple_be/src/cg/aarch64/aarch64_color_ra.cpp +++ b/src/mapleall/maple_be/src/cg/aarch64/aarch64_color_ra.cpp @@ -3013,8 +3013,7 @@ void GraphColorRegAllocator::FinalizeRegisters() { FinalizeRegisterInfo *fInfo = memPool->New(alloc); uint64 usedRegMask = FinalizeRegisterPreprocess(*fInfo, *insn); - uint32 defSpillIdx = 0; - uint32 useSpillIdx = 0; + uint32 spillIdx = 0; MemOperand *memOpnd = nullptr; if (fInfo->GetBaseOperand()) { memOpnd = static_cast( @@ -3022,8 +3021,7 @@ void GraphColorRegAllocator::FinalizeRegisters() { insn->SetOperand(fInfo->GetMemOperandIdx(), *memOpnd); Operand *base = memOpnd->GetBaseRegister(); ASSERT(base != nullptr, "nullptr check"); - /* if base register is both defReg and useReg, defSpillIdx should also be increased. But it doesn't exist yet */ - RegOperand *phyOpnd = GetReplaceOpnd(*insn, *base, useSpillIdx, usedRegMask, false); + RegOperand *phyOpnd = GetReplaceOpnd(*insn, *base, spillIdx, usedRegMask, false); if (phyOpnd != nullptr) { memOpnd->SetBaseRegister(*phyOpnd); } @@ -3031,7 +3029,7 @@ void GraphColorRegAllocator::FinalizeRegisters() { if (fInfo->GetOffsetOperand()) { ASSERT(memOpnd != nullptr, "mem operand cannot be null"); Operand *offset = memOpnd->GetIndexRegister(); - RegOperand *phyOpnd = GetReplaceOpnd(*insn, *offset, useSpillIdx, usedRegMask, false); + RegOperand *phyOpnd = GetReplaceOpnd(*insn, *offset, spillIdx, usedRegMask, false); if (phyOpnd != nullptr) { memOpnd->SetIndexRegister(*phyOpnd); } @@ -3039,18 +3037,14 @@ void GraphColorRegAllocator::FinalizeRegisters() { for (size_t i = 0; i < fInfo->GetDefOperandsSize(); ++i) { const Operand *opnd = fInfo->GetDefOperandsElem(i); RegOperand *phyOpnd = nullptr; - if (insn->IsSpecialIntrinsic()) { - phyOpnd = GetReplaceOpnd(*insn, *opnd, useSpillIdx, usedRegMask, true); - } else { - phyOpnd = GetReplaceOpnd(*insn, *opnd, defSpillIdx, usedRegMask, true); - } + phyOpnd = GetReplaceOpnd(*insn, *opnd, spillIdx, usedRegMask, true); if (phyOpnd != nullptr) { insn->SetOperand(fInfo->GetDefIdxElem(i), *phyOpnd); } } for (size_t i = 0; i < fInfo->GetUseOperandsSize(); ++i) { const Operand *opnd = fInfo->GetUseOperandsElem(i); - RegOperand *phyOpnd = GetReplaceOpnd(*insn, *opnd, useSpillIdx, usedRegMask, false); + RegOperand *phyOpnd = GetReplaceOpnd(*insn, *opnd, spillIdx, usedRegMask, false); if (phyOpnd != nullptr) { insn->SetOperand(fInfo->GetUseIdxElem(i), *phyOpnd); }