From 7d5eccab4d0ec1ad7152b8d5c6ee0edaf0b7baa3 Mon Sep 17 00:00:00 2001 From: William Chen Date: Wed, 10 Nov 2021 09:50:29 -0800 Subject: [PATCH] Fix spill reg pick bug when caller reg spill location is optimized. When saving/restoring caller regs across calls, it is no longer safe to assume the load/store is next to the use. So picking a temp spill reg cannot use this caller reg. --- src/mapleall/maple_be/src/cg/aarch64/aarch64_color_ra.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 6e55e61111..a4206d7dc7 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 @@ -3148,7 +3148,7 @@ void GraphColorRegAllocator::CollectCannotUseReg(std::unordered_set &ca */ if ((conflictLr->GetAssignedRegNO() > 0) && IsBitArrElemSet(conflictLr->GetBBMember(), insn.GetBB()->GetId())) { if (!AArch64Abi::IsCalleeSavedReg(static_cast(conflictLr->GetAssignedRegNO())) && - conflictLr->GetNumCall()) { + conflictLr->GetNumCall() && !conflictLr->GetProcessed()) { return; } (void)cannotUseReg.insert(conflictLr->GetAssignedRegNO()); -- Gitee