LLVM  6.0.0svn
Macros | Functions
XCoreISelLowering.cpp File Reference
#include "XCoreISelLowering.h"
#include "XCore.h"
#include "XCoreMachineFunctionInfo.h"
#include "XCoreSubtarget.h"
#include "XCoreTargetMachine.h"
#include "XCoreTargetObjectFile.h"
#include "llvm/CodeGen/CallingConvLower.h"
#include "llvm/CodeGen/MachineFrameInfo.h"
#include "llvm/CodeGen/MachineFunction.h"
#include "llvm/CodeGen/MachineInstrBuilder.h"
#include "llvm/CodeGen/MachineJumpTableInfo.h"
#include "llvm/CodeGen/MachineRegisterInfo.h"
#include "llvm/CodeGen/SelectionDAGISel.h"
#include "llvm/CodeGen/ValueTypes.h"
#include "llvm/IR/CallingConv.h"
#include "llvm/IR/Constants.h"
#include "llvm/IR/DerivedTypes.h"
#include "llvm/IR/Function.h"
#include "llvm/IR/GlobalAlias.h"
#include "llvm/IR/GlobalVariable.h"
#include "llvm/IR/Intrinsics.h"
#include "llvm/Support/Debug.h"
#include "llvm/Support/ErrorHandling.h"
#include "llvm/Support/KnownBits.h"
#include "llvm/Support/raw_ostream.h"
#include <algorithm>
#include "XCoreGenCallingConv.inc"
Include dependency graph for XCoreISelLowering.cpp:

Go to the source code of this file.

Macros

#define DEBUG_TYPE   "xcore-lower"
 

Functions

static bool IsSmallObject (const GlobalValue *GV, const XCoreTargetLowering &XTL)
 
static bool isWordAligned (SDValue Value, SelectionDAG &DAG)
 
static bool isADDADDMUL (SDValue Op, SDValue &Mul0, SDValue &Mul1, SDValue &Addend0, SDValue &Addend1, bool requireIntermediatesHaveOneUse)
 isADDADDMUL - Return whether Op is in a form that is equivalent to add(add(mul(x,y),a),b). More...
 
static SDValue LowerCallResult (SDValue Chain, SDValue InFlag, const SmallVectorImpl< CCValAssign > &RVLocs, const SDLoc &dl, SelectionDAG &DAG, SmallVectorImpl< SDValue > &InVals)
 LowerCallResult - Lower the result values of a call into the appropriate copies out of appropriate physical registers / memory locations. More...
 
static bool isImmUs (int64_t val)
 
static bool isImmUs2 (int64_t val)
 
static bool isImmUs4 (int64_t val)
 

Macro Definition Documentation

◆ DEBUG_TYPE

#define DEBUG_TYPE   "xcore-lower"

Definition at line 43 of file XCoreISelLowering.cpp.

Function Documentation

◆ isADDADDMUL()

static bool isADDADDMUL ( SDValue  Op,
SDValue Mul0,
SDValue Mul1,
SDValue Addend0,
SDValue Addend1,
bool  requireIntermediatesHaveOneUse 
)
static

isADDADDMUL - Return whether Op is in a form that is equivalent to add(add(mul(x,y),a),b).

If requireIntermediatesHaveOneUse is true then each intermediate result in the calculation must also have a single use. If the Op is in the correct form the constituent parts are written to Mul0, Mul1, Addend0 and Addend1.

Definition at line 598 of file XCoreISelLowering.cpp.

