LLVM API Documentation
#include "PPCISelLowering.h"#include "PPCMachineFunctionInfo.h"#include "PPCPredicates.h"#include "PPCTargetMachine.h"#include "PPCPerfectShuffle.h"#include "llvm/ADT/STLExtras.h"#include "llvm/ADT/VectorExtras.h"#include "llvm/CodeGen/CallingConvLower.h"#include "llvm/CodeGen/MachineFrameInfo.h"#include "llvm/CodeGen/MachineFunction.h"#include "llvm/CodeGen/MachineInstrBuilder.h"#include "llvm/CodeGen/MachineRegisterInfo.h"#include "llvm/CodeGen/PseudoSourceValue.h"#include "llvm/CodeGen/SelectionDAG.h"#include "llvm/CallingConv.h"#include "llvm/Constants.h"#include "llvm/Function.h"#include "llvm/Intrinsics.h"#include "llvm/Support/MathExtras.h"#include "llvm/Target/TargetOptions.h"#include "llvm/Target/TargetLoweringObjectFile.h"#include "llvm/Support/CommandLine.h"#include "llvm/Support/ErrorHandling.h"#include "llvm/Support/raw_ostream.h"#include "llvm/DerivedTypes.h"#include "PPCGenCallingConv.inc"
Go to the source code of this file.
| static SDValue BuildIntrinsicOp | ( | unsigned | IID, | |
| SDValue | Op0, | |||
| SDValue | Op1, | |||
| SDValue | Op2, | |||
| SelectionDAG & | DAG, | |||
| DebugLoc | dl, | |||
| EVT | DestVT = MVT::Other | |||
| ) | [static] |
BuildIntrinsicOp - Return a ternary operator intrinsic node with the specified intrinsic ID.
Definition at line 3599 of file PPCISelLowering.cpp.
References llvm::SelectionDAG::getConstant(), llvm::SelectionDAG::getNode(), llvm::SDValue::getValueType(), llvm::ISD::INTRINSIC_WO_CHAIN, and llvm::MVT::Other.
| static SDValue BuildIntrinsicOp | ( | unsigned | IID, | |
| SDValue | LHS, | |||
| SDValue | RHS, | |||
| SelectionDAG & | DAG, | |||
| DebugLoc | dl, | |||
| EVT | DestVT = MVT::Other | |||
| ) | [static] |
BuildIntrinsicOp - Return a binary operator intrinsic node with the specified intrinsic ID.
Definition at line 3589 of file PPCISelLowering.cpp.
References llvm::SelectionDAG::getConstant(), llvm::SelectionDAG::getNode(), llvm::SDValue::getValueType(), llvm::ISD::INTRINSIC_WO_CHAIN, and llvm::MVT::Other.
| static SDValue BuildSplatI | ( | int | Val, | |
| unsigned | SplatSize, | |||
| EVT | VT, | |||
| SelectionDAG & | DAG, | |||
| DebugLoc | dl | |||
| ) | [static] |
BuildSplatI - Build a canonical splati of Val with an element size of SplatSize. Cast the result to VT.
Definition at line 3562 of file PPCISelLowering.cpp.
References llvm::SmallVectorImpl< T >::assign(), llvm::ISD::BIT_CONVERT, llvm::ISD::BUILD_VECTOR, llvm::SelectionDAG::getConstant(), llvm::SelectionDAG::getNode(), llvm::EVT::getVectorNumElements(), llvm::MVT::Other, llvm::SmallVectorImpl< T >::size(), llvm::MVT::v16i8, llvm::MVT::v4i32, and llvm::MVT::v8i16.
| static SDValue BuildVSLDOI | ( | SDValue | LHS, | |
| SDValue | RHS, | |||
| unsigned | Amt, | |||
| EVT | VT, | |||
| SelectionDAG & | DAG, | |||
| DebugLoc | dl | |||
| ) | [static] |
BuildVSLDOI - Return a VECTOR_SHUFFLE that is a vsldoi of the specified amount. The result has the specified value type.
Definition at line 3610 of file PPCISelLowering.cpp.
References llvm::ISD::BIT_CONVERT, llvm::SelectionDAG::getNode(), llvm::SelectionDAG::getVectorShuffle(), T, and llvm::MVT::v16i8.
Referenced by GeneratePerfectShuffle().
| static unsigned CalculateParameterAndLinkageAreaSize | ( | SelectionDAG & | DAG, | |
| bool | isPPC64, | |||
| bool | isVarArg, | |||
| unsigned | CC, | |||
| const SmallVectorImpl< ISD::OutputArg > & | Outs, | |||
| unsigned & | nAltivecParamsAtEnd | |||
| ) | [static] |
CalculateParameterAndLinkageAreaSize - Get the size of the paramter plus linkage area for the Darwin ABI.
Definition at line 2080 of file PPCISelLowering.cpp.
References Arg, CalculateStackSlotSize(), llvm::CallingConv::Fast, llvm::TargetMachine::getFrameInfo(), llvm::PPCFrameInfo::getLinkageSize(), llvm::SelectionDAG::getMachineFunction(), llvm::PPCFrameInfo::getMinCallFrameSize(), llvm::MachineFunction::getTarget(), llvm::SDValue::getValueType(), llvm::PerformTailCallOpt, llvm::SmallVectorImpl< T >::size(), llvm::MVT::v16i8, llvm::MVT::v4f32, llvm::MVT::v4i32, and llvm::MVT::v8i16.
| static unsigned CalculateStackSlotSize | ( | EVT | ArgVT, | |
| ISD::ArgFlagsTy | Flags, | |||
| unsigned | PtrByteSize | |||
| ) | [static] |
CalculateStackSlotSize - Calculates the size reserved for this argument on the stack.
Definition at line 1475 of file PPCISelLowering.cpp.
References llvm::ISD::ArgFlagsTy::getByValSize(), llvm::EVT::getSizeInBits(), and llvm::ISD::ArgFlagsTy::isByVal().
Referenced by CalculateParameterAndLinkageAreaSize().
| static void CalculateTailCallArgDest | ( | SelectionDAG & | DAG, | |
| MachineFunction & | MF, | |||
| bool | isPPC64, | |||
| SDValue | Arg, | |||
| int | SPDiff, | |||
| unsigned | ArgOffset, | |||
| SmallVector< TailCallArgumentInfo, 8 > & | TailCallArguments | |||
| ) | [static] |
CalculateTailCallArgDest - Remember Argument for later processing. Calculate the position of the argument.
Definition at line 2283 of file PPCISelLowering.cpp.
References llvm::MachineFrameInfo::CreateFixedObject(), llvm::SelectionDAG::getFrameIndex(), llvm::MachineFunction::getFrameInfo(), llvm::EVT::getSizeInBits(), llvm::SDValue::getValueType(), llvm::MVT::i64, Offset, llvm::X86II::OpSize, and llvm::SmallVectorImpl< T >::push_back().
Referenced by LowerMemOpCallTo().
| static int CalculateTailCallSPDiff | ( | SelectionDAG & | DAG, | |
| bool | IsTailCall, | |||
| unsigned | ParamSize | |||
| ) | [static] |
CalculateTailCallSPDiff - Get the amount the stack pointer has to be adjusted to accomodate the arguments for the tailcall.
Definition at line 2147 of file PPCISelLowering.cpp.
References llvm::MachineFunction::getInfo(), llvm::SelectionDAG::getMachineFunction(), llvm::PPCFunctionInfo::getMinReservedArea(), and llvm::PPCFunctionInfo::setTailCallSPDelta().
| static bool CC_PPC_SVR4_Custom_AlignArgRegs | ( | unsigned & | ValNo, | |
| EVT & | ValVT, | |||
| EVT & | LocVT, | |||
| CCValAssign::LocInfo & | LocInfo, | |||
| ISD::ArgFlagsTy & | ArgFlags, | |||
| CCState & | State | |||
| ) | [static] |
Definition at line 1408 of file PPCISelLowering.cpp.
References llvm::CCState::AllocateReg(), llvm::array_lengthof(), and llvm::CCState::getFirstUnallocated().
| static bool CC_PPC_SVR4_Custom_AlignFPArgRegs | ( | unsigned & | ValNo, | |
| EVT & | ValVT, | |||
| EVT & | LocVT, | |||
| CCValAssign::LocInfo & | LocInfo, | |||
| ISD::ArgFlagsTy & | ArgFlags, | |||
| CCState & | State | |||
| ) | [static] |
Definition at line 1435 of file PPCISelLowering.cpp.
References llvm::CCState::AllocateReg(), llvm::array_lengthof(), and llvm::CCState::getFirstUnallocated().
| static bool CC_PPC_SVR4_Custom_Dummy | ( | unsigned & | ValNo, | |
| EVT & | ValVT, | |||
| EVT & | LocVT, | |||
| CCValAssign::LocInfo & | LocInfo, | |||
| ISD::ArgFlagsTy & | ArgFlags, | |||
| CCState & | State | |||
| ) | [static] |
Definition at line 1401 of file PPCISelLowering.cpp.
| static SDValue CreateCopyOfByValArgument | ( | SDValue | Src, | |
| SDValue | Dst, | |||
| SDValue | Chain, | |||
| ISD::ArgFlagsTy | Flags, | |||
| SelectionDAG & | DAG, | |||
| DebugLoc | dl | |||
| ) | [static] |
CreateCopyOfByValArgument - Make a copy of an aggregate at address specified by "Src" to address "Dst" of size "Size". Alignment information is specified by the specific parameter attribute. The copy will be passed as a byval function parameter. Sometimes what we are copying is the end of a larger object, the part that does not fit in registers.
Definition at line 2333 of file PPCISelLowering.cpp.
References llvm::ISD::ArgFlagsTy::getByValAlign(), llvm::ISD::ArgFlagsTy::getByValSize(), llvm::SelectionDAG::getConstant(), and llvm::SelectionDAG::getMemcpy().
| static TargetLoweringObjectFile* CreateTLOF | ( | const PPCTargetMachine & | TM | ) | [static] |
Definition at line 60 of file PPCISelLowering.cpp.
References llvm::PPCTargetMachine::getSubtargetImpl(), and llvm::PPCSubtarget::isDarwin().
| static SDValue EmitTailCallStoreFPAndRetAddr | ( | SelectionDAG & | DAG, | |
| MachineFunction & | MF, | |||
| SDValue | Chain, | |||
| SDValue | OldRetAddr, | |||
| SDValue | OldFP, | |||
| int | SPDiff, | |||
| bool | isPPC64, | |||
| bool | isDarwinABI, | |||
| DebugLoc | dl | |||
| ) | [static] |
EmitTailCallStoreFPAndRetAddr - Move the frame pointer and return address to the appropriate stack slot for the tail call optimized function call.
Definition at line 2245 of file PPCISelLowering.cpp.
References llvm::MachineFrameInfo::CreateFixedObject(), llvm::PseudoSourceValue::getFixedStack(), llvm::SelectionDAG::getFrameIndex(), llvm::MachineFunction::getFrameInfo(), llvm::PPCFrameInfo::getFramePointerSaveOffset(), llvm::PPCFrameInfo::getReturnSaveOffset(), llvm::SelectionDAG::getStore(), and llvm::MVT::i64.
Referenced by PrepareTailCall().
| static SDValue GeneratePerfectShuffle | ( | unsigned | PFEntry, | |
| SDValue | LHS, | |||
| SDValue | RHS, | |||
| SelectionDAG & | DAG, | |||
| DebugLoc | dl | |||
| ) | [static] |
GeneratePerfectShuffle - Given an entry in the perfect-shuffle table, emit the specified operations to build the shuffle.
Definition at line 3790 of file PPCISelLowering.cpp.
References llvm::ISD::BIT_CONVERT, BuildVSLDOI(), GeneratePerfectShuffle(), llvm::SelectionDAG::getNode(), llvm::SDValue::getValueType(), llvm::SelectionDAG::getVectorShuffle(), llvm_unreachable, PerfectShuffleTable, and llvm::MVT::v16i8.
getAltivecCompareInfo - Given an intrinsic, return false if it is not an altivec comparison. If it is, return true and fill in Opc/isDot with information about the intrinsic.
Definition at line 3992 of file PPCISelLowering.cpp.
References llvm::SDValue::getOperand(), llvm::Intrinsic::ppc_altivec_vcmpbfp, llvm::Intrinsic::ppc_altivec_vcmpbfp_p, llvm::Intrinsic::ppc_altivec_vcmpeqfp, llvm::Intrinsic::ppc_altivec_vcmpeqfp_p, llvm::Intrinsic::ppc_altivec_vcmpequb, llvm::Intrinsic::ppc_altivec_vcmpequb_p, llvm::Intrinsic::ppc_altivec_vcmpequh, llvm::Intrinsic::ppc_altivec_vcmpequh_p, llvm::Intrinsic::ppc_altivec_vcmpequw, llvm::Intrinsic::ppc_altivec_vcmpequw_p, llvm::Intrinsic::ppc_altivec_vcmpgefp, llvm::Intrinsic::ppc_altivec_vcmpgefp_p, llvm::Intrinsic::ppc_altivec_vcmpgtfp, llvm::Intrinsic::ppc_altivec_vcmpgtfp_p, llvm::Intrinsic::ppc_altivec_vcmpgtsb, llvm::Intrinsic::ppc_altivec_vcmpgtsb_p, llvm::Intrinsic::ppc_altivec_vcmpgtsh, llvm::Intrinsic::ppc_altivec_vcmpgtsh_p, llvm::Intrinsic::ppc_altivec_vcmpgtsw, llvm::Intrinsic::ppc_altivec_vcmpgtsw_p, llvm::Intrinsic::ppc_altivec_vcmpgtub, llvm::Intrinsic::ppc_altivec_vcmpgtub_p, llvm::Intrinsic::ppc_altivec_vcmpgtuh, llvm::Intrinsic::ppc_altivec_vcmpgtuh_p, llvm::Intrinsic::ppc_altivec_vcmpgtuw, and llvm::Intrinsic::ppc_altivec_vcmpgtuw_p.
Referenced by llvm::PPCTargetLowering::PerformDAGCombine().
| static const unsigned* GetFPR | ( | ) | [static] |
GetFPR - Get the set of FP registers that should be allocated for arguments, on Darwin.
Definition at line 1464 of file PPCISelLowering.cpp.
| static SDNode* isBLACompatibleAddress | ( | SDValue | Op, | |
| SelectionDAG & | DAG | |||
| ) | [static] |
isCallCompatibleAddress - Return the immediate to use if the specified 32-bit value is representable in the immediate field of a BxA instruction.
Definition at line 2200 of file PPCISelLowering.cpp.
References llvm::dyn_cast(), llvm::SelectionDAG::getConstant(), llvm::TargetLowering::getPointerTy(), llvm::SelectionDAG::getTargetLoweringInfo(), and llvm::ConstantSDNode::getZExtValue().
Referenced by PrepareCall().
| static bool isConstantOrUndef | ( | int | Op, | |
| int | Val | |||
| ) | [static] |
isConstantOrUndef - Op is either an undef node or a ConstantSDNode. Return true if Op is undef or if it matches the specified value.
Definition at line 486 of file PPCISelLowering.cpp.
Referenced by isVMerge(), llvm::PPC::isVPKUHUMShuffleMask(), llvm::PPC::isVPKUWUMShuffleMask(), and llvm::PPC::isVSLDOIShuffleMask().
isFloatingPointZero - Return true if this is 0.0 or -0.0.
Definition at line 472 of file PPCISelLowering.cpp.
References CP, llvm::SDValue::getNode(), llvm::SDValue::getOperand(), llvm::ISD::isEXTLoad(), and llvm::ISD::isNON_EXTLoad().
Definition at line 784 of file PPCISelLowering.cpp.
References llvm::SDValue::getNode(), and isIntS16Immediate().
isIntS16Immediate - This method tests to see if the node is either a 32-bit or 64-bit immediate, and if the value can be accurately represented as a sign extension from a 16-bit value. If so, this returns true and the immediate.
Definition at line 774 of file PPCISelLowering.cpp.
References llvm::ISD::Constant, llvm::SDNode::getOpcode(), llvm::SDNode::getValueType(), and llvm::MVT::i32.
| static bool isVMerge | ( | ShuffleVectorSDNode * | N, | |
| unsigned | UnitSize, | |||
| unsigned | LHSStart, | |||
| unsigned | RHSStart | |||
| ) | [static] |
isVMerge - Common function, used to match vmrg* shuffles.
Definition at line 527 of file PPCISelLowering.cpp.
References llvm::ShuffleVectorSDNode::getMaskElt(), llvm::SDNode::getValueType(), isConstantOrUndef(), and llvm::MVT::v16i8.
Referenced by llvm::PPC::isVMRGHShuffleMask(), and llvm::PPC::isVMRGLShuffleMask().
| static void LowerMemOpCallTo | ( | SelectionDAG & | DAG, | |
| MachineFunction & | MF, | |||
| SDValue | Chain, | |||
| SDValue | Arg, | |||
| SDValue | PtrOff, | |||
| int | SPDiff, | |||
| unsigned | ArgOffset, | |||
| bool | isPPC64, | |||
| bool | isTailCall, | |||
| bool | isVector, | |||
| SmallVector< SDValue, 8 > & | MemOpChains, | |||
| SmallVector< TailCallArgumentInfo, 8 > & | TailCallArguments, | |||
| DebugLoc | dl | |||
| ) | [static] |
LowerMemOpCallTo - Store the argument to the stack or remember it in case of tail calls.
Definition at line 2344 of file PPCISelLowering.cpp.
References llvm::ISD::ADD, CalculateTailCallArgDest(), llvm::SelectionDAG::getConstant(), llvm::SelectionDAG::getNode(), llvm::TargetLowering::getPointerTy(), llvm::SelectionDAG::getRegister(), llvm::SelectionDAG::getStore(), llvm::SelectionDAG::getTargetLoweringInfo(), llvm::MVT::i64, llvm::SmallVectorImpl< T >::push_back(), and StackPtr.
| static unsigned PrepareCall | ( | SelectionDAG & | DAG, | |
| SDValue & | Callee, | |||
| SDValue & | InFlag, | |||
| SDValue & | Chain, | |||
| DebugLoc | dl, | |||
| int | SPDiff, | |||
| bool | isTailCall, | |||
| SmallVector< std::pair< unsigned, SDValue >, 8 > & | RegsToPass, | |||
| SmallVector< SDValue, 8 > & | Ops, | |||
| std::vector< EVT > & | NodeTys, | |||
| bool | isSVR4ABI | |||
| ) | [static] |
Definition at line 2396 of file PPCISelLowering.cpp.
References llvm::PPCISD::BCTRL_Darwin, llvm::PPCISD::BCTRL_SVR4, llvm::PPCISD::CALL_Darwin, llvm::PPCISD::CALL_SVR4, Dest, llvm::MVT::Flag, G, llvm::SelectionDAG::getConstant(), llvm::SDValue::getNode(), llvm::SelectionDAG::getNode(), llvm::TargetLowering::getPointerTy(), llvm::SelectionDAG::getRegister(), llvm::SelectionDAG::getTargetExternalSymbol(), llvm::SelectionDAG::getTargetGlobalAddress(), llvm::SelectionDAG::getTargetLoweringInfo(), llvm::SDValue::getValue(), llvm::SDValue::getValueType(), isBLACompatibleAddress(), llvm::PPCISD::MTCTR, llvm::MVT::Other, llvm::SmallVectorImpl< T >::push_back(), S, and llvm::SDValue::setNode().
| static void PrepareTailCall | ( | SelectionDAG & | DAG, | |
| SDValue & | InFlag, | |||
| SDValue & | Chain, | |||
| DebugLoc | dl, | |||
| bool | isPPC64, | |||
| int | SPDiff, | |||
| unsigned | NumBytes, | |||
| SDValue | LROp, | |||
| SDValue | FPOp, | |||
| bool | isDarwinABI, | |||
| SmallVector< TailCallArgumentInfo, 8 > & | TailCallArguments | |||
| ) | [static] |
Definition at line 2368 of file PPCISelLowering.cpp.
References EmitTailCallStoreFPAndRetAddr(), llvm::SmallVectorImpl< T >::empty(), llvm::SelectionDAG::getCALLSEQ_END(), llvm::SelectionDAG::getIntPtrConstant(), llvm::SelectionDAG::getMachineFunction(), llvm::SelectionDAG::getNode(), llvm::SDValue::getValue(), llvm::MVT::Other, llvm::SmallVectorImpl< T >::size(), StoreTailCallArgumentsToStackSlot(), and llvm::ISD::TokenFactor.
| static void StoreTailCallArgumentsToStackSlot | ( | SelectionDAG & | DAG, | |
| SDValue | Chain, | |||
| const SmallVector< TailCallArgumentInfo, 8 > & | TailCallArgs, | |||
| SmallVector< SDValue, 8 > & | MemOpChains, | |||
| DebugLoc | dl | |||
| ) | [static] |
StoreTailCallArgumentsToStackSlot - Stores arguments to their stack slot.
Definition at line 2227 of file PPCISelLowering.cpp.
References Arg, llvm::PseudoSourceValue::getFixedStack(), llvm::SelectionDAG::getStore(), llvm::SmallVectorImpl< T >::push_back(), and llvm::SmallVectorImpl< T >::size().
Referenced by PrepareTailCall().
Definition at line 2216 of file PPCISelLowering.cpp.
Referenced by ByteswapSCANFResults(), CalculateParameterAndLinkageAreaSize(), isDynamicConstant(), LowerByteImmed(), llvm::SPUTargetLowering::LowerCall(), llvm::SparcTargetLowering::LowerCall(), llvm::PIC16TargetLowering::LowerDirectCallArguments(), llvm::SparcTargetLowering::LowerFormalArguments(), llvm::PIC16TargetLowering::LowerIndirectCallArguments(), StoreTailCallArgumentsToStackSlot(), and StripDebugInfo().
cl::opt<bool> EnablePPCPreinc("enable-ppc-preinc", cl::desc("enable preincrement load/store generation on PPC (experimental)"), cl::Hidden) [static] |
Referenced by llvm::PPCTargetLowering::getPreIndexedAddressParts().
| int FrameIdx |
Definition at line 2218 of file PPCISelLowering.cpp.
Referenced by ComputeReloadLoc(), llvm::SelectionDAG::CreateStackTemporary(), InferAlignment(), llvm::SparcTargetLowering::LowerFormalArguments(), llvm::XCoreRegisterInfo::processFunctionBeforeCalleeSavedScan(), llvm::X86RegisterInfo::processFunctionBeforeCalleeSavedScan(), and llvm::MSP430RegisterInfo::processFunctionBeforeFrameFinalized().
Definition at line 2217 of file PPCISelLowering.cpp.