LLVM
8.0.1
|
#include "llvm/ADT/BitVector.h"
#include "llvm/ADT/STLExtras.h"
#include "llvm/ADT/SmallVector.h"
#include "llvm/ADT/StringExtras.h"
#include "llvm/ADT/StringRef.h"
#include "llvm/ADT/Triple.h"
#include "llvm/ADT/Twine.h"
#include "llvm/CodeGen/Analysis.h"
#include "llvm/CodeGen/ISDOpcodes.h"
#include "llvm/CodeGen/MachineBasicBlock.h"
#include "llvm/CodeGen/MachineFrameInfo.h"
#include "llvm/CodeGen/MachineFunction.h"
#include "llvm/CodeGen/MachineInstr.h"
#include "llvm/CodeGen/MachineInstrBuilder.h"
#include "llvm/CodeGen/MachineMemOperand.h"
#include "llvm/CodeGen/MachineOperand.h"
#include "llvm/CodeGen/MachineRegisterInfo.h"
#include "llvm/CodeGen/RuntimeLibcalls.h"
#include "llvm/CodeGen/StackMaps.h"
#include "llvm/CodeGen/TargetLowering.h"
#include "llvm/CodeGen/TargetOpcodes.h"
#include "llvm/CodeGen/TargetRegisterInfo.h"
#include "llvm/CodeGen/ValueTypes.h"
#include "llvm/IR/Attributes.h"
#include "llvm/IR/CallingConv.h"
#include "llvm/IR/DataLayout.h"
#include "llvm/IR/DerivedTypes.h"
#include "llvm/IR/Function.h"
#include "llvm/IR/GlobalValue.h"
#include "llvm/IR/GlobalVariable.h"
#include "llvm/IR/IRBuilder.h"
#include "llvm/IR/Module.h"
#include "llvm/IR/Type.h"
#include "llvm/Support/BranchProbability.h"
#include "llvm/Support/Casting.h"
#include "llvm/Support/CommandLine.h"
#include "llvm/Support/Compiler.h"
#include "llvm/Support/ErrorHandling.h"
#include "llvm/Support/MachineValueType.h"
#include "llvm/Support/MathExtras.h"
#include "llvm/Target/TargetMachine.h"
#include <algorithm>
#include <cassert>
#include <cstddef>
#include <cstdint>
#include <cstring>
#include <iterator>
#include <string>
#include <tuple>
#include <utility>
#include "llvm/IR/RuntimeLibcalls.def"
#include "llvm/IR/Instruction.def"
Go to the source code of this file.
Macros | |
#define | HANDLE_LIBCALL(code, name) setLibcallName(RTLIB::code, name); |
#define | OP_TO_LIBCALL(Name, Enum) |
#define | HANDLE_INST(NUM, OPCODE, CLASS) OPCODE = NUM, |
#define | LAST_OTHER_INST(NUM) InstructionOpcodesCount = NUM |
Functions | |
static bool | darwinHasSinCos (const Triple &TT) |
static void | InitCmpLibcallCCs (ISD::CondCode *CCs) |
InitCmpLibcallCCs - Set default comparison libcall CC. More... | |
static unsigned | getVectorTypeBreakdownMVT (MVT VT, MVT &IntermediateVT, unsigned &NumIntermediates, MVT &RegisterVT, TargetLoweringBase *TLI) |
static StringRef | getRecipEstimateForFunc (MachineFunction &MF) |
Get the reciprocal estimate attribute string for a function that will override the target defaults. More... | |
static std::string | getReciprocalOpName (bool IsSqrt, EVT VT) |
Construct a string for the given reciprocal operation of the given type. More... | |
static bool | parseRefinementStep (StringRef In, size_t &Position, uint8_t &Value) |
Return the character position and value (a single numeric character) of a customized refinement operation in the input string if it exists. More... | |
static int | getOpEnabled (bool IsSqrt, EVT VT, StringRef Override) |
For the input attribute string, return one of the ReciprocalEstimate enum status values (enabled, disabled, or not specified) for this operation on the specified data type. More... | |
static int | getOpRefinementSteps (bool IsSqrt, EVT VT, StringRef Override) |
For the input attribute string, return the customized refinement step count for this operation on the specified data type. More... | |
Variables | |
static cl::opt< bool > | JumpIsExpensiveOverride ("jump-is-expensive", cl::init(false), cl::desc("Do not create extra branches to split comparison logic."), cl::Hidden) |
static cl::opt< unsigned > | MinimumJumpTableEntries ("min-jump-table-entries", cl::init(4), cl::Hidden, cl::desc("Set minimum number of entries to use a jump table.")) |
static cl::opt< unsigned > | MaximumJumpTableSize ("max-jump-table-size", cl::init(0), cl::Hidden, cl::desc("Set maximum size of jump tables; zero for no limit.")) |
static cl::opt< unsigned > | JumpTableDensity ("jump-table-density", cl::init(10), cl::Hidden, cl::desc("Minimum density for building a jump table in " "a normal function")) |
Minimum jump table density for normal functions. More... | |
static cl::opt< unsigned > | OptsizeJumpTableDensity ("optsize-jump-table-density", cl::init(40), cl::Hidden, cl::desc("Minimum density for building a jump table in " "an optsize function")) |
Minimum jump table density for -Os or -Oz functions. More... | |
static cl::opt< int > | MinPercentageForPredictableBranch ("min-predictable-branch", cl::init(99), cl::desc("Minimum percentage (0-100) that a condition must be either true " "or false to assume that the condition is predictable"), cl::Hidden) |
#define LAST_OTHER_INST | ( | NUM | ) | InstructionOpcodesCount = NUM |
#define OP_TO_LIBCALL | ( | Name, | |
Enum | |||
) |
Referenced by llvm::RTLIB::getSYNC().
Definition at line 92 of file TargetLoweringBase.cpp.
References llvm::Triple::aarch64, llvm::CallingConv::ARM_AAPCS_VFP, assert(), llvm::CallingConv::C, llvm::Triple::getArch(), llvm::cl::Hidden, llvm::cl::init(), llvm::Triple::isAndroid(), llvm::Triple::isAndroidVersionLT(), llvm::Triple::isArch64Bit(), llvm::Triple::isGNUEnvironment(), llvm::Triple::isiOS(), llvm::Triple::isMacOSX(), llvm::Triple::isMacOSXVersionLT(), llvm::Triple::isOSDarwin(), llvm::Triple::isOSFuchsia(), llvm::Triple::isOSOpenBSD(), llvm::Triple::isOSVersionLT(), llvm::Triple::isWatchABI(), MinPercentageForPredictableBranch, llvm::TargetLoweringBase::setLibcallCallingConv(), llvm::TargetLoweringBase::setLibcallName(), llvm::Triple::x86, and llvm::Triple::x86_64.
For the input attribute string, return one of the ReciprocalEstimate enum status values (enabled, disabled, or not specified) for this operation on the specified data type.
Definition at line 1741 of file TargetLoweringBase.cpp.
References llvm::StringRef::empty(), Enabled, getReciprocalOpName(), parseRefinementStep(), llvm::SmallVectorBase::size(), llvm::StringRef::split(), and llvm::StringRef::substr().
Referenced by llvm::TargetLoweringBase::getRecipEstimateDivEnabled(), and llvm::TargetLoweringBase::getRecipEstimateSqrtEnabled().
For the input attribute string, return the customized refinement step count for this operation on the specified data type.
If the step count does not exist, return the ReciprocalEstimate enum value for unspecified.
Definition at line 1801 of file TargetLoweringBase.cpp.
References assert(), llvm::StringRef::empty(), getReciprocalOpName(), parseRefinementStep(), llvm::SmallVectorBase::size(), llvm::StringRef::split(), and llvm::StringRef::substr().
Referenced by llvm::TargetLoweringBase::getDivRefinementSteps(), and llvm::TargetLoweringBase::getSqrtRefinementSteps().
|
static |
Get the reciprocal estimate attribute string for a function that will override the target defaults.
Definition at line 1689 of file TargetLoweringBase.cpp.
References F(), llvm::Function::getFnAttribute(), llvm::MachineFunction::getFunction(), and llvm::Attribute::getValueAsString().
Referenced by llvm::TargetLoweringBase::getDivRefinementSteps(), llvm::TargetLoweringBase::getRecipEstimateDivEnabled(), llvm::TargetLoweringBase::getRecipEstimateSqrtEnabled(), and llvm::TargetLoweringBase::getSqrtRefinementSteps().
Construct a string for the given reciprocal operation of the given type.
This string should match the corresponding option to the front-end's "-mrecip" flag assuming those strings have been passed through in an attribute string. For example, "vec-divf" for a division of a vXf32.
Definition at line 1698 of file TargetLoweringBase.cpp.
References assert(), llvm::MVT::f32, llvm::MVT::f64, llvm::EVT::getScalarType(), llvm::EVT::isVector(), and Name.
Referenced by getOpEnabled(), and getOpRefinementSteps().
|
static |
Definition at line 867 of file TargetLoweringBase.cpp.
References llvm::TargetLoweringBase::getRegisterType(), llvm::MVT::getSizeInBits(), llvm::MVT::getVectorElementType(), llvm::MVT::getVectorNumElements(), llvm::MVT::getVectorVT(), llvm::isPowerOf2_32(), llvm::TargetLoweringBase::isTypeLegal(), and llvm::NextPowerOf2().
Referenced by llvm::TargetLoweringBase::computeRegisterProperties().
|
static |
InitCmpLibcallCCs - Set default comparison libcall CC.
Definition at line 496 of file TargetLoweringBase.cpp.
References llvm::Intrinsic::memset, llvm::ISD::SETCC_INVALID, llvm::ISD::SETEQ, llvm::ISD::SETGE, llvm::ISD::SETGT, llvm::ISD::SETLE, llvm::ISD::SETLT, and llvm::ISD::SETNE.
Referenced by llvm::TargetLoweringBase::TargetLoweringBase().
Return the character position and value (a single numeric character) of a customized refinement operation in the input string if it exists.
Return false if there is no customized refinement step count.
Definition at line 1718 of file TargetLoweringBase.cpp.
References llvm::StringRef::find(), llvm::StringRef::npos, llvm::report_fatal_error(), llvm::StringRef::size(), and llvm::StringRef::substr().
Referenced by getOpEnabled(), and getOpRefinementSteps().
|
static |
Minimum jump table density for normal functions.
Referenced by llvm::TargetLoweringBase::getMinimumJumpTableDensity().
|
static |
Referenced by darwinHasSinCos().
|
static |
Minimum jump table density for -Os or -Oz functions.
Referenced by llvm::TargetLoweringBase::getMinimumJumpTableDensity().