References llvm::ISD::ADD, assert(), llvm::ISD::ATOMIC_LOAD, llvm::ISD::ATOMIC_STORE, llvm::ISD::BUILD_PAIR, llvm::CallingConv::C, llvm::TargetLowering::CallLoweringInfo::CallConv, Callee, llvm::TargetLowering::CallLoweringInfo::Callee, llvm::TargetLowering::CallLoweringInfo::Chain, llvm::SelectionDAG::ComputeNumSignBits(), llvm::XCoreISD::CRC8, llvm::XCoreFunctionInfo::createLRSpillSlot(), llvm::TargetLowering::CallLoweringInfo::DAG, llvm::Data, llvm::TargetLowering::CallLoweringInfo::DL, llvm::XCoreISD::EH_RETURN, llvm::ISD::EXTLOAD, llvm::ISD::EXTRACT_ELEMENT, llvm::CallingConv::Fast, llvm::XCoreISD::FRAME_TO_ARGS_OFFSET, llvm::MemSDNode::getAAInfo(), llvm::MemSDNode::getAlignment(), llvm::AtomicSDNode::getBasePtr(), llvm::MemSDNode::getChain(), llvm::SelectionDAG::getConstant(), llvm::SelectionDAG::getCopyFromReg(), llvm::SelectionDAG::getCopyToReg(), llvm::SelectionDAG::getDataLayout(), llvm::SelectionDAG::getEntryNode(), llvm::SelectionDAG::getExtLoad(), llvm::MachinePointerInfo::getFixedStack(), llvm::MachineMemOperand::getFlags(), llvm::SelectionDAG::getFrameIndex(), llvm::TargetRegisterInfo::getFrameRegister(), llvm::APInt::getHighBitsSet(), llvm::MachineFunction::getInfo(), llvm::SelectionDAG::getIntPtrConstant(), llvm::SelectionDAG::getLoad(), llvm::SelectionDAG::getMachineFunction(), llvm::MemSDNode::getMemOperand(), llvm::MemSDNode::getMemoryVT(), llvm::SelectionDAG::getMergeValues(), llvm::SDValue::getNode(), llvm::SelectionDAG::getNode(), llvm::SDValue::getOpcode(), llvm::SDNode::getOpcode(), llvm::SDValue::getOperand(), llvm::SDNode::getOperand(), llvm::MemSDNode::getOrdering(), llvm::MemSDNode::getPointerInfo(), llvm::TargetLoweringBase::getPointerTy(), llvm::MemSDNode::getRanges(), llvm::SelectionDAG::getRegister(), llvm::XCoreSubtarget::getRegisterInfo(), llvm::EVT::getSizeInBits(), llvm::SelectionDAG::getStore(), llvm::SelectionDAG::getTruncStore(), llvm::AtomicSDNode::getVal(), llvm::SDValue::getValue(), llvm::SDValue::getValueType(), llvm::SDNode::getValueType(), llvm::XCoreFunctionInfo::getVarArgsFrameIndex(), llvm::SelectionDAG::getVTList(), llvm::SDValue::hasOneUse(), llvm::MipsISD::Hi, llvm::MVT::i16, llvm::MVT::i32, llvm::MVT::i64, llvm::MVT::i8, llvm::MipsISD::Ins, llvm::TargetLowering::CallLoweringInfo::Ins, llvm::TargetLowering::CallLoweringInfo::IsTailCall, llvm::TargetLowering::CallLoweringInfo::IsVarArg, llvm::XCoreISD::LADD, llvm::MipsISD::Lo, llvm::XCoreISD::LSUB, llvm::XCoreISD::MACCS, llvm::XCoreISD::MACCU, llvm::SelectionDAG::MaskedValueIsZero(), llvm::XCoreISD::MEMBARRIER, llvm::Monotonic, llvm::ISD::MUL, N, llvm::MVT::Other, Other, llvm::TargetLowering::CallLoweringInfo::Outs, llvm::TargetLowering::CallLoweringInfo::OutVals, R2, llvm::report_fatal_error(), Results, llvm::ISD::SUB, llvm::ISD::TokenFactor, and llvm::Unordered.

Referenced by llvm::XCoreTargetLowering::EmitInstrWithCustomInserter().

◆ isImmUs()

static bool isImmUs ( int64_t  val)
inlinestatic

◆ isImmUs2()

static bool isImmUs2 ( int64_t  val)
inlinestatic

Definition at line 1878 of file XCoreISelLowering.cpp.

References isImmUs().

Referenced by llvm::XCoreTargetLowering::isLegalAddressingMode().

◆ isImmUs4()

static bool isImmUs4 ( int64_t  val)
inlinestatic

Definition at line 1883 of file XCoreISelLowering.cpp.

References isImmUs().

Referenced by llvm::XCoreTargetLowering::isLegalAddressingMode().

◆ IsSmallObject()

