|
LLVM
10.0.0
|
#include "llvm/CodeGen/TargetLowering.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 APInt | getKnownUndefForVectorBinop (SDValue BO, SelectionDAG &DAG, const APInt &UndefOp0, const APInt &UndefOp1) |
| Given a vector binary operation and known undefined elements for each input operand, compute whether each element of the output is undefined. More... | |
| 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 void | turnVectorIntoSplatVector (MutableArrayRef< SDValue > Values, std::function< bool(SDValue)> Predicate, SDValue AlternativeReplacement=SDValue()) |
| If all values in Values that don't match the predicate are same 'splat' value, then replace all values with that splat value. 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 4635 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 4540 of file TargetLowering.cpp.
References assert(), llvm::TargetLowering::C_Immediate, llvm::TargetLowering::C_Memory, llvm::TargetLowering::C_Other, llvm::TargetLowering::C_Register, llvm::TargetLowering::C_RegisterClass, llvm::TargetLowering::C_Unknown, llvm::InlineAsm::ConstraintInfo::Codes, llvm::TargetLowering::AsmOperandInfo::ConstraintCode, llvm::TargetLowering::AsmOperandInfo::ConstraintType, llvm::numbers::e, getConstraintGenerality(), llvm::TargetLowering::getConstraintType(), llvm::SDValue::getNode(), llvm::InlineAsm::ConstraintInfo::hasMatchingInput(), llvm::InlineAsm::ConstraintInfo::isIndirect, and llvm::TargetLowering::LowerAsmOperandForConstraint().
Referenced by llvm::TargetLowering::ComputeConstraintToUse().
|
static |
Definition at line 6983 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 4431 of file TargetLowering.cpp.
References llvm::TargetLowering::C_Immediate, 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().
|
static |
Given a vector binary operation and known undefined elements for each input operand, compute whether each element of the output is undefined.
Definition at line 2103 of file TargetLowering.cpp.
References assert(), C, llvm::dyn_cast(), llvm::APInt::getBitWidth(), llvm::SelectionDAG::getNode(), llvm::APInt::getNullValue(), llvm::SDValue::getOpcode(), llvm::SDValue::getOperand(), llvm::SDNode::getOperand(), llvm::SelectionDAG::getTargetLoweringInfo(), llvm::SelectionDAG::getUNDEF(), llvm::SDValue::getValueType(), llvm::EVT::getVectorElementType(), llvm::EVT::getVectorNumElements(), llvm::TargetLoweringBase::isBinOp(), llvm::SDValue::isUndef(), isUndef(), llvm::EVT::isVector(), and llvm::APInt::setBit().
Referenced by llvm::TargetLowering::SimplifyDemandedVectorElts().
|
static |
If all values in Values that don't match the predicate are same 'splat' value, then replace all values with that splat value.
Else, if AlternativeReplacement was provided, then replace all values that do match predicate with AlternativeReplacement value.
Definition at line 4951 of file TargetLowering.cpp.
References llvm::all_of(), llvm::MutableArrayRef< T >::begin(), llvm::MutableArrayRef< T >::end(), and llvm::find_if_not().
1.8.13