#include "R600ISelLowering.h"
#include "AMDGPU.h"
#include "MCTargetDesc/R600MCTargetDesc.h"
#include "R600Defines.h"
#include "R600MachineFunctionInfo.h"
#include "R600Subtarget.h"
#include "R600TargetMachine.h"
#include "llvm/CodeGen/MachineFunction.h"
#include "llvm/IR/IntrinsicsAMDGPU.h"
#include "llvm/IR/IntrinsicsR600.h"
usingnamespacellvm;
#include "R600GenCallingConv.inc"
R600TargetLowering::R600TargetLowering(const TargetMachine &TM,
const R600Subtarget &STI)
: … { … }
static inline bool isEOP(MachineBasicBlock::iterator I) { … }
MachineBasicBlock *
R600TargetLowering::EmitInstrWithCustomInserter(MachineInstr &MI,
MachineBasicBlock *BB) const { … }
SDValue R600TargetLowering::LowerOperation(SDValue Op, SelectionDAG &DAG) const { … }
void R600TargetLowering::ReplaceNodeResults(SDNode *N,
SmallVectorImpl<SDValue> &Results,
SelectionDAG &DAG) const { … }
SDValue R600TargetLowering::vectorToVerticalVector(SelectionDAG &DAG,
SDValue Vector) const { … }
SDValue R600TargetLowering::LowerEXTRACT_VECTOR_ELT(SDValue Op,
SelectionDAG &DAG) const { … }
SDValue R600TargetLowering::LowerINSERT_VECTOR_ELT(SDValue Op,
SelectionDAG &DAG) const { … }
SDValue R600TargetLowering::LowerGlobalAddress(AMDGPUMachineFunction *MFI,
SDValue Op,
SelectionDAG &DAG) const { … }
SDValue R600TargetLowering::LowerTrig(SDValue Op, SelectionDAG &DAG) const { … }
SDValue R600TargetLowering::LowerShiftParts(SDValue Op,
SelectionDAG &DAG) const { … }
SDValue R600TargetLowering::LowerUADDSUBO(SDValue Op, SelectionDAG &DAG,
unsigned mainop, unsigned ovf) const { … }
SDValue R600TargetLowering::lowerFP_TO_UINT(SDValue Op, SelectionDAG &DAG) const { … }
SDValue R600TargetLowering::lowerFP_TO_SINT(SDValue Op, SelectionDAG &DAG) const { … }
SDValue R600TargetLowering::LowerImplicitParameter(SelectionDAG &DAG, EVT VT,
const SDLoc &DL,
unsigned DwordOffset) const { … }
bool R600TargetLowering::isZero(SDValue Op) const { … }
bool R600TargetLowering::isHWTrueValue(SDValue Op) const { … }
bool R600TargetLowering::isHWFalseValue(SDValue Op) const { … }
SDValue R600TargetLowering::LowerSELECT_CC(SDValue Op, SelectionDAG &DAG) const { … }
SDValue R600TargetLowering::lowerADDRSPACECAST(SDValue Op,
SelectionDAG &DAG) const { … }
SDValue R600TargetLowering::stackPtrToRegIndex(SDValue Ptr,
unsigned StackWidth,
SelectionDAG &DAG) const { … }
void R600TargetLowering::getStackAddress(unsigned StackWidth,
unsigned ElemIdx,
unsigned &Channel,
unsigned &PtrIncr) const { … }
SDValue R600TargetLowering::lowerPrivateTruncStore(StoreSDNode *Store,
SelectionDAG &DAG) const { … }
SDValue R600TargetLowering::LowerSTORE(SDValue Op, SelectionDAG &DAG) const { … }
static int
ConstantAddressBlock(unsigned AddressSpace) { … }
SDValue R600TargetLowering::lowerPrivateExtLoad(SDValue Op,
SelectionDAG &DAG) const { … }
SDValue R600TargetLowering::LowerLOAD(SDValue Op, SelectionDAG &DAG) const { … }
SDValue R600TargetLowering::LowerBRCOND(SDValue Op, SelectionDAG &DAG) const { … }
SDValue R600TargetLowering::lowerFrameIndex(SDValue Op,
SelectionDAG &DAG) const { … }
CCAssignFn *R600TargetLowering::CCAssignFnForCall(CallingConv::ID CC,
bool IsVarArg) const { … }
SDValue R600TargetLowering::LowerFormalArguments(
SDValue Chain, CallingConv::ID CallConv, bool isVarArg,
const SmallVectorImpl<ISD::InputArg> &Ins, const SDLoc &DL,
SelectionDAG &DAG, SmallVectorImpl<SDValue> &InVals) const { … }
EVT R600TargetLowering::getSetCCResultType(const DataLayout &DL, LLVMContext &,
EVT VT) const { … }
bool R600TargetLowering::canMergeStoresTo(unsigned AS, EVT MemVT,
const MachineFunction &MF) const { … }
bool R600TargetLowering::allowsMisalignedMemoryAccesses(
EVT VT, unsigned AddrSpace, Align Alignment, MachineMemOperand::Flags Flags,
unsigned *IsFast) const { … }
static SDValue CompactSwizzlableVector(
SelectionDAG &DAG, SDValue VectorEntry,
DenseMap<unsigned, unsigned> &RemapSwizzle) { … }
static SDValue ReorganizeVector(SelectionDAG &DAG, SDValue VectorEntry,
DenseMap<unsigned, unsigned> &RemapSwizzle) { … }
SDValue R600TargetLowering::OptimizeSwizzle(SDValue BuildVector, SDValue Swz[],
SelectionDAG &DAG,
const SDLoc &DL) const { … }
SDValue R600TargetLowering::constBufferLoad(LoadSDNode *LoadNode, int Block,
SelectionDAG &DAG) const { … }
SDValue R600TargetLowering::PerformDAGCombine(SDNode *N,
DAGCombinerInfo &DCI) const { … }
bool R600TargetLowering::FoldOperand(SDNode *ParentNode, unsigned SrcIdx,
SDValue &Src, SDValue &Neg, SDValue &Abs,
SDValue &Sel, SDValue &Imm,
SelectionDAG &DAG) const { … }
SDNode *R600TargetLowering::PostISelFolding(MachineSDNode *Node,
SelectionDAG &DAG) const { … }
TargetLowering::AtomicExpansionKind
R600TargetLowering::shouldExpandAtomicRMWInIR(AtomicRMWInst *RMW) const { … }