LLVM: lib/Target/M68k/M68kISelLowering.cpp File Reference (original) (raw)

This file defines the interfaces that M68k uses to lower LLVM code into a selection DAG. More...

Go to the source code of this file.

Macros
#define DEBUG_TYPE "M68k-isel"
Functions
STATISTIC (NumTailCalls, "Number of tail calls")
static StructReturnType callIsStructReturn (const SmallVectorImpl< ISD::OutputArg > &Outs)
static StructReturnType argsAreStructReturn (const SmallVectorImpl< ISD::InputArg > &Ins)
Determines whether a function uses struct return semantics.
static SDValue CreateCopyOfByValArgument (SDValue Src, SDValue Dst, SDValue Chain, ISD::ArgFlagsTy Flags, SelectionDAG &DAG, const SDLoc &DL)
Make a copy of an aggregate at address specified by "Src" to address "Dst" with size and alignment information specified by the specific parameter attribute.
static bool canGuaranteeTCO (CallingConv::ID CC)
Return true if the calling convention is one that we can guarantee TCO for.
static bool mayTailCallThisCC (CallingConv::ID CC)
Return true if we might ever do TCO for calls with this calling convention.
static bool shouldGuaranteeTCO (CallingConv::ID CC, bool GuaranteedTailCallOpt)
Return true if the function is being made into a tailcall target by changing its ABI.
static bool MatchingStackOffset (SDValue Arg, unsigned Offset, ISD::ArgFlagsTy Flags, MachineFrameInfo &MFI, const MachineRegisterInfo *MRI, const M68kInstrInfo *TII, const CCValAssign &VA)
Return true if the given stack call argument is already available in the same position (relatively) of the caller's incoming argument stack.
static bool isOverflowArithmetic (unsigned Opcode)
static void lowerOverflowArithmetic (SDValue Op, SelectionDAG &DAG, SDValue &Result, SDValue &CCR, unsigned &CC)
static SDValue getBitTestCondition (SDValue Src, SDValue BitNo, ISD::CondCode CC, const SDLoc &DL, SelectionDAG &DAG)
Create a BTST (Bit Test) node - Test bit BitNo in Src and set condition according to equal/not-equal condition code CC.
static SDValue LowerAndToBTST (SDValue And, ISD::CondCode CC, const SDLoc &DL, SelectionDAG &DAG)
Result of 'and' is compared against zero. Change to a BTST node if possible.
static M68k::CondCode TranslateIntegerM68kCC (ISD::CondCode SetCCOpcode)
static unsigned TranslateM68kCC (ISD::CondCode SetCCOpcode, const SDLoc &DL, bool IsFP, SDValue &LHS, SDValue &RHS, SelectionDAG &DAG)
Do a one-to-one translation of a ISD::CondCode to the M68k-specific condition code, returning the condition code and the LHS/RHS of the comparison to make.
static SDValue LowerTruncateToBTST (SDValue Op, ISD::CondCode CC, const SDLoc &DL, SelectionDAG &DAG)
static bool hasNonFlagsUse (SDValue Op)
return true if Op has a use that doesn't just read flags.
static bool isM68kCCUnsigned (unsigned M68kCC)
Return true if the condition is an unsigned comparison operation.
static bool isM68kLogicalCmp (SDValue Op)
Return true if opcode is a M68k logical comparison.
static bool isTruncWithZeroHighBitsInput (SDValue V, SelectionDAG &DAG)
static bool isAndOrOfSetCCs (SDValue Op, unsigned &Opc)
Return true if node is an ISD::AND or ISD::OR of two M68k::SETcc nodes each of which has no other use apart from the AND / OR.
static bool isXor1OfSetCC (SDValue Op)
Return true if node is an ISD::XOR of a M68kISD::SETCC and 1 and that the SETCC node has a single use.
static bool isCMOVPseudo (MachineInstr &MI)
static bool checkAndUpdateCCRKill (MachineBasicBlock::iterator SelectItr, MachineBasicBlock *BB, const TargetRegisterInfo *TRI)
static SDValue getSETCC (M68k::CondCode Cond, SDValue CCR, const SDLoc &dl, SelectionDAG &DAG)
static SDValue combineCarryThroughADD (SDValue CCR)
static SDValue combineSetCCCCR (SDValue CCR, M68k::CondCode &CC, SelectionDAG &DAG, const M68kSubtarget &Subtarget)
Optimize a CCR definition used according to the condition code CC into a simpler CCR value, potentially returning a new CC and replacing uses of chain values.
static SDValue combineM68kSetCC (SDNode *N, SelectionDAG &DAG, const M68kSubtarget &Subtarget)
static SDValue combineM68kBrCond (SDNode *N, SelectionDAG &DAG, const M68kSubtarget &Subtarget)
static SDValue combineSUBX (SDNode *N, SelectionDAG &DAG)
static SDValue combineADDX (SDNode *N, SelectionDAG &DAG, TargetLowering::DAGCombinerInfo &DCI)

