LLVM  8.0.1
Macros | Functions | Variables
X86ISelDAGToDAG.cpp File Reference
#include "X86.h"
#include "X86MachineFunctionInfo.h"
#include "X86RegisterInfo.h"
#include "X86Subtarget.h"
#include "X86TargetMachine.h"
#include "llvm/ADT/Statistic.h"
#include "llvm/CodeGen/MachineFrameInfo.h"
#include "llvm/CodeGen/MachineFunction.h"
#include "llvm/CodeGen/SelectionDAGISel.h"
#include "llvm/Config/llvm-config.h"
#include "llvm/IR/ConstantRange.h"
#include "llvm/IR/Function.h"
#include "llvm/IR/Instructions.h"
#include "llvm/IR/Intrinsics.h"
#include "llvm/IR/Type.h"
#include "llvm/Support/Debug.h"
#include "llvm/Support/ErrorHandling.h"
#include "llvm/Support/KnownBits.h"
#include "llvm/Support/MathExtras.h"
#include "llvm/Support/raw_ostream.h"
#include "llvm/Target/TargetMachine.h"
#include "llvm/Target/TargetOptions.h"
#include <stdint.h>
#include "X86GenDAGISel.inc"
Include dependency graph for X86ISelDAGToDAG.cpp:

Go to the source code of this file.

Macros

#define DEBUG_TYPE   "x86-isel"
 

Functions

 STATISTIC (NumLoadMoved, "Number of loads moved below TokenFactor")
 
static bool isLegalMaskCompare (SDNode *N, const X86Subtarget *Subtarget)
 
static void moveBelowOrigChain (SelectionDAG *CurDAG, SDValue Load, SDValue Call, SDValue OrigChain)
 Replace the original chain operand of the call with load's chain operand and move load below the call's chain operand. More...
 
static bool isCalleeLoad (SDValue Callee, SDValue &Chain, bool HasCallSeq)
 Return true if call address is a load and it can be moved below CALLSEQ_START and the chains leading up to the call. More...
 
static bool isDispSafeForFrameIndex (int64_t Val)
 
static void insertDAGNode (SelectionDAG &DAG, SDValue Pos, SDValue N)
 
static bool foldMaskAndShiftToExtract (SelectionDAG &DAG, SDValue N, uint64_t Mask, SDValue Shift, SDValue X, X86ISelAddressMode &AM)
 
static bool foldMaskedShiftToScaledMask (SelectionDAG &DAG, SDValue N, uint64_t Mask, SDValue Shift, SDValue X, X86ISelAddressMode &AM)
 
static bool foldMaskAndShiftToScale (SelectionDAG &DAG, SDValue N, uint64_t Mask, SDValue Shift, SDValue X, X86ISelAddressMode &AM)
 
static bool foldMaskedShiftToBEXTR (SelectionDAG &DAG, SDValue N, uint64_t Mask, SDValue Shift, SDValue X, X86ISelAddressMode &AM, const X86Subtarget &Subtarget)
 
static bool hasSingleUsesFromRoot (SDNode *Root, SDNode *User)
 
static X86::CondCode getCondFromOpc (unsigned Opc)
 
static bool mayUseCarryFlag (X86::CondCode CC)
 
static bool isFusableLoadOpStorePattern (StoreSDNode *StoreNode, SDValue StoredVal, SelectionDAG *CurDAG, unsigned LoadOpNo, LoadSDNode *&LoadNode, SDValue &InputChain)
 Check whether or not the chain ending in StoreNode is suitable for doing the {load; op; store} to modify transformation. More...
 

Variables

static cl::opt< boolAndImmShrink ("x86-and-imm-shrink", cl::init(true), cl::desc("Enable setting constant bits to reduce size of mask immediates"), cl::Hidden)
 

Macro Definition Documentation

◆ DEBUG_TYPE

#define DEBUG_TYPE   "x86-isel"

Definition at line 40 of file X86ISelDAGToDAG.cpp.

Function Documentation

◆ foldMaskAndShiftToExtract()

