From 71680fed1d20ffc6131e1158b7728dc31f7db665 Mon Sep 17 00:00:00 2001 From: William Chen Date: Wed, 1 Dec 2021 13:44:08 -0800 Subject: [PATCH] For inline asm, get reg opnd that has already been created --- src/mapleall/maple_be/src/cg/aarch64/aarch64_cgfunc.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/mapleall/maple_be/src/cg/aarch64/aarch64_cgfunc.cpp b/src/mapleall/maple_be/src/cg/aarch64/aarch64_cgfunc.cpp index bd228488cf..33aad7468f 100644 --- a/src/mapleall/maple_be/src/cg/aarch64/aarch64_cgfunc.cpp +++ b/src/mapleall/maple_be/src/cg/aarch64/aarch64_cgfunc.cpp @@ -1260,14 +1260,14 @@ void AArch64CGFunc::SelectAsm(AsmNode &node) { PregIdx pregIdx = static_cast(regFieldPair.GetPregIdx()); MIRPreg *mirPreg = mirModule.CurFunction()->GetPregTab()->PregFromPregIdx(pregIdx); RegOperand *outOpnd = - isOutputTempNode ? rPOpnd : &CreateVirtualRegisterOperand(GetVirtualRegNOFromPseudoRegIdx(pregIdx)); + isOutputTempNode ? rPOpnd : &GetOrCreateVirtualRegisterOperand(GetVirtualRegNOFromPseudoRegIdx(pregIdx)); PrimType srcType = mirPreg->GetPrimType(); PrimType destType = srcType; if (GetPrimTypeBitSize(destType) < k32BitSize) { destType = IsSignedInteger(destType) ? PTY_i32 : PTY_u32; } RegType rtype = GetRegTyFromPrimTy(srcType); - RegOperand *opnd0 = isOutputTempNode ? &CreateVirtualRegisterOperand(GetVirtualRegNOFromPseudoRegIdx(pregIdx)) : + RegOperand *opnd0 = isOutputTempNode ? &GetOrCreateVirtualRegisterOperand(GetVirtualRegNOFromPseudoRegIdx(pregIdx)) : &CreateVirtualRegisterOperand(NewVReg(rtype, GetPrimTypeSize(srcType))); SelectCopy(*opnd0, destType, *outOpnd, srcType); if (!isOutputTempNode) { -- Gitee