2017-09-21 05:35:51 +08:00
|
|
|
//===- llvm/lib/Target/ARM/ARMCallLowering.cpp - Call lowering ------------===//
|
2016-11-11 16:27:37 +08:00
|
|
|
//
|
2019-01-19 16:50:56 +08:00
|
|
|
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
|
|
|
|
// See https://llvm.org/LICENSE.txt for license information.
|
|
|
|
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
2016-11-11 16:27:37 +08:00
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
2017-09-21 05:35:51 +08:00
|
|
|
//
|
2016-11-11 16:27:37 +08:00
|
|
|
/// \file
|
|
|
|
/// This file implements the lowering of LLVM calls to machine code calls for
|
|
|
|
/// GlobalISel.
|
2017-09-21 05:35:51 +08:00
|
|
|
//
|
2016-11-11 16:27:37 +08:00
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
|
|
|
|
#include "ARMCallLowering.h"
|
|
|
|
#include "ARMBaseInstrInfo.h"
|
|
|
|
#include "ARMISelLowering.h"
|
2017-01-25 15:08:53 +08:00
|
|
|
#include "ARMSubtarget.h"
|
2017-09-21 05:35:51 +08:00
|
|
|
#include "Utils/ARMBaseInfo.h"
|
|
|
|
#include "llvm/ADT/SmallVector.h"
|
2017-02-02 22:01:00 +08:00
|
|
|
#include "llvm/CodeGen/Analysis.h"
|
2017-09-21 05:35:51 +08:00
|
|
|
#include "llvm/CodeGen/CallingConvLower.h"
|
2016-11-11 16:27:37 +08:00
|
|
|
#include "llvm/CodeGen/GlobalISel/MachineIRBuilder.h"
|
2017-06-05 20:54:53 +08:00
|
|
|
#include "llvm/CodeGen/GlobalISel/Utils.h"
|
2017-09-21 05:35:51 +08:00
|
|
|
#include "llvm/CodeGen/LowLevelType.h"
|
|
|
|
#include "llvm/CodeGen/MachineBasicBlock.h"
|
|
|
|
#include "llvm/CodeGen/MachineFrameInfo.h"
|
|
|
|
#include "llvm/CodeGen/MachineFunction.h"
|
|
|
|
#include "llvm/CodeGen/MachineInstrBuilder.h"
|
|
|
|
#include "llvm/CodeGen/MachineMemOperand.h"
|
|
|
|
#include "llvm/CodeGen/MachineOperand.h"
|
2016-12-19 19:55:41 +08:00
|
|
|
#include "llvm/CodeGen/MachineRegisterInfo.h"
|
2017-11-17 09:07:10 +08:00
|
|
|
#include "llvm/CodeGen/TargetRegisterInfo.h"
|
|
|
|
#include "llvm/CodeGen/TargetSubtargetInfo.h"
|
2018-03-30 01:21:10 +08:00
|
|
|
#include "llvm/CodeGen/ValueTypes.h"
|
2017-09-21 05:35:51 +08:00
|
|
|
#include "llvm/IR/Attributes.h"
|
|
|
|
#include "llvm/IR/DataLayout.h"
|
|
|
|
#include "llvm/IR/DerivedTypes.h"
|
|
|
|
#include "llvm/IR/Function.h"
|
|
|
|
#include "llvm/IR/Type.h"
|
|
|
|
#include "llvm/IR/Value.h"
|
|
|
|
#include "llvm/Support/Casting.h"
|
|
|
|
#include "llvm/Support/LowLevelTypeImpl.h"
|
2018-03-24 07:58:25 +08:00
|
|
|
#include "llvm/Support/MachineValueType.h"
|
2017-09-21 05:35:51 +08:00
|
|
|
#include <algorithm>
|
|
|
|
#include <cassert>
|
|
|
|
#include <cstdint>
|
|
|
|
#include <utility>
|
2016-11-11 16:27:37 +08:00
|
|
|
|
|
|
|
using namespace llvm;
|
|
|
|
|
|
|
|
ARMCallLowering::ARMCallLowering(const ARMTargetLowering &TLI)
|
|
|
|
: CallLowering(&TLI) {}
|
|
|
|
|
2017-01-13 22:39:03 +08:00
|
|
|
static bool isSupportedType(const DataLayout &DL, const ARMTargetLowering &TLI,
|
2016-12-16 20:54:46 +08:00
|
|
|
Type *T) {
|
2017-06-15 17:42:02 +08:00
|
|
|
if (T->isArrayTy())
|
2019-04-30 17:05:25 +08:00
|
|
|
return isSupportedType(DL, TLI, T->getArrayElementType());
|
2017-05-29 15:01:52 +08:00
|
|
|
|
2017-06-15 17:42:02 +08:00
|
|
|
if (T->isStructTy()) {
|
|
|
|
// For now we only allow homogeneous structs that we can manipulate with
|
|
|
|
// G_MERGE_VALUES and G_UNMERGE_VALUES
|
|
|
|
auto StructT = cast<StructType>(T);
|
|
|
|
for (unsigned i = 1, e = StructT->getNumElements(); i != e; ++i)
|
|
|
|
if (StructT->getElementType(i) != StructT->getElementType(0))
|
|
|
|
return false;
|
2019-04-30 17:05:25 +08:00
|
|
|
return isSupportedType(DL, TLI, StructT->getElementType(0));
|
2017-06-15 17:42:02 +08:00
|
|
|
}
|
|
|
|
|
2017-02-02 22:00:54 +08:00
|
|
|
EVT VT = TLI.getValueType(DL, T, true);
|
2017-04-21 19:53:01 +08:00
|
|
|
if (!VT.isSimple() || VT.isVector() ||
|
|
|
|
!(VT.isInteger() || VT.isFloatingPoint()))
|
2016-12-19 22:08:02 +08:00
|
|
|
return false;
|
|
|
|
|
|
|
|
unsigned VTSize = VT.getSimpleVT().getSizeInBits();
|
2017-02-16 15:53:07 +08:00
|
|
|
|
|
|
|
if (VTSize == 64)
|
|
|
|
// FIXME: Support i64 too
|
|
|
|
return VT.isFloatingPoint();
|
|
|
|
|
2017-01-25 16:47:40 +08:00
|
|
|
return VTSize == 1 || VTSize == 8 || VTSize == 16 || VTSize == 32;
|
2016-12-16 20:54:46 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
namespace {
|
2017-09-21 05:35:51 +08:00
|
|
|
|
2017-02-23 21:25:43 +08:00
|
|
|
/// Helper class for values going out through an ABI boundary (used for handling
|
|
|
|
/// function return values and call parameters).
|
2020-07-09 08:36:48 +08:00
|
|
|
struct ARMOutgoingValueHandler : public CallLowering::OutgoingValueHandler {
|
|
|
|
ARMOutgoingValueHandler(MachineIRBuilder &MIRBuilder,
|
2021-05-05 06:12:38 +08:00
|
|
|
MachineRegisterInfo &MRI, MachineInstrBuilder &MIB)
|
|
|
|
: OutgoingValueHandler(MIRBuilder, MRI), MIB(MIB) {}
|
2019-10-19 04:13:42 +08:00
|
|
|
|
2019-06-25 00:16:12 +08:00
|
|
|
Register getStackAddress(uint64_t Size, int64_t Offset,
|
2021-03-07 00:49:30 +08:00
|
|
|
MachinePointerInfo &MPO,
|
|
|
|
ISD::ArgFlagsTy Flags) override {
|
2017-03-01 23:54:21 +08:00
|
|
|
assert((Size == 1 || Size == 2 || Size == 4 || Size == 8) &&
|
|
|
|
"Unsupported size");
|
2017-02-28 22:17:53 +08:00
|
|
|
|
|
|
|
LLT p0 = LLT::pointer(0, 32);
|
|
|
|
LLT s32 = LLT::scalar(32);
|
[GlobalISel] Tidy up unnecessary calls to createGenericVirtualRegister
Summary:
As a side effect some redundant copies of constant values are removed by
CSEMIRBuilder.
Reviewers: aemerson, arsenm, dsanders, aditya_nandakumar
Subscribers: sdardis, jvesely, wdng, nhaehnle, rovka, hiraditya, jrtc27, atanasyan, volkan, Petar.Avramovic, kerbowa, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D73789
2020-01-31 20:40:31 +08:00
|
|
|
auto SPReg = MIRBuilder.buildCopy(p0, Register(ARM::SP));
|
2017-02-28 22:17:53 +08:00
|
|
|
|
[GlobalISel] Tidy up unnecessary calls to createGenericVirtualRegister
Summary:
As a side effect some redundant copies of constant values are removed by
CSEMIRBuilder.
Reviewers: aemerson, arsenm, dsanders, aditya_nandakumar
Subscribers: sdardis, jvesely, wdng, nhaehnle, rovka, hiraditya, jrtc27, atanasyan, volkan, Petar.Avramovic, kerbowa, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D73789
2020-01-31 20:40:31 +08:00
|
|
|
auto OffsetReg = MIRBuilder.buildConstant(s32, Offset);
|
2017-02-28 22:17:53 +08:00
|
|
|
|
[GlobalISel] Tidy up unnecessary calls to createGenericVirtualRegister
Summary:
As a side effect some redundant copies of constant values are removed by
CSEMIRBuilder.
Reviewers: aemerson, arsenm, dsanders, aditya_nandakumar
Subscribers: sdardis, jvesely, wdng, nhaehnle, rovka, hiraditya, jrtc27, atanasyan, volkan, Petar.Avramovic, kerbowa, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D73789
2020-01-31 20:40:31 +08:00
|
|
|
auto AddrReg = MIRBuilder.buildPtrAdd(p0, SPReg, OffsetReg);
|
2017-02-28 22:17:53 +08:00
|
|
|
|
|
|
|
MPO = MachinePointerInfo::getStack(MIRBuilder.getMF(), Offset);
|
[GlobalISel] Tidy up unnecessary calls to createGenericVirtualRegister
Summary:
As a side effect some redundant copies of constant values are removed by
CSEMIRBuilder.
Reviewers: aemerson, arsenm, dsanders, aditya_nandakumar
Subscribers: sdardis, jvesely, wdng, nhaehnle, rovka, hiraditya, jrtc27, atanasyan, volkan, Petar.Avramovic, kerbowa, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D73789
2020-01-31 20:40:31 +08:00
|
|
|
return AddrReg.getReg(0);
|
2016-12-16 20:54:46 +08:00
|
|
|
}
|
|
|
|
|
2019-06-25 00:16:12 +08:00
|
|
|
void assignValueToReg(Register ValVReg, Register PhysReg,
|
2016-12-16 20:54:46 +08:00
|
|
|
CCValAssign &VA) override {
|
|
|
|
assert(VA.isRegLoc() && "Value shouldn't be assigned to reg");
|
|
|
|
assert(VA.getLocReg() == PhysReg && "Assigning to the wrong reg?");
|
|
|
|
|
2017-02-16 15:53:07 +08:00
|
|
|
assert(VA.getValVT().getSizeInBits() <= 64 && "Unsupported value size");
|
|
|
|
assert(VA.getLocVT().getSizeInBits() <= 64 && "Unsupported location size");
|
2016-12-16 20:54:46 +08:00
|
|
|
|
2019-06-25 00:16:12 +08:00
|
|
|
Register ExtReg = extendRegister(ValVReg, VA);
|
2017-01-25 16:10:40 +08:00
|
|
|
MIRBuilder.buildCopy(PhysReg, ExtReg);
|
2016-12-16 20:54:46 +08:00
|
|
|
MIB.addUse(PhysReg, RegState::Implicit);
|
|
|
|
}
|
|
|
|
|
2021-06-11 05:31:30 +08:00
|
|
|
void assignValueToAddress(Register ValVReg, Register Addr, LLT MemTy,
|
2016-12-16 20:54:46 +08:00
|
|
|
MachinePointerInfo &MPO, CCValAssign &VA) override {
|
2019-06-25 00:16:12 +08:00
|
|
|
Register ExtReg = extendRegister(ValVReg, VA);
|
2017-02-28 22:17:53 +08:00
|
|
|
auto MMO = MIRBuilder.getMF().getMachineMemOperand(
|
2021-06-11 05:31:30 +08:00
|
|
|
MPO, MachineMemOperand::MOStore, MemTy, Align(1));
|
[ARM] GlobalISel: Lower call params that need extensions
Lower i1, i8 and i16 call parameters by extending them before storing them on
the stack. Also make sure we encode the correct, extended size in the
corresponding memory operand, and that we compute the correct stack size in the
end.
The latter is a bit more complicated because we used to compute the stack size
in the getStackAddress method, based on the Size and Offset of the parameters.
However, if the last parameter is sign extended, we'd be using the wrong,
non-extended size, and we'd end up with a smaller stack than we need to hold the
extended value. Instead of hacking this up based on the value of Size in
getStackAddress, we move our stack size handling logic to assignArg, where we
have access to the CCState which knows everything we could possibly want to know
about the stack. This way we don't need to duplicate any knowledge or resort to
any ugly hacks.
On this same occasion, update the IRTranslator test to check the sizes of the
stores everywhere, not just for sign extended paramteres.
llvm-svn: 296631
2017-03-01 23:35:14 +08:00
|
|
|
MIRBuilder.buildStore(ExtReg, Addr, *MMO);
|
2016-12-16 20:54:46 +08:00
|
|
|
}
|
|
|
|
|
2021-07-07 00:02:07 +08:00
|
|
|
unsigned assignCustomValue(CallLowering::ArgInfo &Arg,
|
2017-02-16 15:53:07 +08:00
|
|
|
ArrayRef<CCValAssign> VAs) override {
|
2019-06-27 16:50:53 +08:00
|
|
|
assert(Arg.Regs.size() == 1 && "Can't handle multple regs yet");
|
|
|
|
|
2017-02-16 15:53:07 +08:00
|
|
|
CCValAssign VA = VAs[0];
|
|
|
|
assert(VA.needsCustom() && "Value doesn't need custom handling");
|
[ARM] Supporting lowering of half-precision FP arguments and returns in AArch32's backend
Summary:
Half-precision floating point arguments and returns are currently
promoted to either float or int32 in clang's CodeGen and there's
no existing support for the lowering of `half` arguments and returns
from IR in AArch32's backend.
Such frontend coercions, implemented as coercion through memory
in clang, can cause a series of issues in argument lowering, as causing
arguments to be stored on the wrong bits on big-endian architectures
and incurring in missing overflow detections in the return of certain
functions.
This patch introduces the handling of half-precision arguments and returns in
the backend using the actual "half" type on the IR. Using the "half"
type the backend is able to properly enforce the AAPCS' directions for
those arguments, making sure they are stored on the proper bits of the
registers and performing the necessary floating point convertions.
Reviewers: rjmccall, olista01, asl, efriedma, ostannard, SjoerdMeijer
Reviewed By: ostannard
Subscribers: stuij, hiraditya, dmgreen, llvm-commits, chill, dnsampaio, danielkiss, kristof.beyls, cfe-commits
Tags: #clang, #llvm
Differential Revision: https://reviews.llvm.org/D75169
2020-06-09 16:45:47 +08:00
|
|
|
|
|
|
|
// Custom lowering for other types, such as f16, is currently not supported
|
|
|
|
if (VA.getValVT() != MVT::f64)
|
|
|
|
return 0;
|
2017-02-16 15:53:07 +08:00
|
|
|
|
|
|
|
CCValAssign NextVA = VAs[1];
|
|
|
|
assert(NextVA.needsCustom() && "Value doesn't need custom handling");
|
|
|
|
assert(NextVA.getValVT() == MVT::f64 && "Unsupported type");
|
|
|
|
|
|
|
|
assert(VA.getValNo() == NextVA.getValNo() &&
|
|
|
|
"Values belong to different arguments");
|
|
|
|
|
|
|
|
assert(VA.isRegLoc() && "Value should be in reg");
|
|
|
|
assert(NextVA.isRegLoc() && "Value should be in reg");
|
|
|
|
|
2019-06-24 23:50:29 +08:00
|
|
|
Register NewRegs[] = {MRI.createGenericVirtualRegister(LLT::scalar(32)),
|
2017-02-16 15:53:07 +08:00
|
|
|
MRI.createGenericVirtualRegister(LLT::scalar(32))};
|
2019-06-27 16:50:53 +08:00
|
|
|
MIRBuilder.buildUnmerge(NewRegs, Arg.Regs[0]);
|
2017-02-16 15:53:07 +08:00
|
|
|
|
|
|
|
bool IsLittle = MIRBuilder.getMF().getSubtarget<ARMSubtarget>().isLittle();
|
|
|
|
if (!IsLittle)
|
|
|
|
std::swap(NewRegs[0], NewRegs[1]);
|
|
|
|
|
|
|
|
assignValueToReg(NewRegs[0], VA.getLocReg(), VA);
|
|
|
|
assignValueToReg(NewRegs[1], NextVA.getLocReg(), NextVA);
|
|
|
|
|
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
|
2021-05-06 05:22:10 +08:00
|
|
|
MachineInstrBuilder MIB;
|
2016-12-16 20:54:46 +08:00
|
|
|
};
|
2017-09-21 05:35:51 +08:00
|
|
|
|
|
|
|
} // end anonymous namespace
|
2016-12-16 20:54:46 +08:00
|
|
|
|
|
|
|
/// Lower the return value for the already existing \p Ret. This assumes that
|
|
|
|
/// \p MIRBuilder's insertion point is correct.
|
|
|
|
bool ARMCallLowering::lowerReturnVal(MachineIRBuilder &MIRBuilder,
|
2019-06-24 23:50:29 +08:00
|
|
|
const Value *Val, ArrayRef<Register> VRegs,
|
2016-12-16 20:54:46 +08:00
|
|
|
MachineInstrBuilder &Ret) const {
|
|
|
|
if (!Val)
|
|
|
|
// Nothing to do here.
|
|
|
|
return true;
|
|
|
|
|
|
|
|
auto &MF = MIRBuilder.getMF();
|
2017-12-16 06:22:58 +08:00
|
|
|
const auto &F = MF.getFunction();
|
2016-12-16 20:54:46 +08:00
|
|
|
|
2021-03-01 00:12:08 +08:00
|
|
|
const auto &DL = MF.getDataLayout();
|
2016-12-16 20:54:46 +08:00
|
|
|
auto &TLI = *getTLI<ARMTargetLowering>();
|
|
|
|
if (!isSupportedType(DL, TLI, Val->getType()))
|
|
|
|
return false;
|
|
|
|
|
2021-07-08 23:26:30 +08:00
|
|
|
ArgInfo OrigRetInfo(VRegs, Val->getType(), 0);
|
2019-07-17 18:01:27 +08:00
|
|
|
setArgFlags(OrigRetInfo, AttributeList::ReturnIndex, DL, F);
|
|
|
|
|
|
|
|
SmallVector<ArgInfo, 4> SplitRetInfos;
|
2021-03-01 00:12:08 +08:00
|
|
|
splitToValueTypes(OrigRetInfo, SplitRetInfos, DL, F.getCallingConv());
|
2017-06-15 17:42:02 +08:00
|
|
|
|
2017-02-02 22:01:00 +08:00
|
|
|
CCAssignFn *AssignFn =
|
|
|
|
TLI.CCAssignFnForReturn(F.getCallingConv(), F.isVarArg());
|
2016-12-16 20:54:46 +08:00
|
|
|
|
2021-05-05 06:12:38 +08:00
|
|
|
OutgoingValueAssigner RetAssigner(AssignFn);
|
|
|
|
ARMOutgoingValueHandler RetHandler(MIRBuilder, MF.getRegInfo(), Ret);
|
|
|
|
return determineAndHandleAssignments(RetHandler, RetAssigner, SplitRetInfos,
|
|
|
|
MIRBuilder, F.getCallingConv(),
|
|
|
|
F.isVarArg());
|
2016-12-16 20:54:46 +08:00
|
|
|
}
|
|
|
|
|
2016-11-11 16:27:37 +08:00
|
|
|
bool ARMCallLowering::lowerReturn(MachineIRBuilder &MIRBuilder,
|
2020-12-23 14:52:36 +08:00
|
|
|
const Value *Val, ArrayRef<Register> VRegs,
|
|
|
|
FunctionLoweringInfo &FLI) const {
|
2018-08-02 16:33:31 +08:00
|
|
|
assert(!Val == VRegs.empty() && "Return value without a vreg");
|
2016-11-11 16:27:37 +08:00
|
|
|
|
2017-08-29 04:20:47 +08:00
|
|
|
auto const &ST = MIRBuilder.getMF().getSubtarget<ARMSubtarget>();
|
|
|
|
unsigned Opcode = ST.getReturnOpcode();
|
|
|
|
auto Ret = MIRBuilder.buildInstrNoInsert(Opcode).add(predOps(ARMCC::AL));
|
2016-11-11 16:27:37 +08:00
|
|
|
|
2018-08-02 16:33:31 +08:00
|
|
|
if (!lowerReturnVal(MIRBuilder, Val, VRegs, Ret))
|
2016-12-16 20:54:46 +08:00
|
|
|
return false;
|
|
|
|
|
|
|
|
MIRBuilder.insertInstr(Ret);
|
2016-11-11 16:27:37 +08:00
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
2016-12-16 20:54:46 +08:00
|
|
|
namespace {
|
2017-09-21 05:35:51 +08:00
|
|
|
|
2017-02-23 22:18:41 +08:00
|
|
|
/// Helper class for values coming in through an ABI boundary (used for handling
|
|
|
|
/// formal arguments and call return values).
|
2020-07-09 08:36:48 +08:00
|
|
|
struct ARMIncomingValueHandler : public CallLowering::IncomingValueHandler {
|
|
|
|
ARMIncomingValueHandler(MachineIRBuilder &MIRBuilder,
|
2021-05-05 06:12:38 +08:00
|
|
|
MachineRegisterInfo &MRI)
|
|
|
|
: IncomingValueHandler(MIRBuilder, MRI) {}
|
2019-04-10 05:22:33 +08:00
|
|
|
|
2019-06-25 00:16:12 +08:00
|
|
|
Register getStackAddress(uint64_t Size, int64_t Offset,
|
2021-03-07 00:49:30 +08:00
|
|
|
MachinePointerInfo &MPO,
|
|
|
|
ISD::ArgFlagsTy Flags) override {
|
2017-02-16 15:53:07 +08:00
|
|
|
assert((Size == 1 || Size == 2 || Size == 4 || Size == 8) &&
|
|
|
|
"Unsupported size");
|
2016-12-19 19:55:41 +08:00
|
|
|
|
|
|
|
auto &MFI = MIRBuilder.getMF().getFrameInfo();
|
|
|
|
|
2021-03-07 00:49:30 +08:00
|
|
|
// Byval is assumed to be writable memory, but other stack passed arguments
|
|
|
|
// are not.
|
|
|
|
const bool IsImmutable = !Flags.isByVal();
|
|
|
|
|
|
|
|
int FI = MFI.CreateFixedObject(Size, Offset, IsImmutable);
|
2016-12-19 19:55:41 +08:00
|
|
|
MPO = MachinePointerInfo::getFixedStack(MIRBuilder.getMF(), FI);
|
|
|
|
|
[GlobalISel] Tidy up unnecessary calls to createGenericVirtualRegister
Summary:
As a side effect some redundant copies of constant values are removed by
CSEMIRBuilder.
Reviewers: aemerson, arsenm, dsanders, aditya_nandakumar
Subscribers: sdardis, jvesely, wdng, nhaehnle, rovka, hiraditya, jrtc27, atanasyan, volkan, Petar.Avramovic, kerbowa, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D73789
2020-01-31 20:40:31 +08:00
|
|
|
return MIRBuilder.buildFrameIndex(LLT::pointer(MPO.getAddrSpace(), 32), FI)
|
|
|
|
.getReg(0);
|
2016-12-19 19:55:41 +08:00
|
|
|
}
|
|
|
|
|
2021-06-11 05:31:30 +08:00
|
|
|
void assignValueToAddress(Register ValVReg, Register Addr, LLT MemTy,
|
2016-12-19 19:55:41 +08:00
|
|
|
MachinePointerInfo &MPO, CCValAssign &VA) override {
|
2017-01-26 17:20:47 +08:00
|
|
|
if (VA.getLocInfo() == CCValAssign::SExt ||
|
|
|
|
VA.getLocInfo() == CCValAssign::ZExt) {
|
2017-02-23 22:18:41 +08:00
|
|
|
// If the value is zero- or sign-extended, its size becomes 4 bytes, so
|
|
|
|
// that's what we should load.
|
2021-06-11 05:31:30 +08:00
|
|
|
MemTy = LLT::scalar(32);
|
2017-01-26 17:20:47 +08:00
|
|
|
assert(MRI.getType(ValVReg).isScalar() && "Only scalars supported atm");
|
2017-04-27 18:23:30 +08:00
|
|
|
|
2021-06-11 05:31:30 +08:00
|
|
|
auto LoadVReg = buildLoad(LLT::scalar(32), Addr, MemTy, MPO);
|
2017-04-27 18:23:30 +08:00
|
|
|
MIRBuilder.buildTrunc(ValVReg, LoadVReg);
|
|
|
|
} else {
|
|
|
|
// If the value is not extended, a simple load will suffice.
|
2021-06-11 05:31:30 +08:00
|
|
|
buildLoad(ValVReg, Addr, MemTy, MPO);
|
2017-01-26 17:20:47 +08:00
|
|
|
}
|
2017-04-27 18:23:30 +08:00
|
|
|
}
|
2016-12-19 19:55:41 +08:00
|
|
|
|
2021-06-11 05:31:30 +08:00
|
|
|
MachineInstrBuilder buildLoad(const DstOp &Res, Register Addr, LLT MemTy,
|
2019-08-28 12:01:46 +08:00
|
|
|
MachinePointerInfo &MPO) {
|
|
|
|
MachineFunction &MF = MIRBuilder.getMF();
|
|
|
|
|
2021-06-11 05:31:30 +08:00
|
|
|
auto MMO = MF.getMachineMemOperand(MPO, MachineMemOperand::MOLoad, MemTy,
|
2020-03-31 15:52:49 +08:00
|
|
|
inferAlignFromPtrInfo(MF, MPO));
|
[GlobalISel] Tidy up unnecessary calls to createGenericVirtualRegister
Summary:
As a side effect some redundant copies of constant values are removed by
CSEMIRBuilder.
Reviewers: aemerson, arsenm, dsanders, aditya_nandakumar
Subscribers: sdardis, jvesely, wdng, nhaehnle, rovka, hiraditya, jrtc27, atanasyan, volkan, Petar.Avramovic, kerbowa, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D73789
2020-01-31 20:40:31 +08:00
|
|
|
return MIRBuilder.buildLoad(Res, Addr, *MMO);
|
2016-12-16 20:54:46 +08:00
|
|
|
}
|
|
|
|
|
2019-06-25 00:16:12 +08:00
|
|
|
void assignValueToReg(Register ValVReg, Register PhysReg,
|
2016-12-16 20:54:46 +08:00
|
|
|
CCValAssign &VA) override {
|
|
|
|
assert(VA.isRegLoc() && "Value shouldn't be assigned to reg");
|
|
|
|
assert(VA.getLocReg() == PhysReg && "Assigning to the wrong reg?");
|
|
|
|
|
2020-10-09 16:02:47 +08:00
|
|
|
uint64_t ValSize = VA.getValVT().getFixedSizeInBits();
|
|
|
|
uint64_t LocSize = VA.getLocVT().getFixedSizeInBits();
|
2017-10-10 04:07:43 +08:00
|
|
|
|
|
|
|
assert(ValSize <= 64 && "Unsupported value size");
|
|
|
|
assert(LocSize <= 64 && "Unsupported location size");
|
2016-12-16 20:54:46 +08:00
|
|
|
|
2017-02-23 22:18:41 +08:00
|
|
|
markPhysRegUsed(PhysReg);
|
2017-10-10 04:07:43 +08:00
|
|
|
if (ValSize == LocSize) {
|
|
|
|
MIRBuilder.buildCopy(ValVReg, PhysReg);
|
|
|
|
} else {
|
|
|
|
assert(ValSize < LocSize && "Extensions not supported");
|
|
|
|
|
|
|
|
// We cannot create a truncating copy, nor a trunc of a physical register.
|
|
|
|
// Therefore, we need to copy the content of the physical register into a
|
|
|
|
// virtual one and then truncate that.
|
[GlobalISel] Tidy up unnecessary calls to createGenericVirtualRegister
Summary:
As a side effect some redundant copies of constant values are removed by
CSEMIRBuilder.
Reviewers: aemerson, arsenm, dsanders, aditya_nandakumar
Subscribers: sdardis, jvesely, wdng, nhaehnle, rovka, hiraditya, jrtc27, atanasyan, volkan, Petar.Avramovic, kerbowa, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D73789
2020-01-31 20:40:31 +08:00
|
|
|
auto PhysRegToVReg = MIRBuilder.buildCopy(LLT::scalar(LocSize), PhysReg);
|
2017-10-10 04:07:43 +08:00
|
|
|
MIRBuilder.buildTrunc(ValVReg, PhysRegToVReg);
|
|
|
|
}
|
2016-12-16 20:54:46 +08:00
|
|
|
}
|
2017-02-16 15:53:07 +08:00
|
|
|
|
2021-07-07 00:02:07 +08:00
|
|
|
unsigned assignCustomValue(ARMCallLowering::ArgInfo &Arg,
|
2017-02-16 15:53:07 +08:00
|
|
|
ArrayRef<CCValAssign> VAs) override {
|
2019-06-27 16:50:53 +08:00
|
|
|
assert(Arg.Regs.size() == 1 && "Can't handle multple regs yet");
|
|
|
|
|
2017-02-16 15:53:07 +08:00
|
|
|
CCValAssign VA = VAs[0];
|
|
|
|
assert(VA.needsCustom() && "Value doesn't need custom handling");
|
[ARM] Supporting lowering of half-precision FP arguments and returns in AArch32's backend
Summary:
Half-precision floating point arguments and returns are currently
promoted to either float or int32 in clang's CodeGen and there's
no existing support for the lowering of `half` arguments and returns
from IR in AArch32's backend.
Such frontend coercions, implemented as coercion through memory
in clang, can cause a series of issues in argument lowering, as causing
arguments to be stored on the wrong bits on big-endian architectures
and incurring in missing overflow detections in the return of certain
functions.
This patch introduces the handling of half-precision arguments and returns in
the backend using the actual "half" type on the IR. Using the "half"
type the backend is able to properly enforce the AAPCS' directions for
those arguments, making sure they are stored on the proper bits of the
registers and performing the necessary floating point convertions.
Reviewers: rjmccall, olista01, asl, efriedma, ostannard, SjoerdMeijer
Reviewed By: ostannard
Subscribers: stuij, hiraditya, dmgreen, llvm-commits, chill, dnsampaio, danielkiss, kristof.beyls, cfe-commits
Tags: #clang, #llvm
Differential Revision: https://reviews.llvm.org/D75169
2020-06-09 16:45:47 +08:00
|
|
|
|
|
|
|
// Custom lowering for other types, such as f16, is currently not supported
|
|
|
|
if (VA.getValVT() != MVT::f64)
|
|
|
|
return 0;
|
2017-02-16 15:53:07 +08:00
|
|
|
|
|
|
|
CCValAssign NextVA = VAs[1];
|
|
|
|
assert(NextVA.needsCustom() && "Value doesn't need custom handling");
|
|
|
|
assert(NextVA.getValVT() == MVT::f64 && "Unsupported type");
|
|
|
|
|
|
|
|
assert(VA.getValNo() == NextVA.getValNo() &&
|
|
|
|
"Values belong to different arguments");
|
|
|
|
|
|
|
|
assert(VA.isRegLoc() && "Value should be in reg");
|
|
|
|
assert(NextVA.isRegLoc() && "Value should be in reg");
|
|
|
|
|
2019-06-24 23:50:29 +08:00
|
|
|
Register NewRegs[] = {MRI.createGenericVirtualRegister(LLT::scalar(32)),
|
2017-02-16 15:53:07 +08:00
|
|
|
MRI.createGenericVirtualRegister(LLT::scalar(32))};
|
|
|
|
|
|
|
|
assignValueToReg(NewRegs[0], VA.getLocReg(), VA);
|
|
|
|
assignValueToReg(NewRegs[1], NextVA.getLocReg(), NextVA);
|
|
|
|
|
|
|
|
bool IsLittle = MIRBuilder.getMF().getSubtarget<ARMSubtarget>().isLittle();
|
|
|
|
if (!IsLittle)
|
|
|
|
std::swap(NewRegs[0], NewRegs[1]);
|
|
|
|
|
2019-06-27 16:50:53 +08:00
|
|
|
MIRBuilder.buildMerge(Arg.Regs[0], NewRegs);
|
2017-02-16 15:53:07 +08:00
|
|
|
|
|
|
|
return 1;
|
|
|
|
}
|
2017-02-23 22:18:41 +08:00
|
|
|
|
|
|
|
/// Marking a physical register as used is different between formal
|
|
|
|
/// parameters, where it's a basic block live-in, and call returns, where it's
|
|
|
|
/// an implicit-def of the call instruction.
|
|
|
|
virtual void markPhysRegUsed(unsigned PhysReg) = 0;
|
|
|
|
};
|
|
|
|
|
2020-07-09 08:36:48 +08:00
|
|
|
struct FormalArgHandler : public ARMIncomingValueHandler {
|
2021-05-05 06:12:38 +08:00
|
|
|
FormalArgHandler(MachineIRBuilder &MIRBuilder, MachineRegisterInfo &MRI)
|
|
|
|
: ARMIncomingValueHandler(MIRBuilder, MRI) {}
|
2017-02-23 22:18:41 +08:00
|
|
|
|
|
|
|
void markPhysRegUsed(unsigned PhysReg) override {
|
2019-08-02 22:09:49 +08:00
|
|
|
MIRBuilder.getMRI()->addLiveIn(PhysReg);
|
2017-02-23 22:18:41 +08:00
|
|
|
MIRBuilder.getMBB().addLiveIn(PhysReg);
|
|
|
|
}
|
2016-12-16 20:54:46 +08:00
|
|
|
};
|
2017-09-21 05:35:51 +08:00
|
|
|
|
|
|
|
} // end anonymous namespace
|
2016-12-16 20:54:46 +08:00
|
|
|
|
2020-12-23 14:52:36 +08:00
|
|
|
bool ARMCallLowering::lowerFormalArguments(MachineIRBuilder &MIRBuilder,
|
|
|
|
const Function &F,
|
|
|
|
ArrayRef<ArrayRef<Register>> VRegs,
|
|
|
|
FunctionLoweringInfo &FLI) const {
|
2017-11-03 18:30:12 +08:00
|
|
|
auto &TLI = *getTLI<ARMTargetLowering>();
|
|
|
|
auto Subtarget = TLI.getSubtarget();
|
|
|
|
|
2018-12-05 18:35:28 +08:00
|
|
|
if (Subtarget->isThumb1Only())
|
2017-11-03 18:30:12 +08:00
|
|
|
return false;
|
|
|
|
|
2016-12-16 20:54:46 +08:00
|
|
|
// Quick exit if there aren't any args
|
|
|
|
if (F.arg_empty())
|
|
|
|
return true;
|
|
|
|
|
|
|
|
if (F.isVarArg())
|
|
|
|
return false;
|
|
|
|
|
2017-02-02 22:01:00 +08:00
|
|
|
auto &MF = MIRBuilder.getMF();
|
2017-05-29 15:01:52 +08:00
|
|
|
auto &MBB = MIRBuilder.getMBB();
|
2021-03-01 00:12:08 +08:00
|
|
|
const auto &DL = MF.getDataLayout();
|
2017-02-09 21:09:59 +08:00
|
|
|
|
2017-11-30 20:23:44 +08:00
|
|
|
for (auto &Arg : F.args()) {
|
2016-12-16 20:54:46 +08:00
|
|
|
if (!isSupportedType(DL, TLI, Arg.getType()))
|
|
|
|
return false;
|
2020-06-30 03:13:32 +08:00
|
|
|
if (Arg.hasPassPointeeByValueCopyAttr())
|
2017-11-30 20:23:44 +08:00
|
|
|
return false;
|
|
|
|
}
|
2016-12-16 20:54:46 +08:00
|
|
|
|
|
|
|
CCAssignFn *AssignFn =
|
|
|
|
TLI.CCAssignFnForCall(F.getCallingConv(), F.isVarArg());
|
|
|
|
|
2021-05-05 06:12:38 +08:00
|
|
|
OutgoingValueAssigner ArgAssigner(AssignFn);
|
|
|
|
FormalArgHandler ArgHandler(MIRBuilder, MIRBuilder.getMF().getRegInfo());
|
2017-05-29 17:09:54 +08:00
|
|
|
|
2019-06-27 16:54:17 +08:00
|
|
|
SmallVector<ArgInfo, 8> SplitArgInfos;
|
2016-12-16 20:54:46 +08:00
|
|
|
unsigned Idx = 0;
|
Remove getArgumentList() in favor of arg_begin(), args(), etc
Users often call getArgumentList().size(), which is a linear way to get
the number of function arguments. arg_size(), on the other hand, is
constant time.
In general, the fact that arguments are stored in an iplist is an
implementation detail, so I've removed it from the Function interface
and moved all other users to the argument container APIs (arg_begin(),
arg_end(), args(), arg_size()).
Reviewed By: chandlerc
Differential Revision: https://reviews.llvm.org/D31052
llvm-svn: 298010
2017-03-17 06:59:15 +08:00
|
|
|
for (auto &Arg : F.args()) {
|
2021-07-08 23:26:30 +08:00
|
|
|
ArgInfo OrigArgInfo(VRegs[Idx], Arg.getType(), Idx);
|
2017-05-29 17:09:54 +08:00
|
|
|
|
2019-07-17 18:01:27 +08:00
|
|
|
setArgFlags(OrigArgInfo, Idx + AttributeList::FirstArgIndex, DL, F);
|
2021-03-01 00:12:08 +08:00
|
|
|
splitToValueTypes(OrigArgInfo, SplitArgInfos, DL, F.getCallingConv());
|
2017-05-29 15:01:52 +08:00
|
|
|
|
2016-12-16 20:54:46 +08:00
|
|
|
Idx++;
|
|
|
|
}
|
|
|
|
|
2017-05-29 15:01:52 +08:00
|
|
|
if (!MBB.empty())
|
|
|
|
MIRBuilder.setInstr(*MBB.begin());
|
|
|
|
|
2021-05-05 06:12:38 +08:00
|
|
|
if (!determineAndHandleAssignments(ArgHandler, ArgAssigner, SplitArgInfos,
|
|
|
|
MIRBuilder, F.getCallingConv(),
|
|
|
|
F.isVarArg()))
|
2018-05-16 18:32:02 +08:00
|
|
|
return false;
|
|
|
|
|
|
|
|
// Move back to the end of the basic block.
|
|
|
|
MIRBuilder.setMBB(MBB);
|
|
|
|
return true;
|
2016-11-11 16:27:37 +08:00
|
|
|
}
|
2017-02-21 19:33:59 +08:00
|
|
|
|
2017-02-23 22:18:41 +08:00
|
|
|
namespace {
|
2017-09-21 05:35:51 +08:00
|
|
|
|
2020-07-09 08:36:48 +08:00
|
|
|
struct CallReturnHandler : public ARMIncomingValueHandler {
|
2017-02-23 22:18:41 +08:00
|
|
|
CallReturnHandler(MachineIRBuilder &MIRBuilder, MachineRegisterInfo &MRI,
|
2021-05-05 06:12:38 +08:00
|
|
|
MachineInstrBuilder MIB)
|
|
|
|
: ARMIncomingValueHandler(MIRBuilder, MRI), MIB(MIB) {}
|
2017-02-23 22:18:41 +08:00
|
|
|
|
|
|
|
void markPhysRegUsed(unsigned PhysReg) override {
|
|
|
|
MIB.addDef(PhysReg, RegState::Implicit);
|
|
|
|
}
|
|
|
|
|
|
|
|
MachineInstrBuilder MIB;
|
|
|
|
};
|
2017-09-21 05:35:51 +08:00
|
|
|
|
2018-12-05 18:35:28 +08:00
|
|
|
// FIXME: This should move to the ARMSubtarget when it supports all the opcodes.
|
2020-11-26 21:45:37 +08:00
|
|
|
unsigned getCallOpcode(const MachineFunction &MF, const ARMSubtarget &STI,
|
|
|
|
bool isDirect) {
|
2018-12-05 18:35:28 +08:00
|
|
|
if (isDirect)
|
|
|
|
return STI.isThumb() ? ARM::tBL : ARM::BL;
|
|
|
|
|
|
|
|
if (STI.isThumb())
|
2020-11-26 21:45:37 +08:00
|
|
|
return gettBLXrOpcode(MF);
|
2018-12-05 18:35:28 +08:00
|
|
|
|
|
|
|
if (STI.hasV5TOps())
|
2020-11-26 21:45:37 +08:00
|
|
|
return getBLXOpcode(MF);
|
2018-12-05 18:35:28 +08:00
|
|
|
|
|
|
|
if (STI.hasV4TOps())
|
|
|
|
return ARM::BX_CALL;
|
|
|
|
|
|
|
|
return ARM::BMOVPCRX_CALL;
|
|
|
|
}
|
2017-09-21 05:35:51 +08:00
|
|
|
} // end anonymous namespace
|
2017-02-23 22:18:41 +08:00
|
|
|
|
2019-08-09 16:26:38 +08:00
|
|
|
bool ARMCallLowering::lowerCall(MachineIRBuilder &MIRBuilder, CallLoweringInfo &Info) const {
|
2017-02-23 21:25:43 +08:00
|
|
|
MachineFunction &MF = MIRBuilder.getMF();
|
|
|
|
const auto &TLI = *getTLI<ARMTargetLowering>();
|
|
|
|
const auto &DL = MF.getDataLayout();
|
2017-10-25 19:42:40 +08:00
|
|
|
const auto &STI = MF.getSubtarget<ARMSubtarget>();
|
2017-06-05 20:54:53 +08:00
|
|
|
const TargetRegisterInfo *TRI = STI.getRegisterInfo();
|
2017-02-23 21:25:43 +08:00
|
|
|
MachineRegisterInfo &MRI = MF.getRegInfo();
|
2017-02-21 19:33:59 +08:00
|
|
|
|
2017-10-25 19:42:40 +08:00
|
|
|
if (STI.genLongCalls())
|
2017-02-21 19:33:59 +08:00
|
|
|
return false;
|
|
|
|
|
2018-12-05 18:35:28 +08:00
|
|
|
if (STI.isThumb1Only())
|
|
|
|
return false;
|
|
|
|
|
2017-02-28 22:17:53 +08:00
|
|
|
auto CallSeqStart = MIRBuilder.buildInstr(ARM::ADJCALLSTACKDOWN);
|
2017-02-21 19:33:59 +08:00
|
|
|
|
2017-02-23 21:25:43 +08:00
|
|
|
// Create the call instruction so we can add the implicit uses of arg
|
|
|
|
// registers, but don't insert it yet.
|
2019-08-09 16:26:38 +08:00
|
|
|
bool IsDirect = !Info.Callee.isReg();
|
2020-11-26 21:45:37 +08:00
|
|
|
auto CallOpcode = getCallOpcode(MF, STI, IsDirect);
|
2018-12-05 18:35:28 +08:00
|
|
|
auto MIB = MIRBuilder.buildInstrNoInsert(CallOpcode);
|
|
|
|
|
2019-01-17 18:11:59 +08:00
|
|
|
bool IsThumb = STI.isThumb();
|
|
|
|
if (IsThumb)
|
2018-12-05 18:35:28 +08:00
|
|
|
MIB.add(predOps(ARMCC::AL));
|
|
|
|
|
2019-08-09 16:26:38 +08:00
|
|
|
MIB.add(Info.Callee);
|
2019-01-17 18:11:59 +08:00
|
|
|
if (!IsDirect) {
|
2019-08-09 16:26:38 +08:00
|
|
|
auto CalleeReg = Info.Callee.getReg();
|
2019-08-02 07:27:28 +08:00
|
|
|
if (CalleeReg && !Register::isPhysicalRegister(CalleeReg)) {
|
2019-01-17 18:11:59 +08:00
|
|
|
unsigned CalleeIdx = IsThumb ? 2 : 0;
|
2018-12-05 18:35:28 +08:00
|
|
|
MIB->getOperand(CalleeIdx).setReg(constrainOperandRegClass(
|
2017-06-05 20:54:53 +08:00
|
|
|
MF, *TRI, MRI, *STI.getInstrInfo(), *STI.getRegBankInfo(),
|
2019-08-09 16:26:38 +08:00
|
|
|
*MIB.getInstr(), MIB->getDesc(), Info.Callee, CalleeIdx));
|
2018-12-05 18:35:28 +08:00
|
|
|
}
|
2017-06-05 20:54:53 +08:00
|
|
|
}
|
2017-02-23 21:25:43 +08:00
|
|
|
|
2019-08-09 16:26:38 +08:00
|
|
|
MIB.addRegMask(TRI->getCallPreservedMask(MF, Info.CallConv));
|
2018-12-05 18:35:28 +08:00
|
|
|
|
2017-02-23 21:25:43 +08:00
|
|
|
SmallVector<ArgInfo, 8> ArgInfos;
|
2019-08-09 16:26:38 +08:00
|
|
|
for (auto Arg : Info.OrigArgs) {
|
2017-02-23 21:25:43 +08:00
|
|
|
if (!isSupportedType(DL, TLI, Arg.Ty))
|
|
|
|
return false;
|
|
|
|
|
2019-09-04 05:42:28 +08:00
|
|
|
if (Arg.Flags[0].isByVal())
|
2017-11-30 20:23:44 +08:00
|
|
|
return false;
|
|
|
|
|
2021-03-01 00:12:08 +08:00
|
|
|
splitToValueTypes(Arg, ArgInfos, DL, Info.CallConv);
|
2017-02-23 21:25:43 +08:00
|
|
|
}
|
|
|
|
|
2021-01-06 20:12:58 +08:00
|
|
|
auto ArgAssignFn = TLI.CCAssignFnForCall(Info.CallConv, Info.IsVarArg);
|
2021-05-05 06:12:38 +08:00
|
|
|
OutgoingValueAssigner ArgAssigner(ArgAssignFn);
|
|
|
|
ARMOutgoingValueHandler ArgHandler(MIRBuilder, MRI, MIB);
|
|
|
|
if (!determineAndHandleAssignments(ArgHandler, ArgAssigner, ArgInfos,
|
|
|
|
MIRBuilder, Info.CallConv, Info.IsVarArg))
|
2017-02-23 21:25:43 +08:00
|
|
|
return false;
|
|
|
|
|
|
|
|
// Now we can add the actual call instruction to the correct basic block.
|
|
|
|
MIRBuilder.insertInstr(MIB);
|
2017-02-21 19:33:59 +08:00
|
|
|
|
2019-08-09 16:26:38 +08:00
|
|
|
if (!Info.OrigRet.Ty->isVoidTy()) {
|
|
|
|
if (!isSupportedType(DL, TLI, Info.OrigRet.Ty))
|
2017-02-23 22:18:41 +08:00
|
|
|
return false;
|
|
|
|
|
|
|
|
ArgInfos.clear();
|
2021-03-01 00:12:08 +08:00
|
|
|
splitToValueTypes(Info.OrigRet, ArgInfos, DL, Info.CallConv);
|
2021-01-06 20:12:58 +08:00
|
|
|
auto RetAssignFn = TLI.CCAssignFnForReturn(Info.CallConv, Info.IsVarArg);
|
2021-05-05 06:12:38 +08:00
|
|
|
OutgoingValueAssigner Assigner(RetAssignFn);
|
|
|
|
CallReturnHandler RetHandler(MIRBuilder, MRI, MIB);
|
|
|
|
if (!determineAndHandleAssignments(RetHandler, Assigner, ArgInfos,
|
|
|
|
MIRBuilder, Info.CallConv,
|
|
|
|
Info.IsVarArg))
|
2017-02-23 22:18:41 +08:00
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
2017-02-28 22:17:53 +08:00
|
|
|
// We now know the size of the stack - update the ADJCALLSTACKDOWN
|
|
|
|
// accordingly.
|
2021-05-05 06:12:38 +08:00
|
|
|
CallSeqStart.addImm(ArgAssigner.StackOffset)
|
|
|
|
.addImm(0)
|
|
|
|
.add(predOps(ARMCC::AL));
|
2017-02-28 22:17:53 +08:00
|
|
|
|
2017-02-21 19:33:59 +08:00
|
|
|
MIRBuilder.buildInstr(ARM::ADJCALLSTACKUP)
|
2021-05-05 06:12:38 +08:00
|
|
|
.addImm(ArgAssigner.StackOffset)
|
2017-02-21 19:33:59 +08:00
|
|
|
.addImm(0)
|
|
|
|
.add(predOps(ARMCC::AL));
|
|
|
|
|
|
|
|
return true;
|
|
|
|
}
|