static bool IsSmallObject ( const GlobalValue GV,
const XCoreTargetLowering XTL 
)
static

◆ isWordAligned()

static bool isWordAligned ( SDValue  Value,
SelectionDAG DAG 
)
static

Definition at line 408 of file XCoreISelLowering.cpp.

References llvm::ISD::ADD, llvm::TargetLoweringBase::allowsMisalignedMemoryAccesses(), llvm::AMDGPU::HSAMD::Kernel::Key::Args, assert(), llvm::CallingConv::C, llvm::SelectionDAG::computeKnownBits(), llvm::KnownBits::countMinTrailingZeros(), llvm::ISD::EXTLOAD, llvm::DataLayout::getABITypeAlignment(), llvm::MemSDNode::getAddressSpace(), llvm::GlobalValue::getAlignment(), llvm::MemSDNode::getAlignment(), llvm::LoadSDNode::getBasePtr(), llvm::StoreSDNode::getBasePtr(), llvm::MemSDNode::getChain(), llvm::SelectionDAG::getConstant(), llvm::SelectionDAG::getContext(), llvm::SelectionDAG::getDataLayout(), llvm::LoadSDNode::getExtensionType(), llvm::SelectionDAG::getExternalSymbol(), llvm::SelectionDAG::getExtLoad(), llvm::MachineMemOperand::getFlags(), llvm::SelectionDAG::getGlobalAddress(), llvm::DataLayout::getIntPtrType(), llvm::MemSDNode::getMemOperand(), llvm::MemSDNode::getMemoryVT(), llvm::SelectionDAG::getMergeValues(), llvm::SDValue::getNode(), llvm::SelectionDAG::getNode(), llvm::SDValue::getOpcode(), llvm::SDValue::getOperand(), llvm::SDNode::getOperand(), llvm::MemSDNode::getPointerInfo(), llvm::TargetLoweringBase::getPointerTy(), llvm::SelectionDAG::getTargetLoweringInfo(), llvm::SelectionDAG::getTruncStore(), llvm::EVT::getTypeForEVT(), llvm::SDValue::getValue(), llvm::StoreSDNode::getValue(), llvm::SDValue::getValueType(), llvm::SDNode::getValueType(), llvm::Type::getVoidTy(), llvm::SelectionDAG::getVTList(), llvm::MachinePointerInfo::getWithOffset(), llvm::MipsISD::Hi, High, llvm::MVT::i16, llvm::MVT::i32, llvm::SelectionDAG::isBaseWithConstantOffset(), llvm::TargetLowering::isGAPlusOffset(), llvm::StoreSDNode::isTruncatingStore(), llvm::MemSDNode::isVolatile(), llvm::ARM_MB::LD, llvm::XCoreISD::LMUL, llvm::MipsISD::Lo, llvm::TargetLowering::LowerCallTo(), llvm::XCoreISD::MACCS, llvm::MinAlign(), llvm::ISD::NON_EXTLOAD, llvm::ISD::OR, llvm::MVT::Other, llvm::TargetLowering::CallLoweringInfo::setCallee(), llvm::TargetLowering::CallLoweringInfo::setChain(), llvm::TargetLowering::CallLoweringInfo::setDebugLoc(), llvm::TargetLowering::CallLoweringInfo::setLibCallee(), llvm::ISD::SHL, llvm::ISD::SMUL_LOHI, llvm::ISD::SRL, llvm::ARM_MB::ST, llvm::ISD::TokenFactor, llvm::ISD::UMUL_LOHI, and llvm::ISD::ZEXTLOAD.

◆ LowerCallResult()

static SDValue LowerCallResult ( SDValue  Chain,
SDValue  InFlag,
const SmallVectorImpl< CCValAssign > &  RVLocs,
const SDLoc dl,
SelectionDAG DAG,
SmallVectorImpl< SDValue > &  InVals 
)
static

LowerCallResult - Lower the result values of a call into the appropriate copies out of appropriate physical registers / memory locations.

Definition at line 1059 of file XCoreISelLowering.cpp.