static bool foldMaskAndShiftToExtract ( SelectionDAG DAG,
SDValue  N,
uint64_t  Mask,
SDValue  Shift,
SDValue  X,
X86ISelAddressMode &  AM 
)
static

◆ foldMaskAndShiftToScale()

static bool foldMaskAndShiftToScale ( SelectionDAG DAG,
SDValue  N,
uint64_t  Mask,
SDValue  Shift,
SDValue  X,
X86ISelAddressMode &  AM 
)
static

◆ foldMaskedShiftToBEXTR()

static bool foldMaskedShiftToBEXTR ( SelectionDAG DAG,
SDValue  N,
uint64_t  Mask,
SDValue  Shift,
SDValue  X,
X86ISelAddressMode &  AM,
const X86Subtarget Subtarget 
)
static

Definition at line 1489 of file X86ISelDAGToDAG.cpp.

References llvm::ISD::ADD, llvm::ISD::AND, llvm::ISD::ANY_EXTEND, llvm::ISD::Constant, llvm::ISD::CopyFromReg, llvm::countTrailingZeros(), llvm::dbgs(), llvm::ISD::DELETED_NODE, llvm::X86ISD::EH_SJLJ_LONGJMP, llvm::X86ISD::EH_SJLJ_SETJMP, foldMaskAndShiftToExtract(), foldMaskAndShiftToScale(), foldMaskedShiftToScaledMask(), llvm::ISD::FrameIndex, llvm::SelectionDAG::getConstant(), llvm::SDValue::getConstantOperandVal(), llvm::SDValue::getNode(), llvm::SelectionDAG::getNode(), llvm::SDValue::getOpcode(), llvm::SDNode::getOpcode(), llvm::SDValue::getOperand(), llvm::SDValue::getResNo(), llvm::ConstantSDNode::getSExtValue(), llvm::SDValue::getSimpleValueType(), llvm::MVT::getSizeInBits(), llvm::HandleSDNode::getValue(), llvm::SDValue::getValueType(), llvm::X86Subtarget::hasBMI(), llvm::X86Subtarget::hasFastBEXTR(), llvm::SDValue::hasOneUse(), llvm::SDNode::hasOneUse(), llvm::X86Subtarget::hasTBM(), llvm::MVT::i16, llvm::MVT::i32, llvm::MVT::i8, insertDAGNode(), llvm::ISD::INTRINSIC_VOID, llvm::ISD::INTRINSIC_W_CHAIN, isDispSafeForFrameIndex(), llvm::isShiftedMask_64(), LLVM_DEBUG, LLVM_FALLTHROUGH, llvm::ISD::LOAD, llvm::ISD::LOCAL_RECOVER, llvm::BitmaskEnumDetail::Mask(), llvm::ISD::MUL, llvm::X86ISD::MUL_IMM, N, llvm::ISD::OR, Reg, llvm::SelectionDAG::ReplaceAllUsesWith(), llvm::ISD::SHL, llvm::ISD::SMUL_LOHI, llvm::ISD::SRL, llvm::ISD::SUB, llvm::X86ISD::TLSCALL, llvm::ISD::TRUNCATE, llvm::ISD::UMUL_LOHI, llvm::X86ISD::Wrapper, llvm::X86ISD::WrapperRIP, X, and llvm::ISD::ZERO_EXTEND.

◆ foldMaskedShiftToScaledMask()

static bool foldMaskedShiftToScaledMask ( SelectionDAG DAG,
SDValue  N,
uint64_t  Mask,
SDValue  Shift,
SDValue  X,
X86ISelAddressMode &  AM 
)
static

◆ getCondFromOpc()

static X86::CondCode getCondFromOpc ( unsigned  Opc)
static

◆ hasSingleUsesFromRoot()

static bool hasSingleUsesFromRoot ( SDNode Root,
SDNode User 
)
static

◆ insertDAGNode()

static void insertDAGNode ( SelectionDAG DAG,
SDValue  Pos,
SDValue  N 
)
static

◆ isCalleeLoad()

static bool isCalleeLoad ( SDValue  Callee,
SDValue Chain,
bool  HasCallSeq 
)
static

