#include "RISCVLegalizerInfo.h"
#include "MCTargetDesc/RISCVMatInt.h"
#include "RISCVMachineFunctionInfo.h"
#include "RISCVSubtarget.h"
#include "llvm/CodeGen/GlobalISel/GIMatchTableExecutor.h"
#include "llvm/CodeGen/GlobalISel/GenericMachineInstrs.h"
#include "llvm/CodeGen/GlobalISel/LegalizerHelper.h"
#include "llvm/CodeGen/GlobalISel/MachineIRBuilder.h"
#include "llvm/CodeGen/MachineConstantPool.h"
#include "llvm/CodeGen/MachineMemOperand.h"
#include "llvm/CodeGen/MachineRegisterInfo.h"
#include "llvm/CodeGen/TargetOpcodes.h"
#include "llvm/CodeGen/ValueTypes.h"
#include "llvm/IR/DerivedTypes.h"
#include "llvm/IR/Type.h"
usingnamespacellvm;
usingnamespaceLegalityPredicates;
usingnamespaceLegalizeMutations;
static LegalityPredicate typeIsScalarFPArith(unsigned TypeIdx,
const RISCVSubtarget &ST) { … }
static LegalityPredicate
typeIsLegalIntOrFPVec(unsigned TypeIdx,
std::initializer_list<LLT> IntOrFPVecTys,
const RISCVSubtarget &ST) { … }
static LegalityPredicate
typeIsLegalBoolVec(unsigned TypeIdx, std::initializer_list<LLT> BoolVecTys,
const RISCVSubtarget &ST) { … }
static LegalityPredicate typeIsLegalPtrVec(unsigned TypeIdx,
std::initializer_list<LLT> PtrVecTys,
const RISCVSubtarget &ST) { … }
RISCVLegalizerInfo::RISCVLegalizerInfo(const RISCVSubtarget &ST)
: … { … }
bool RISCVLegalizerInfo::legalizeIntrinsic(LegalizerHelper &Helper,
MachineInstr &MI) const { … }
bool RISCVLegalizerInfo::legalizeVAStart(MachineInstr &MI,
MachineIRBuilder &MIRBuilder) const { … }
bool RISCVLegalizerInfo::shouldBeInConstantPool(APInt APImm,
bool ShouldOptForSize) const { … }
bool RISCVLegalizerInfo::legalizeVScale(MachineInstr &MI,
MachineIRBuilder &MIB) const { … }
bool RISCVLegalizerInfo::legalizeExt(MachineInstr &MI,
MachineIRBuilder &MIB) const { … }
bool RISCVLegalizerInfo::legalizeLoadStore(MachineInstr &MI,
LegalizerHelper &Helper,
MachineIRBuilder &MIB) const { … }
static LLT getMaskTypeFor(LLT VecTy) { … }
static MachineInstrBuilder buildAllOnesMask(LLT VecTy, const SrcOp &VL,
MachineIRBuilder &MIB,
MachineRegisterInfo &MRI) { … }
static std::pair<MachineInstrBuilder, MachineInstrBuilder>
buildDefaultVLOps(const DstOp &Dst, MachineIRBuilder &MIB,
MachineRegisterInfo &MRI) { … }
static MachineInstrBuilder
buildSplatPartsS64WithVL(const DstOp &Dst, const SrcOp &Passthru, Register Lo,
Register Hi, const SrcOp &VL, MachineIRBuilder &MIB,
MachineRegisterInfo &MRI) { … }
static MachineInstrBuilder
buildSplatSplitS64WithVL(const DstOp &Dst, const SrcOp &Passthru,
const SrcOp &Scalar, const SrcOp &VL,
MachineIRBuilder &MIB, MachineRegisterInfo &MRI) { … }
bool RISCVLegalizerInfo::legalizeSplatVector(MachineInstr &MI,
MachineIRBuilder &MIB) const { … }
static LLT getLMUL1Ty(LLT VecTy) { … }
bool RISCVLegalizerInfo::legalizeExtractSubvector(MachineInstr &MI,
MachineIRBuilder &MIB) const { … }
bool RISCVLegalizerInfo::legalizeCustom(
LegalizerHelper &Helper, MachineInstr &MI,
LostDebugLocObserver &LocObserver) const { … }