References llvm::MachineRegisterInfo::addLiveIn(), llvm::CCValAssign::AExt, llvm::AMDGPU::HSAMD::Kernel::Arg::Key::Align, llvm::CCState::AllocateStack(), llvm::CCState::AnalyzeFormalArguments(), llvm::ISD::ANY_EXTEND, Arg, llvm::array_lengthof(), assert(), llvm::SmallVectorTemplateCommon< T >::begin(), llvm::XCoreISD::BL, llvm::CallingConv::C, Callee, llvm::CCState::CheckReturn(), Context, llvm::MachineFrameInfo::CreateFixedObject(), llvm::MachineFrameInfo::CreateStackObject(), llvm::MachineRegisterInfo::createVirtualRegister(), E, llvm::SmallVectorBase::empty(), llvm::SmallVectorTemplateCommon< T >::end(), llvm::errs(), llvm::CallingConv::Fast, first, llvm::CCValAssign::Full, G, llvm::SelectionDAG::getCALLSEQ_END(), llvm::SelectionDAG::getCALLSEQ_START(), llvm::SelectionDAG::getConstant(), llvm::SelectionDAG::getContext(), llvm::SelectionDAG::getCopyFromReg(), llvm::SelectionDAG::getCopyToReg(), llvm::SelectionDAG::getDataLayout(), llvm::EVT::getEVTString(), llvm::MachinePointerInfo::getFixedStack(), llvm::SelectionDAG::getFrameIndex(), llvm::MachineFunction::getFrameInfo(), llvm::MachineFunction::getInfo(), llvm::SelectionDAG::getLoad(), llvm::CCValAssign::getLocInfo(), llvm::CCValAssign::getLocMemOffset(), llvm::CCValAssign::getLocReg(), llvm::CCValAssign::getLocVT(), llvm::SelectionDAG::getMachineFunction(), llvm::SelectionDAG::getMemcpy(), llvm::CCState::getNextStackOffset(), llvm::SDValue::getNode(), llvm::SelectionDAG::getNode(), llvm::SDNode::getNumValues(), llvm::TargetLoweringBase::getPointerTy(), llvm::MachineFunction::getRegInfo(), llvm::SelectionDAG::getRegister(), llvm::XCoreFunctionInfo::getReturnStackOffset(), llvm::EVT::getSimpleVT(), llvm::MVT::getSizeInBits(), llvm::SelectionDAG::getStore(), llvm::SelectionDAG::getTargetExternalSymbol(), llvm::SelectionDAG::getTargetGlobalAddress(), llvm::SDValue::getValue(), llvm::CCValAssign::getValVT(), llvm::SelectionDAG::getVTList(), llvm::MVT::Glue, llvm::MVT::i32, llvm::MipsISD::Ins, llvm::CCValAssign::isMemLoc(), llvm::CCValAssign::isRegLoc(), llvm::XCoreISD::LDWSP, llvm_unreachable, llvm::max(), llvm::MVT::Other, llvm::SmallVectorTemplateBase< T, isPodLike< T >::value >::push_back(), R2, llvm::report_fatal_error(), llvm::XCoreISD::RETSP, second, llvm::XCoreFunctionInfo::setReturnStackOffset(), llvm::XCoreFunctionInfo::setVarArgsFrameIndex(), llvm::CCValAssign::SExt, llvm::ISD::SIGN_EXTEND, llvm::MVT::SimpleTy, llvm::SmallVectorTemplateCommon< T >::size(), llvm::AMDGPU::HSAMD::Kernel::Arg::Key::Size, llvm::XCoreFrameLowering::stackSlotSize(), llvm::SPII::Store, llvm::XCoreISD::STWSP, llvm::ISD::TokenFactor, llvm::ISD::ZERO_EXTEND, and llvm::CCValAssign::ZExt.

Referenced by llvm::PPCTargetLowering::functionArgumentNeedsConsecutiveRegisters(), llvm::AVRTargetLowering::getCmpLibcallReturnType(), llvm::BPFTargetLowering::getHasJmpExt(), llvm::X86TargetLowering::getMaxSupportedInterleaveFactor(), llvm::MSP430TargetLowering::getScalarShiftAmountTy(), llvm::ARMTargetLowering::hasStandaloneRem(), llvm::HexagonTargetLowering::LowerCall(), and llvm::AArch64TargetLowering::supportSwiftError().