Return true if call address is a load and it can be moved below CALLSEQ_START and the chains leading up to the call.

Return the CALLSEQ_START by reference as a second output. In the case of a tail call, there isn't a callseq node between the call chain and the load.

Definition at line 685 of file X86ISelDAGToDAG.cpp.

References llvm::X86ISD::AND, llvm::ISD::AND, llvm::AMDGPU::HSAMD::Kernel::Key::Args, assert(), llvm::CallingConv::C, llvm::X86ISD::CALL, llvm::ISD::CALLSEQ_START, llvm::dyn_cast(), E, llvm::X86II::EncodingMask, llvm::X86II::EVEX, llvm::ISD::EXTLOAD, F(), llvm::ISD::FP_EXTEND, llvm::ISD::FP_ROUND, llvm::LSBaseSDNode::getAddressingMode(), llvm::SDValue::getConstantOperandVal(), llvm::SDNode::getConstantOperandVal(), llvm::LoadSDNode::getExtensionType(), llvm::MachineFunction::getFunction(), llvm::SDValue::getMachineOpcode(), llvm::SDNode::getMachineOpcode(), llvm::Value::getName(), llvm::SDValue::getNode(), llvm::SDValue::getNumOperands(), llvm::SDValue::getOpcode(), llvm::SDNode::getOpcode(), llvm::SDValue::getOperand(), llvm::SDNode::getOperand(), llvm::SDValue::getSimpleValueType(), llvm::SDNode::getSimpleValueType(), llvm::SDValue::getValue(), llvm::SDNode::getValueType(), llvm::Type::getVoidTy(), llvm::SDNode::hasAnyUseOfValue(), llvm::GlobalValue::hasExternalLinkage(), llvm::SDValue::hasOneUse(), I, llvm::MVT::i32, llvm::MVT::i64, llvm::tgtok::In, llvm::SDValue::isMachineOpcode(), llvm::SDNode::isMachineOpcode(), llvm::SDNode::isOnlyUserOf(), llvm::SDValue::isOperandOf(), llvm::X86TargetLowering::isScalarFPTypeInSSEReg(), llvm::MVT::isVector(), llvm::MemSDNode::isVolatile(), llvm::ARM_MB::LD, llvm_unreachable, llvm::SPII::Load, llvm::TargetLowering::LowerCallTo(), moveBelowOrigChain(), llvm::ISD::NON_EXTLOAD, llvm::CodeGenOpt::None, llvm::Function::optForMinSize(), llvm::Function::optForSize(), llvm::MVT::Other, llvm::TargetLowering::CallLoweringInfo::setChain(), llvm::SPII::Store, llvm::X86ISD::TC_RETURN, llvm::SystemZISD::TM, llvm::ISD::TokenFactor, llvm::ISD::UNINDEXED, llvm::SDNode::use_empty(), llvm::X86II::VEX, and llvm::X86II::XOP.

◆ isDispSafeForFrameIndex()

static bool isDispSafeForFrameIndex ( int64_t  Val)
static

◆ isFusableLoadOpStorePattern()

static bool isFusableLoadOpStorePattern ( StoreSDNode StoreNode,
SDValue  StoredVal,
SelectionDAG CurDAG,
unsigned  LoadOpNo,
LoadSDNode *&  LoadNode,
SDValue InputChain 
)
static

◆ isLegalMaskCompare()

static bool isLegalMaskCompare ( SDNode N,
const X86Subtarget Subtarget 
)
static

◆ mayUseCarryFlag()

static bool mayUseCarryFlag ( X86::CondCode  CC)
static

◆ moveBelowOrigChain()

static void moveBelowOrigChain ( SelectionDAG CurDAG,
SDValue  Load,
SDValue  Call,
SDValue  OrigChain 
)
static

◆ STATISTIC()

STATISTIC ( NumLoadMoved  ,
"Number of loads moved below TokenFactor"   
)

Variable Documentation

◆ AndImmShrink

cl::opt<bool> AndImmShrink("x86-and-imm-shrink", cl::init(true), cl::desc("Enable setting constant bits to reduce size of mask immediates"), cl::Hidden)
static