|
LLVM
4.0.0
|
#include "X86.h"#include "X86InstrBuilder.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/MachineInstrBuilder.h"#include "llvm/CodeGen/MachineRegisterInfo.h"#include "llvm/CodeGen/SelectionDAGISel.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/MathExtras.h"#include "llvm/Support/raw_ostream.h"#include "llvm/Target/TargetMachine.h"#include "llvm/Target/TargetOptions.h"#include <stdint.h>#include "X86GenDAGISel.inc"Go to the source code of this file.
Macros | |
| #define | DEBUG_TYPE "x86-isel" |
Functions | |
| STATISTIC (NumLoadMoved,"Number of loads moved below TokenFactor") | |
| 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 | hasNoSignedComparisonUses (SDNode *N) |
| Test whether the given X86ISD::CMP node has any uses which require the SF or OF bits to be accurate. More... | |
| static bool | isLoadIncOrDecStore (StoreSDNode *StoreNode, unsigned Opc, SDValue StoredVal, SelectionDAG *CurDAG, LoadSDNode *&LoadNode, SDValue &InputChain) |
| Check whether or not the chain ending in StoreNode is suitable for doing the {load; increment or decrement; store} to modify transformation. More... | |
| static unsigned | getFusedLdStOpcode (EVT &LdVT, unsigned Opc) |
| Get the appropriate X86 opcode for an in-memory increment or decrement. More... | |
| #define DEBUG_TYPE "x86-isel" |
Definition at line 41 of file X86ISelDAGToDAG.cpp.
|
static |
Definition at line 908 of file X86ISelDAGToDAG.cpp.
References llvm::ISD::AND, llvm::APIntOps::And(), llvm::SelectionDAG::getConstant(), llvm::SDValue::getConstantOperandVal(), llvm::SelectionDAG::getNode(), llvm::SDValue::getOpcode(), llvm::SDValue::getOperand(), llvm::SDValue::getSimpleValueType(), llvm::SDValue::hasOneUse(), llvm::MVT::i8, insertDAGNode(), llvm::SelectionDAG::ReplaceAllUsesWith(), llvm::ISD::SHL, and llvm::ISD::SRL.
|
static |
Definition at line 1018 of file X86ISelDAGToDAG.cpp.
References llvm::ISD::ANY_EXTEND, assert(), llvm::SelectionDAG::computeKnownBits(), llvm::countLeadingZeros(), llvm::countTrailingOnes(), llvm::countTrailingZeros(), llvm::SelectionDAG::getConstant(), llvm::SDValue::getConstantOperandVal(), llvm::APInt::getHighBitsSet(), llvm::SelectionDAG::getNode(), llvm::SDValue::getOpcode(), llvm::SDValue::getOperand(), llvm::SDValue::getSimpleValueType(), llvm::MVT::getSizeInBits(), llvm::SDValue::getValueType(), llvm::SDValue::hasOneUse(), llvm::MVT::i8, insertDAGNode(), llvm::SelectionDAG::ReplaceAllUsesWith(), llvm::ISD::SHL, llvm::ISD::SRL, and llvm::ISD::ZERO_EXTEND.
|
static |
Definition at line 951 of file X86ISelDAGToDAG.cpp.
References llvm::ISD::AND, llvm::SelectionDAG::getConstant(), llvm::SDValue::getConstantOperandVal(), llvm::SelectionDAG::getNode(), llvm::SDValue::getOpcode(), llvm::SDValue::getOperand(), llvm::SDValue::getSimpleValueType(), llvm::SDValue::hasOneUse(), insertDAGNode(), llvm::SelectionDAG::ReplaceAllUsesWith(), and llvm::ISD::SHL.
Get the appropriate X86 opcode for an in-memory increment or decrement.
Opc should be X86ISD::DEC or X86ISD::INC.
Definition at line 1941 of file X86ISelDAGToDAG.cpp.
References assert(), llvm::X86ISD::DEC, llvm::MVT::i16, llvm::MVT::i32, llvm::MVT::i64, llvm::MVT::i8, llvm::X86ISD::INC, and llvm_unreachable.
Test whether the given X86ISD::CMP node has any uses which require the SF or OF bits to be accurate.
Definition at line 1794 of file X86ISelDAGToDAG.cpp.
References llvm::ISD::CopyToReg, getReg(), llvm::SDNode::use_begin(), and llvm::SDNode::use_end().
|
static |
Definition at line 896 of file X86ISelDAGToDAG.cpp.
References llvm::ilist_node_impl< OptionsT >::getIterator(), llvm::SDValue::getNode(), llvm::SDNode::getNodeId(), llvm::SelectionDAG::RepositionNode(), and llvm::SDNode::setNodeId().
Referenced by foldMaskAndShiftToExtract(), foldMaskAndShiftToScale(), and foldMaskedShiftToScaledMask().
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 491 of file X86ISelDAGToDAG.cpp.
References llvm::ISD::CALLSEQ_START, llvm::dyn_cast(), llvm::LSBaseSDNode::getAddressingMode(), llvm::LoadSDNode::getExtensionType(), llvm::SDValue::getNode(), llvm::SDValue::getNumOperands(), llvm::SDValue::getOpcode(), llvm::SDValue::getOperand(), llvm::SDValue::getValue(), llvm::SDValue::hasOneUse(), llvm::SDValue::isOperandOf(), llvm::MemSDNode::isVolatile(), llvm::ARM_MB::LD, llvm::ISD::NON_EXTLOAD, llvm::ISD::TokenFactor, and llvm::ISD::UNINDEXED.
|
static |
Definition at line 669 of file X86ISelDAGToDAG.cpp.
|
static |
Check whether or not the chain ending in StoreNode is suitable for doing the {load; increment or decrement; store} to modify transformation.
Definition at line 1856 of file X86ISelDAGToDAG.cpp.
References llvm::X86ISD::DEC, llvm::LoadSDNode::getBasePtr(), llvm::StoreSDNode::getBasePtr(), llvm::MemSDNode::getChain(), llvm::MemSDNode::getMemoryVT(), llvm::SDValue::getNode(), llvm::SelectionDAG::getNode(), llvm::SDNode::getNodeId(), llvm::SDValue::getNumOperands(), llvm::LoadSDNode::getOffset(), llvm::StoreSDNode::getOffset(), llvm::SDValue::getOpcode(), llvm::SDValue::getOperand(), llvm::SDNode::getOperand(), llvm::SDValue::getResNo(), llvm::SDValue::getValue(), llvm::SDNode::hasNUsesOfValue(), llvm::SDValue::hasOneUse(), i, llvm::MVT::i16, llvm::MVT::i32, llvm::MVT::i64, llvm::MVT::i8, llvm::X86ISD::INC, llvm::MemSDNode::isNonTemporal(), llvm::ISD::isNormalLoad(), llvm::ISD::isNormalStore(), llvm::SPII::Load, llvm::MVT::Other, llvm::SmallVectorTemplateBase< T, isPodLike< T >::value >::push_back(), llvm::ISD::TokenFactor, llvm::SDNode::use_begin(), and llvm::SDNode::use_end().
|
static |
Replace the original chain operand of the call with load's chain operand and move load below the call's chain operand.
Definition at line 456 of file X86ISelDAGToDAG.cpp.
References llvm::SmallVectorImpl< T >::append(), assert(), llvm::SmallVectorImpl< T >::clear(), llvm::SDValue::getNode(), llvm::SelectionDAG::getNode(), llvm::SDValue::getNumOperands(), llvm::SDValue::getOpcode(), llvm::SDValue::getOperand(), i, llvm::SDNode::op_begin(), llvm::SDNode::op_end(), llvm::MVT::Other, llvm::SmallVectorTemplateBase< T, isPodLike< T >::value >::push_back(), llvm::ISD::TokenFactor, and llvm::SelectionDAG::UpdateNodeOperands().
| STATISTIC | ( | NumLoadMoved | , |
| "Number of loads moved below TokenFactor" | |||
| ) |
1.8.6