LLVM
8.0.1
|
#include "llvm/CodeGen/TargetLowering.h"
#include "llvm/ADT/BitVector.h"
#include "llvm/ADT/STLExtras.h"
#include "llvm/CodeGen/CallingConvLower.h"
#include "llvm/CodeGen/MachineFrameInfo.h"
#include "llvm/CodeGen/MachineFunction.h"
#include "llvm/CodeGen/MachineJumpTableInfo.h"
#include "llvm/CodeGen/MachineRegisterInfo.h"
#include "llvm/CodeGen/SelectionDAG.h"
#include "llvm/CodeGen/TargetRegisterInfo.h"
#include "llvm/CodeGen/TargetSubtargetInfo.h"
#include "llvm/IR/DataLayout.h"
#include "llvm/IR/DerivedTypes.h"
#include "llvm/IR/GlobalVariable.h"
#include "llvm/IR/LLVMContext.h"
#include "llvm/MC/MCAsmInfo.h"
#include "llvm/MC/MCExpr.h"
#include "llvm/Support/ErrorHandling.h"
#include "llvm/Support/KnownBits.h"
#include "llvm/Support/MathExtras.h"
#include "llvm/Target/TargetLoweringObjectFile.h"
#include "llvm/Target/TargetMachine.h"
#include <cctype>
Go to the source code of this file.
Functions | |
static unsigned | getConstraintGenerality (TargetLowering::ConstraintType CT) |
Return an integer indicating how general CT is. More... | |
static void | ChooseConstraint (TargetLowering::AsmOperandInfo &OpInfo, const TargetLowering &TLI, SDValue Op, SelectionDAG *DAG) |
If there are multiple different constraints that we could pick for this operand (e.g. More... | |
static SDValue | BuildExactSDIV (const TargetLowering &TLI, SDNode *N, const SDLoc &dl, SelectionDAG &DAG, SmallVectorImpl< SDNode *> &Created) |
Given an exact SDIV by a constant, create a multiplication with the multiplicative inverse of the constant. More... | |
static SDValue | clampDynamicVectorIndex (SelectionDAG &DAG, SDValue Idx, EVT VecVT, const SDLoc &dl) |
|
static |
Given an exact SDIV by a constant, create a multiplication with the multiplicative inverse of the constant.
Definition at line 3692 of file TargetLowering.cpp.
References llvm::APInt::ashrInPlace(), C, llvm::APInt::countTrailingZeros(), llvm::APInt::getBitWidth(), llvm::SelectionDAG::getBuildVector(), llvm::SelectionDAG::getConstant(), llvm::SelectionDAG::getDataLayout(), llvm::SDValue::getNode(), llvm::SelectionDAG::getNode(), llvm::SDNode::getOperand(), llvm::EVT::getScalarType(), llvm::TargetLoweringBase::getShiftAmountTy(), llvm::SDNode::getValueType(), llvm::EVT::isVector(), llvm::ISD::matchUnaryPredicate(), llvm::ISD::MUL, llvm::SmallVectorTemplateBase< T >::push_back(), llvm::SDNodeFlags::setExact(), and llvm::ISD::SRA.
Referenced by llvm::TargetLowering::BuildSDIV().
|
static |
If there are multiple different constraints that we could pick for this operand (e.g.
"imr") try to pick the 'best' one. This is somewhat tricky: constraints fall into four classes: Other -> immediates and magic values Register -> one specific register RegisterClass -> a group of regs Memory -> memory Ideally, we would pick the most specific constraint possible: if we have something that fits into a register, we would pick it. The problem here is that if we have something that could either be in a register or in memory that use of the register could cause selection of other operands to fail: they might only succeed if we pick memory. Because of this the heuristic we use is:
1) If there is an 'other' constraint, and if the operand is valid for that constraint, use it. This makes us take advantage of 'i' constraints when available. 2) Otherwise, pick the most general constraint present. This prefers 'm' over 'r', for example.
Definition at line 3607 of file TargetLowering.cpp.
References assert(), llvm::TargetLowering::C_Memory, llvm::TargetLowering::C_Other, llvm::TargetLowering::C_Unknown, llvm::InlineAsm::ConstraintInfo::Codes, llvm::TargetLowering::AsmOperandInfo::ConstraintCode, llvm::TargetLowering::AsmOperandInfo::ConstraintType, getConstraintGenerality(), llvm::TargetLowering::getConstraintType(), llvm::SDValue::getNode(), llvm::InlineAsm::ConstraintInfo::hasMatchingInput(), and llvm::TargetLowering::LowerAsmOperandForConstraint().
Referenced by llvm::TargetLowering::ComputeConstraintToUse().
|
static |
Definition at line 5169 of file TargetLowering.cpp.
References llvm::ISD::AND, llvm::SelectionDAG::getConstant(), llvm::APInt::getLowBitsSet(), llvm::SelectionDAG::getNode(), llvm::EVT::getSizeInBits(), llvm::SDValue::getValueType(), llvm::EVT::getVectorNumElements(), llvm::isPowerOf2_32(), llvm::Log2_32(), and llvm::ISD::UMIN.
Referenced by llvm::TargetLowering::getVectorElementPointer().
|
static |
Return an integer indicating how general CT is.
Definition at line 3499 of file TargetLowering.cpp.
References llvm::TargetLowering::C_Memory, llvm::TargetLowering::C_Other, llvm::TargetLowering::C_Register, llvm::TargetLowering::C_RegisterClass, llvm::TargetLowering::C_Unknown, and llvm_unreachable.
Referenced by ChooseConstraint().