This file defines the interfaces that M68k uses to lower LLVM code into a selection DAG.

Definition in file M68kISelLowering.cpp.

DEBUG_TYPE

#define DEBUG_TYPE "M68k-isel"

StructReturnType

argsAreStructReturn()

callIsStructReturn()

canGuaranteeTCO()

Return true if the calling convention is one that we can guarantee TCO for.

Definition at line 279 of file M68kISelLowering.cpp.

checkAndUpdateCCRKill()

combineADDX()

combineCarryThroughADD()

Definition at line 3537 of file M68kISelLowering.cpp.

References llvm::ISD::AND, llvm::ISD::ANY_EXTEND, llvm::M68k::COND_CS, llvm::SDValue::getConstantOperandVal(), llvm::SDValue::getOpcode(), llvm::SDValue::getOperand(), llvm::isAllOnesConstant(), llvm::isOneConstant(), SDValue(), llvm::ISD::SIGN_EXTEND, llvm::ISD::TRUNCATE, and llvm::ISD::ZERO_EXTEND.

Referenced by combineADC(), combineADDX(), combineSBB(), combineSetCCCCR(), combineSetCCEFLAGS(), and combineSUBX().

combineM68kBrCond()

combineM68kSetCC()

combineSetCCCCR()

combineSUBX()

CreateCopyOfByValArgument()

getBitTestCondition()

getSETCC()

hasNonFlagsUse()

isAndOrOfSetCCs()

isCMOVPseudo()

isM68kCCUnsigned()

Return true if the condition is an unsigned comparison operation.

Definition at line 2084 of file M68kISelLowering.cpp.

References llvm::M68k::COND_CC, llvm::M68k::COND_CS, llvm::M68k::COND_EQ, llvm::M68k::COND_GE, llvm::M68k::COND_GT, llvm::M68k::COND_HI, llvm::M68k::COND_LE, llvm::M68k::COND_LS, llvm::M68k::COND_LT, llvm::M68k::COND_NE, and llvm_unreachable.

isM68kLogicalCmp()

isOverflowArithmetic()

isTruncWithZeroHighBitsInput()

isXor1OfSetCC()

LowerAndToBTST()

Result of 'and' is compared against zero. Change to a BTST node if possible.

Definition at line 1676 of file M68kISelLowering.cpp.

References llvm::BitWidth, llvm::SelectionDAG::computeKnownBits(), DL, llvm::dyn_cast(), getBitTestCondition(), llvm::SelectionDAG::getConstant(), llvm::SDValue::getOpcode(), llvm::SDValue::getOperand(), llvm::SDValue::getValueSizeInBits(), llvm::isOneConstant(), llvm::isPowerOf2_64(), llvm::isUInt(), LHS, llvm::Log2_64_Ceil(), RHS, SDValue(), llvm::ISD::SHL, llvm::ISD::SRL, std::swap(), and llvm::ISD::TRUNCATE.

lowerOverflowArithmetic()

Definition at line 1551 of file M68kISelLowering.cpp.

