#include "ARM.h"
#include "ARMBaseInstrInfo.h"
#include "ARMBaseRegisterInfo.h"
#include "ARMCallingConv.h"
#include "ARMConstantPoolValue.h"
#include "ARMISelLowering.h"
#include "ARMMachineFunctionInfo.h"
#include "ARMSubtarget.h"
#include "MCTargetDesc/ARMAddressingModes.h"
#include "MCTargetDesc/ARMBaseInfo.h"
#include "Utils/ARMBaseInfo.h"
#include "llvm/ADT/APFloat.h"
#include "llvm/ADT/APInt.h"
#include "llvm/ADT/DenseMap.h"
#include "llvm/ADT/SmallVector.h"
#include "llvm/CodeGen/CallingConvLower.h"
#include "llvm/CodeGen/FastISel.h"
#include "llvm/CodeGen/FunctionLoweringInfo.h"
#include "llvm/CodeGen/ISDOpcodes.h"
#include "llvm/CodeGen/MachineBasicBlock.h"
#include "llvm/CodeGen/MachineConstantPool.h"
#include "llvm/CodeGen/MachineFrameInfo.h"
#include "llvm/CodeGen/MachineFunction.h"
#include "llvm/CodeGen/MachineInstr.h"
#include "llvm/CodeGen/MachineInstrBuilder.h"
#include "llvm/CodeGen/MachineMemOperand.h"
#include "llvm/CodeGen/MachineOperand.h"
#include "llvm/CodeGen/MachineRegisterInfo.h"
#include "llvm/CodeGen/RuntimeLibcallUtil.h"
#include "llvm/CodeGen/TargetInstrInfo.h"
#include "llvm/CodeGen/TargetLowering.h"
#include "llvm/CodeGen/TargetOpcodes.h"
#include "llvm/CodeGen/TargetRegisterInfo.h"
#include "llvm/CodeGen/ValueTypes.h"
#include "llvm/CodeGenTypes/MachineValueType.h"
#include "llvm/IR/Argument.h"
#include "llvm/IR/Attributes.h"
#include "llvm/IR/CallingConv.h"
#include "llvm/IR/Constant.h"
#include "llvm/IR/Constants.h"
#include "llvm/IR/DataLayout.h"
#include "llvm/IR/DerivedTypes.h"
#include "llvm/IR/Function.h"
#include "llvm/IR/GetElementPtrTypeIterator.h"
#include "llvm/IR/GlobalValue.h"
#include "llvm/IR/GlobalVariable.h"
#include "llvm/IR/InstrTypes.h"
#include "llvm/IR/Instruction.h"
#include "llvm/IR/Instructions.h"
#include "llvm/IR/IntrinsicInst.h"
#include "llvm/IR/Intrinsics.h"
#include "llvm/IR/Module.h"
#include "llvm/IR/Operator.h"
#include "llvm/IR/Type.h"
#include "llvm/IR/User.h"
#include "llvm/IR/Value.h"
#include "llvm/MC/MCInstrDesc.h"
#include "llvm/MC/MCRegisterInfo.h"
#include "llvm/Support/Casting.h"
#include "llvm/Support/Compiler.h"
#include "llvm/Support/ErrorHandling.h"
#include "llvm/Support/MathExtras.h"
#include "llvm/Target/TargetMachine.h"
#include "llvm/Target/TargetOptions.h"
#include <cassert>
#include <cstdint>
#include <utility>
usingnamespacellvm;
namespace {
struct Address { … };
class ARMFastISel final : public FastISel { … };
}
bool ARMFastISel::DefinesOptionalPredicate(MachineInstr *MI, bool *CPSR) { … }
bool ARMFastISel::isARMNEONPred(const MachineInstr *MI) { … }
const MachineInstrBuilder &
ARMFastISel::AddOptionalDefs(const MachineInstrBuilder &MIB) { … }
unsigned ARMFastISel::fastEmitInst_r(unsigned MachineInstOpcode,
const TargetRegisterClass *RC,
unsigned Op0) { … }
unsigned ARMFastISel::fastEmitInst_rr(unsigned MachineInstOpcode,
const TargetRegisterClass *RC,
unsigned Op0, unsigned Op1) { … }
unsigned ARMFastISel::fastEmitInst_ri(unsigned MachineInstOpcode,
const TargetRegisterClass *RC,
unsigned Op0, uint64_t Imm) { … }
unsigned ARMFastISel::fastEmitInst_i(unsigned MachineInstOpcode,
const TargetRegisterClass *RC,
uint64_t Imm) { … }
unsigned ARMFastISel::ARMMoveToFPReg(MVT VT, unsigned SrcReg) { … }
unsigned ARMFastISel::ARMMoveToIntReg(MVT VT, unsigned SrcReg) { … }
unsigned ARMFastISel::ARMMaterializeFP(const ConstantFP *CFP, MVT VT) { … }
unsigned ARMFastISel::ARMMaterializeInt(const Constant *C, MVT VT) { … }
bool ARMFastISel::isPositionIndependent() const { … }
unsigned ARMFastISel::ARMMaterializeGV(const GlobalValue *GV, MVT VT) { … }
unsigned ARMFastISel::fastMaterializeConstant(const Constant *C) { … }
unsigned ARMFastISel::fastMaterializeAlloca(const AllocaInst *AI) { … }
bool ARMFastISel::isTypeLegal(Type *Ty, MVT &VT) { … }
bool ARMFastISel::isLoadTypeLegal(Type *Ty, MVT &VT) { … }
bool ARMFastISel::ARMComputeAddress(const Value *Obj, Address &Addr) { … }
void ARMFastISel::ARMSimplifyAddress(Address &Addr, MVT VT, bool useAM3) { … }
void ARMFastISel::AddLoadStoreOperands(MVT VT, Address &Addr,
const MachineInstrBuilder &MIB,
MachineMemOperand::Flags Flags,
bool useAM3) { … }
bool ARMFastISel::ARMEmitLoad(MVT VT, Register &ResultReg, Address &Addr,
MaybeAlign Alignment, bool isZExt,
bool allocReg) { … }
bool ARMFastISel::SelectLoad(const Instruction *I) { … }
bool ARMFastISel::ARMEmitStore(MVT VT, unsigned SrcReg, Address &Addr,
MaybeAlign Alignment) { … }
bool ARMFastISel::SelectStore(const Instruction *I) { … }
static ARMCC::CondCodes getComparePred(CmpInst::Predicate Pred) { … }
bool ARMFastISel::SelectBranch(const Instruction *I) { … }
bool ARMFastISel::SelectIndirectBr(const Instruction *I) { … }
bool ARMFastISel::ARMEmitCmp(const Value *Src1Value, const Value *Src2Value,
bool isZExt) { … }
bool ARMFastISel::SelectCmp(const Instruction *I) { … }
bool ARMFastISel::SelectFPExt(const Instruction *I) { … }
bool ARMFastISel::SelectFPTrunc(const Instruction *I) { … }
bool ARMFastISel::SelectIToFP(const Instruction *I, bool isSigned) { … }
bool ARMFastISel::SelectFPToI(const Instruction *I, bool isSigned) { … }
bool ARMFastISel::SelectSelect(const Instruction *I) { … }
bool ARMFastISel::SelectDiv(const Instruction *I, bool isSigned) { … }
bool ARMFastISel::SelectRem(const Instruction *I, bool isSigned) { … }
bool ARMFastISel::SelectBinaryIntOp(const Instruction *I, unsigned ISDOpcode) { … }
bool ARMFastISel::SelectBinaryFPOp(const Instruction *I, unsigned ISDOpcode) { … }
CCAssignFn *ARMFastISel::CCAssignFnForCall(CallingConv::ID CC,
bool Return,
bool isVarArg) { … }
bool ARMFastISel::ProcessCallArgs(SmallVectorImpl<Value*> &Args,
SmallVectorImpl<Register> &ArgRegs,
SmallVectorImpl<MVT> &ArgVTs,
SmallVectorImpl<ISD::ArgFlagsTy> &ArgFlags,
SmallVectorImpl<Register> &RegArgs,
CallingConv::ID CC,
unsigned &NumBytes,
bool isVarArg) { … }
bool ARMFastISel::FinishCall(MVT RetVT, SmallVectorImpl<Register> &UsedRegs,
const Instruction *I, CallingConv::ID CC,
unsigned &NumBytes, bool isVarArg) { … }
bool ARMFastISel::SelectRet(const Instruction *I) { … }
unsigned ARMFastISel::ARMSelectCallOp(bool UseReg) { … }
unsigned ARMFastISel::getLibcallReg(const Twine &Name) { … }
bool ARMFastISel::ARMEmitLibcall(const Instruction *I, RTLIB::Libcall Call) { … }
bool ARMFastISel::SelectCall(const Instruction *I,
const char *IntrMemName = nullptr) { … }
bool ARMFastISel::ARMIsMemCpySmall(uint64_t Len) { … }
bool ARMFastISel::ARMTryEmitSmallMemCpy(Address Dest, Address Src, uint64_t Len,
MaybeAlign Alignment) { … }
bool ARMFastISel::SelectIntrinsicCall(const IntrinsicInst &I) { … }
bool ARMFastISel::SelectTrunc(const Instruction *I) { … }
unsigned ARMFastISel::ARMEmitIntExt(MVT SrcVT, unsigned SrcReg, MVT DestVT,
bool isZExt) { … }
bool ARMFastISel::SelectIntExt(const Instruction *I) { … }
bool ARMFastISel::SelectShift(const Instruction *I,
ARM_AM::ShiftOpc ShiftTy) { … }
bool ARMFastISel::fastSelectInstruction(const Instruction *I) { … }
static const struct FoldableLoadExtendsStruct { … } FoldableLoadExtends[] = …;
bool ARMFastISel::tryToFoldLoadIntoMI(MachineInstr *MI, unsigned OpNo,
const LoadInst *LI) { … }
unsigned ARMFastISel::ARMLowerPICELF(const GlobalValue *GV, MVT VT) { … }
bool ARMFastISel::fastLowerArguments() { … }
namespace llvm {
FastISel *ARM::createFastISel(FunctionLoweringInfo &funcInfo,
const TargetLibraryInfo *libInfo) { … }
}