References llvm::M68k::COND_CS, llvm::M68k::COND_VS, DL, llvm::SelectionDAG::getConstant(), llvm::SelectionDAG::getNode(), llvm::SDValue::getValue(), llvm::SelectionDAG::getVTList(), LHS, llvm_unreachable, llvm::ISD::MUL, N, RHS, llvm::ISD::SADDO, llvm::ISD::SIGN_EXTEND, llvm::ISD::SMULO, llvm::ISD::SSUBO, llvm::ISD::TRUNCATE, llvm::ISD::UADDO, llvm::ISD::UMULO, llvm::ISD::USUBO, and llvm::ISD::ZERO_EXTEND.

LowerTruncateToBTST()

MatchingStackOffset()

Return true if the given stack call argument is already available in the same position (relatively) of the caller's incoming argument stack.

Definition at line 300 of file M68kISelLowering.cpp.

References llvm::ISD::ANY_EXTEND, assert(), llvm::ISD::AssertZext, llvm::cast(), llvm::ISD::CopyFromReg, llvm::dyn_cast(), llvm::ISD::FrameIndex, llvm::FrameIndexSDNode::getIndex(), llvm::CCValAssign::getLocVT(), llvm::MachineFrameInfo::getObjectOffset(), llvm::MachineFrameInfo::getObjectSize(), llvm::SDValue::getOpcode(), llvm::SDValue::getOperand(), llvm::EVT::getSizeInBits(), llvm::MVT::getSizeInBits(), llvm::SDValue::getValueType(), llvm::MachineFrameInfo::isFixedObjectIndex(), llvm::MachineFrameInfo::isObjectSExt(), llvm::MachineFrameInfo::isObjectZExt(), llvm::Register::isVirtualRegister(), MRI, llvm::Offset, TII, llvm::ISD::TRUNCATE, and llvm::ISD::ZERO_EXTEND.

mayTailCallThisCC()

shouldGuaranteeTCO()

STATISTIC()

STATISTIC ( NumTailCalls ,
"Number of tail calls" )

TranslateIntegerM68kCC()

Definition at line 1724 of file M68kISelLowering.cpp.

References llvm::M68k::COND_CC, llvm::M68k::COND_CS, llvm::M68k::COND_EQ, llvm::M68k::COND_GE, llvm::M68k::COND_GT, llvm::M68k::COND_HI, llvm::M68k::COND_LE, llvm::M68k::COND_LS, llvm::M68k::COND_LT, llvm::M68k::COND_NE, llvm_unreachable, llvm::ISD::SETEQ, llvm::ISD::SETGE, llvm::ISD::SETGT, llvm::ISD::SETLE, llvm::ISD::SETLT, llvm::ISD::SETNE, llvm::ISD::SETUGE, llvm::ISD::SETUGT, llvm::ISD::SETULE, and llvm::ISD::SETULT.

Referenced by TranslateM68kCC().

TranslateM68kCC()

Do a one-to-one translation of a ISD::CondCode to the M68k-specific condition code, returning the condition code and the LHS/RHS of the comparison to make.

Definition at line 1754 of file M68kISelLowering.cpp.

References llvm::M68k::COND_CC, llvm::M68k::COND_CS, llvm::M68k::COND_EQ, llvm::M68k::COND_HI, llvm::M68k::COND_INVALID, llvm::M68k::COND_LE, llvm::M68k::COND_LS, llvm::M68k::COND_MI, llvm::M68k::COND_NE, llvm::M68k::COND_PL, DL, llvm::dyn_cast(), llvm::SelectionDAG::getConstant(), llvm::ISD::isNON_EXTLoad(), LHS, llvm_unreachable, RHS, llvm::ISD::SETEQ, llvm::ISD::SETGE, llvm::ISD::SETGT, llvm::ISD::SETLE, llvm::ISD::SETLT, llvm::ISD::SETNE, llvm::ISD::SETOEQ, llvm::ISD::SETOGE, llvm::ISD::SETOGT, llvm::ISD::SETOLE, llvm::ISD::SETOLT, llvm::ISD::SETONE, llvm::ISD::SETUEQ, llvm::ISD::SETUGE, llvm::ISD::SETUGT, llvm::ISD::SETULE, llvm::ISD::SETULT, llvm::ISD::SETUNE, std::swap(), and TranslateIntegerM68kCC().