LLVM
8.0.1
|
#include "llvm/CodeGen/SelectionDAGISel.h"
#include "ScheduleDAGSDNodes.h"
#include "SelectionDAGBuilder.h"
#include "llvm/ADT/APInt.h"
#include "llvm/ADT/DenseMap.h"
#include "llvm/ADT/None.h"
#include "llvm/ADT/PostOrderIterator.h"
#include "llvm/ADT/STLExtras.h"
#include "llvm/ADT/SmallPtrSet.h"
#include "llvm/ADT/SmallSet.h"
#include "llvm/ADT/SmallVector.h"
#include "llvm/ADT/Statistic.h"
#include "llvm/ADT/StringRef.h"
#include "llvm/Analysis/AliasAnalysis.h"
#include "llvm/Analysis/BranchProbabilityInfo.h"
#include "llvm/Analysis/CFG.h"
#include "llvm/Analysis/EHPersonalities.h"
#include "llvm/Analysis/OptimizationRemarkEmitter.h"
#include "llvm/Analysis/TargetLibraryInfo.h"
#include "llvm/Analysis/TargetTransformInfo.h"
#include "llvm/CodeGen/FastISel.h"
#include "llvm/CodeGen/FunctionLoweringInfo.h"
#include "llvm/CodeGen/GCMetadata.h"
#include "llvm/CodeGen/ISDOpcodes.h"
#include "llvm/CodeGen/MachineBasicBlock.h"
#include "llvm/CodeGen/MachineFrameInfo.h"
#include "llvm/CodeGen/MachineFunction.h"
#include "llvm/CodeGen/MachineFunctionPass.h"
#include "llvm/CodeGen/MachineInstr.h"
#include "llvm/CodeGen/MachineInstrBuilder.h"
#include "llvm/CodeGen/MachineMemOperand.h"
#include "llvm/CodeGen/MachineOperand.h"
#include "llvm/CodeGen/MachinePassRegistry.h"
#include "llvm/CodeGen/MachineRegisterInfo.h"
#include "llvm/CodeGen/SchedulerRegistry.h"
#include "llvm/CodeGen/SelectionDAG.h"
#include "llvm/CodeGen/SelectionDAGNodes.h"
#include "llvm/CodeGen/StackProtector.h"
#include "llvm/CodeGen/TargetInstrInfo.h"
#include "llvm/CodeGen/TargetLowering.h"
#include "llvm/CodeGen/TargetRegisterInfo.h"
#include "llvm/CodeGen/TargetSubtargetInfo.h"
#include "llvm/CodeGen/ValueTypes.h"
#include "llvm/IR/BasicBlock.h"
#include "llvm/IR/Constants.h"
#include "llvm/IR/DataLayout.h"
#include "llvm/IR/DebugInfoMetadata.h"
#include "llvm/IR/DebugLoc.h"
#include "llvm/IR/DiagnosticInfo.h"
#include "llvm/IR/Dominators.h"
#include "llvm/IR/Function.h"
#include "llvm/IR/InlineAsm.h"
#include "llvm/IR/InstrTypes.h"
#include "llvm/IR/Instruction.h"
#include "llvm/IR/Instructions.h"
#include "llvm/IR/IntrinsicInst.h"
#include "llvm/IR/Intrinsics.h"
#include "llvm/IR/Metadata.h"
#include "llvm/IR/Type.h"
#include "llvm/IR/User.h"
#include "llvm/IR/Value.h"
#include "llvm/MC/MCInstrDesc.h"
#include "llvm/MC/MCRegisterInfo.h"
#include "llvm/Pass.h"
#include "llvm/Support/BranchProbability.h"
#include "llvm/Support/Casting.h"
#include "llvm/Support/CodeGen.h"
#include "llvm/Support/CommandLine.h"
#include "llvm/Support/Compiler.h"
#include "llvm/Support/Debug.h"
#include "llvm/Support/ErrorHandling.h"
#include "llvm/Support/KnownBits.h"
#include "llvm/Support/MachineValueType.h"
#include "llvm/Support/Timer.h"
#include "llvm/Support/raw_ostream.h"
#include "llvm/Target/TargetIntrinsicInfo.h"
#include "llvm/Target/TargetMachine.h"
#include "llvm/Target/TargetOptions.h"
#include "llvm/Transforms/Utils/BasicBlockUtils.h"
#include <algorithm>
#include <cassert>
#include <cstdint>
#include <iterator>
#include <limits>
#include <memory>
#include <string>
#include <utility>
#include <vector>
Go to the source code of this file.
Classes | |
class | llvm::OptLevelChanger |
This class is used by SelectionDAGISel to temporarily override the optimization level on a per-function basis. More... | |
Namespaces | |
llvm | |
This class represents lattice values for constants. | |
Macros | |
#define | DEBUG_TYPE "isel" |
Functions | |
STATISTIC (NumFastIselFailures, "Number of instructions fast isel failed on") | |
STATISTIC (NumFastIselSuccess, "Number of instructions fast isel selected") | |
STATISTIC (NumFastIselBlocks, "Number of blocks selected entirely by fast isel") | |
STATISTIC (NumDAGBlocks, "Number of blocks selected using DAG") | |
STATISTIC (NumDAGIselRetries,"Number of times dag isel has to try another path") | |
STATISTIC (NumEntryBlocks, "Number of entry blocks encountered") | |
STATISTIC (NumFastIselFailLowerArguments, "Number of entry blocks where fast isel failed to lower arguments") | |
ScheduleDAGSDNodes * | llvm::createDefaultScheduler (SelectionDAGISel *IS, CodeGenOpt::Level OptLevel) |
createDefaultScheduler - This creates an instruction scheduler appropriate for the target. More... | |
static void | SplitCriticalSideEffectEdges (Function &Fn, DominatorTree *DT, LoopInfo *LI) |
SplitCriticalSideEffectEdges - Look for critical edges with a PHI value that may trap on it. More... | |
static void | reportFastISelFailure (MachineFunction &MF, OptimizationRemarkEmitter &ORE, OptimizationRemarkMissed &R, bool ShouldAbort) |
static bool | hasExceptionPointerOrCodeUser (const CatchPadInst *CPI) |
static void | mapWasmLandingPadIndex (MachineBasicBlock *MBB, const CatchPadInst *CPI) |
static bool | isFoldedOrDeadInstruction (const Instruction *I, FunctionLoweringInfo *FuncInfo) |
isFoldedOrDeadInstruction - Return true if the specified instruction is side-effect free and is either dead or folded into a generated instruction. More... | |
static void | setupSwiftErrorVals (const Function &Fn, const TargetLowering *TLI, FunctionLoweringInfo *FuncInfo) |
Set up SwiftErrorVals by going through the function. More... | |
static void | createSwiftErrorEntriesInEntryBlock (FunctionLoweringInfo *FuncInfo, FastISel *FastIS, const TargetLowering *TLI, const TargetInstrInfo *TII, SelectionDAGBuilder *SDB) |
static void | processDbgDeclares (FunctionLoweringInfo *FuncInfo) |
Collect llvm.dbg.declare information. More... | |
static void | propagateSwiftErrorVRegs (FunctionLoweringInfo *FuncInfo) |
Propagate swifterror values through the machine function CFG. More... | |
static void | preassignSwiftErrorRegs (const TargetLowering *TLI, FunctionLoweringInfo *FuncInfo, BasicBlock::const_iterator Begin, BasicBlock::const_iterator End) |
static bool | MIIsInTerminatorSequence (const MachineInstr &MI) |
Given that the input MI is before a partial terminator sequence TSeq, return true if M + TSeq also a partial terminator sequence. More... | |
static MachineBasicBlock::iterator | FindSplitPointForStackProtector (MachineBasicBlock *BB) |
Find the split point at which to splice the end of BB into its success stack protector check machine basic block. More... | |
static SDNode * | findGlueUse (SDNode *N) |
findGlueUse - Return use of MVT::Glue value produced by the specified SDNode. More... | |
static bool | findNonImmUse (SDNode *Root, SDNode *Def, SDNode *ImmedUse, bool IgnoreChains) |
findNonImmUse - Return true if "Def" is a predecessor of "Root" via a path beyond "ImmedUse". More... | |
static LLVM_ATTRIBUTE_ALWAYS_INLINE uint64_t | GetVBR (uint64_t Val, const unsigned char *MatcherTable, unsigned &Idx) |
GetVBR - decode a vbr encoding whose top bit is set. More... | |
static SDValue | HandleMergeInputChains (SmallVectorImpl< SDNode *> &ChainNodesMatched, SelectionDAG *CurDAG) |
HandleMergeInputChains - This implements the OPC_EmitMergeInputChains operation for when the pattern matched at least one node with a chains. More... | |
static LLVM_ATTRIBUTE_ALWAYS_INLINE bool | CheckSame (const unsigned char *MatcherTable, unsigned &MatcherIndex, SDValue N, const SmallVectorImpl< std::pair< SDValue, SDNode *>> &RecordedNodes) |
CheckSame - Implements OP_CheckSame. More... | |
static LLVM_ATTRIBUTE_ALWAYS_INLINE bool | CheckChildSame (const unsigned char *MatcherTable, unsigned &MatcherIndex, SDValue N, const SmallVectorImpl< std::pair< SDValue, SDNode *>> &RecordedNodes, unsigned ChildNo) |
CheckChildSame - Implements OP_CheckChildXSame. More... | |
static LLVM_ATTRIBUTE_ALWAYS_INLINE bool | CheckPatternPredicate (const unsigned char *MatcherTable, unsigned &MatcherIndex, const SelectionDAGISel &SDISel) |
CheckPatternPredicate - Implements OP_CheckPatternPredicate. More... | |
static LLVM_ATTRIBUTE_ALWAYS_INLINE bool | CheckNodePredicate (const unsigned char *MatcherTable, unsigned &MatcherIndex, const SelectionDAGISel &SDISel, SDNode *N) |
CheckNodePredicate - Implements OP_CheckNodePredicate. More... | |
static LLVM_ATTRIBUTE_ALWAYS_INLINE bool | CheckOpcode (const unsigned char *MatcherTable, unsigned &MatcherIndex, SDNode *N) |
static LLVM_ATTRIBUTE_ALWAYS_INLINE bool | CheckType (const unsigned char *MatcherTable, unsigned &MatcherIndex, SDValue N, const TargetLowering *TLI, const DataLayout &DL) |
static LLVM_ATTRIBUTE_ALWAYS_INLINE bool | CheckChildType (const unsigned char *MatcherTable, unsigned &MatcherIndex, SDValue N, const TargetLowering *TLI, const DataLayout &DL, unsigned ChildNo) |
static LLVM_ATTRIBUTE_ALWAYS_INLINE bool | CheckCondCode (const unsigned char *MatcherTable, unsigned &MatcherIndex, SDValue N) |
static LLVM_ATTRIBUTE_ALWAYS_INLINE bool | CheckValueType (const unsigned char *MatcherTable, unsigned &MatcherIndex, SDValue N, const TargetLowering *TLI, const DataLayout &DL) |
static LLVM_ATTRIBUTE_ALWAYS_INLINE bool | CheckInteger (const unsigned char *MatcherTable, unsigned &MatcherIndex, SDValue N) |
static LLVM_ATTRIBUTE_ALWAYS_INLINE bool | CheckChildInteger (const unsigned char *MatcherTable, unsigned &MatcherIndex, SDValue N, unsigned ChildNo) |
static LLVM_ATTRIBUTE_ALWAYS_INLINE bool | CheckAndImm (const unsigned char *MatcherTable, unsigned &MatcherIndex, SDValue N, const SelectionDAGISel &SDISel) |
static LLVM_ATTRIBUTE_ALWAYS_INLINE bool | CheckOrImm (const unsigned char *MatcherTable, unsigned &MatcherIndex, SDValue N, const SelectionDAGISel &SDISel) |
static unsigned | IsPredicateKnownToFail (const unsigned char *Table, unsigned Index, SDValue N, bool &Result, const SelectionDAGISel &SDISel, SmallVectorImpl< std::pair< SDValue, SDNode *>> &RecordedNodes) |
IsPredicateKnownToFail - If we know how and can do so without pushing a scope, evaluate the current node. More... | |
Variables | |
static cl::opt< int > | EnableFastISelAbort ("fast-isel-abort", cl::Hidden, cl::desc("Enable abort calls when \ast\instruction selection " "fails to lower an instruction: 0 disable the abort, 1 will " "abort but for args, calls and terminators, 2 will also " "abort for argument lowering, and 3 will never fallback " "to SelectionDAG.")) |
static cl::opt< bool > | EnableFastISelFallbackReport ("fast-isel-report-on-fallback", cl::Hidden, cl::desc("Emit a diagnostic when \ast\instruction selection " "falls back to SelectionDAG.")) |
static cl::opt< bool > | UseMBPI ("use-mbpi", cl::desc("use Machine Branch Probability Info"), cl::init(true), cl::Hidden) |
static cl::opt< std::string > | FilterDAGBasicBlockName ("filter-view-dags", cl::Hidden, cl::desc("Only display the basic block whose name " "matches this for all view-*-dags options")) |
static cl::opt< bool > | ViewDAGCombine1 ("view-dag-combine1-dags", cl::Hidden, cl::desc("Pop up a window to show dags before the first " "dag combine pass")) |
static cl::opt< bool > | ViewLegalizeTypesDAGs ("view-legalize-types-dags", cl::Hidden, cl::desc("Pop up a window to show dags before legalize types")) |
static cl::opt< bool > | ViewLegalizeDAGs ("view-legalize-dags", cl::Hidden, cl::desc("Pop up a window to show dags before legalize")) |
static cl::opt< bool > | ViewDAGCombine2 ("view-dag-combine2-dags", cl::Hidden, cl::desc("Pop up a window to show dags before the second " "dag combine pass")) |
static cl::opt< bool > | ViewDAGCombineLT ("view-dag-combine-lt-dags", cl::Hidden, cl::desc("Pop up a window to show dags before the post legalize types" " dag combine pass")) |
static cl::opt< bool > | ViewISelDAGs ("view-isel-dags", cl::Hidden, cl::desc("Pop up a window to show isel dags as they are selected")) |
static cl::opt< bool > | ViewSchedDAGs ("view-sched-dags", cl::Hidden, cl::desc("Pop up a window to show sched dags as they are processed")) |
static cl::opt< bool > | ViewSUnitDAGs ("view-sunit-dags", cl::Hidden, cl::desc("Pop up a window to show SUnit dags after they are processed")) |
static cl::opt< RegisterScheduler::FunctionPassCtor, false, RegisterPassParser< RegisterScheduler > > | ISHeuristic ("pre-RA-sched", cl::init(&createDefaultScheduler), cl::Hidden, cl::desc("Instruction schedulers available (before register" " allocation):")) |
ISHeuristic command line option for instruction schedulers. More... | |
static RegisterScheduler | defaultListDAGScheduler ("default", "Best scheduler for the target", createDefaultScheduler) |
#define DEBUG_TYPE "isel" |
Definition at line 105 of file SelectionDAGISel.cpp.
|
inlinestatic |
Definition at line 2761 of file SelectionDAGISel.cpp.
References llvm::ISD::AND, C, llvm::SelectionDAGISel::CheckAndMask(), llvm::dyn_cast(), llvm::SDNode::getOpcode(), llvm::SDValue::getOperand(), llvm::SDNode::getOperand(), GetVBR(), and LLVM_ATTRIBUTE_ALWAYS_INLINE.
Referenced by IsPredicateKnownToFail(), and llvm::SelectionDAGISel::SelectCodeCommon().
|
inlinestatic |
Definition at line 2753 of file SelectionDAGISel.cpp.
References CheckInteger(), llvm::SDValue::getNumOperands(), llvm::SDValue::getOperand(), and LLVM_ATTRIBUTE_ALWAYS_INLINE.
Referenced by IsPredicateKnownToFail(), and llvm::SelectionDAGISel::SelectCodeCommon().
|
inlinestatic |
CheckChildSame - Implements OP_CheckChildXSame.
Definition at line 2671 of file SelectionDAGISel.cpp.
References CheckSame(), llvm::SDValue::getNumOperands(), llvm::SDValue::getOperand(), and LLVM_ATTRIBUTE_ALWAYS_INLINE.
Referenced by IsPredicateKnownToFail(), and llvm::SelectionDAGISel::SelectCodeCommon().
|
inlinestatic |
Definition at line 2714 of file SelectionDAGISel.cpp.
References CheckType(), llvm::SDValue::getNumOperands(), llvm::SDValue::getOperand(), LLVM_ATTRIBUTE_ALWAYS_INLINE, and llvm::SelectionDAGISel::TLI.
Referenced by IsPredicateKnownToFail(), and llvm::SelectionDAGISel::SelectCodeCommon().
|
inlinestatic |
Definition at line 2724 of file SelectionDAGISel.cpp.
References LLVM_ATTRIBUTE_ALWAYS_INLINE, and N.
Referenced by IsPredicateKnownToFail(), and llvm::SelectionDAGISel::SelectCodeCommon().
|
inlinestatic |
Definition at line 2742 of file SelectionDAGISel.cpp.
References C, llvm::dyn_cast(), llvm::ConstantSDNode::getSExtValue(), GetVBR(), LLVM_ATTRIBUTE_ALWAYS_INLINE, and N.
Referenced by CheckChildInteger(), IsPredicateKnownToFail(), and llvm::SelectionDAGISel::SelectCodeCommon().
|
inlinestatic |
CheckNodePredicate - Implements OP_CheckNodePredicate.
Definition at line 2690 of file SelectionDAGISel.cpp.
References llvm::SelectionDAGISel::CheckNodePredicate(), and LLVM_ATTRIBUTE_ALWAYS_INLINE.
|
inlinestatic |
Definition at line 2696 of file SelectionDAGISel.cpp.
References llvm::SDNode::getOpcode(), and LLVM_ATTRIBUTE_ALWAYS_INLINE.
Referenced by IsPredicateKnownToFail(), and llvm::SelectionDAGISel::SelectCodeCommon().
|
inlinestatic |
Definition at line 2774 of file SelectionDAGISel.cpp.
References C, llvm::SelectionDAGISel::CheckOrMask(), llvm::dyn_cast(), llvm::SDNode::getOpcode(), llvm::SDValue::getOperand(), llvm::SDNode::getOperand(), GetVBR(), and llvm::ISD::OR.
Referenced by IsPredicateKnownToFail(), and llvm::SelectionDAGISel::SelectCodeCommon().
|
inlinestatic |
CheckPatternPredicate - Implements OP_CheckPatternPredicate.
Definition at line 2683 of file SelectionDAGISel.cpp.
References llvm::SelectionDAGISel::CheckPatternPredicate(), and LLVM_ATTRIBUTE_ALWAYS_INLINE.
|
inlinestatic |
CheckSame - Implements OP_CheckSame.
Definition at line 2660 of file SelectionDAGISel.cpp.
References assert(), and LLVM_ATTRIBUTE_ALWAYS_INLINE.
Referenced by llvm::FileCheckString::Check(), CheckChildSame(), llvm::FileCheckString::FileCheckString(), IsPredicateKnownToFail(), and llvm::SelectionDAGISel::SelectCodeCommon().
|
inlinestatic |
Definition at line 2704 of file SelectionDAGISel.cpp.
References llvm::TargetLoweringBase::getPointerTy(), llvm::SDValue::getValueType(), llvm::MVT::iPTR, and LLVM_ATTRIBUTE_ALWAYS_INLINE.
Referenced by CheckChildType(), llvm::IsAOpInit::classof(), llvm::IsAOpInit::Fold(), llvm::IsAOpInit::getAsString(), llvm::LoopAccessInfo::getPSE(), IsPredicateKnownToFail(), llvm::IsAOpInit::Profile(), llvm::IsAOpInit::resolveReferences(), and llvm::SelectionDAGISel::SelectCodeCommon().
|
inlinestatic |
Definition at line 2731 of file SelectionDAGISel.cpp.
References llvm::TargetLoweringBase::getPointerTy(), llvm::MVT::iPTR, LLVM_ATTRIBUTE_ALWAYS_INLINE, and N.
Referenced by IsPredicateKnownToFail(), and llvm::SelectionDAGISel::SelectCodeCommon().
|
static |
Definition at line 1265 of file SelectionDAGISel.cpp.
References assert(), llvm::MachineFunction::begin(), llvm::BuildMI(), llvm::MachineRegisterInfo::createVirtualRegister(), llvm::SmallVectorBase::empty(), llvm::MCInstrInfo::get(), llvm::SelectionDAGBuilder::getCurDebugLoc(), llvm::MachineFunction::getDataLayout(), llvm::MachineBasicBlock::getFirstNonPHI(), llvm::TargetLoweringBase::getPointerTy(), llvm::TargetLoweringBase::getRegClassFor(), llvm::MachineFunction::getRegInfo(), llvm::FunctionLoweringInfo::InsertPt, llvm::FunctionLoweringInfo::MBB, llvm::FunctionLoweringInfo::MF, llvm::FunctionLoweringInfo::setCurrentSwiftErrorVReg(), llvm::FastISel::setLastLocalValue(), llvm::TargetLowering::supportSwiftError(), llvm::FunctionLoweringInfo::SwiftErrorArg, and llvm::FunctionLoweringInfo::SwiftErrorVals.
findGlueUse - Return use of MVT::Glue value produced by the specified SDNode.
Definition at line 2289 of file SelectionDAGISel.cpp.
References E, llvm::SDNode::getNumValues(), llvm::SDUse::getResNo(), llvm::SDUse::getUser(), I, llvm::SDNode::use_begin(), and llvm::SDNode::use_end().
Referenced by llvm::SelectionDAGISel::IsLegalToFold().
|
static |
findNonImmUse - Return true if "Def" is a predecessor of "Root" via a path beyond "ImmedUse".
We may ignore chains as they are checked separately.
Definition at line 2301 of file SelectionDAGISel.cpp.
References llvm::SDNode::hasPredecessorHelper(), llvm::SmallPtrSetImpl< PtrType >::insert(), llvm::SDNode::isOnlyUserOf(), N, llvm::SDNode::op_values(), llvm::MVT::Other, and llvm::SmallVectorTemplateBase< T >::push_back().
Referenced by llvm::SelectionDAGISel::IsLegalToFold().
|
static |
Find the split point at which to splice the end of BB into its success stack protector check machine basic block.
On many platforms, due to ABI constraints, terminators, even before register allocation, use physical registers. This creates an issue for us since physical registers at this point can not travel across basic blocks. Luckily, selectiondag always moves physical registers into vregs when they enter functions and moves them through a sequence of copies back into the physical registers right before the terminator creating a ``Terminator Sequence''. This function is searching for the beginning of the terminator sequence so that we can ensure that we splice off not just the terminator, but additionally the copies that move the vregs into the physical registers.
Definition at line 1873 of file SelectionDAGISel.cpp.
References llvm::MachineBasicBlock::begin(), and llvm::MachineBasicBlock::getFirstTerminator().
|
inlinestatic |
GetVBR - decode a vbr encoding whose top bit is set.
Definition at line 2463 of file SelectionDAGISel.cpp.
References assert(), llvm::SmallVectorTemplateCommon< T >::begin(), llvm::count(), llvm::SelectionDAGISel::CurDAG, llvm::dbgs(), llvm::ISD::DELETED_NODE, E, llvm::SmallVectorBase::empty(), llvm::SmallVectorTemplateCommon< T >::end(), llvm::SDValue::getNode(), llvm::SDNode::getNumValues(), llvm::SDNode::getOpcode(), llvm::SDValue::getValue(), llvm::SDValue::getValueType(), llvm::MVT::Glue, LLVM_DEBUG, N, llvm::MVT::Other, llvm::SmallVectorTemplateBase< T >::push_back(), llvm::SelectionDAG::RemoveDeadNodes(), replace(), llvm::SelectionDAGISel::ReplaceUses(), llvm::SmallVectorBase::size(), llvm::ISD::TokenFactor, and llvm::SDNode::use_empty().
Referenced by CheckAndImm(), CheckInteger(), CheckOrImm(), and llvm::SelectionDAGISel::SelectCodeCommon().
|
static |
HandleMergeInputChains - This implements the OPC_EmitMergeInputChains operation for when the pattern matched at least one node with a chains.
The input vector contains a list of all of the chained nodes that we match. We must determine if this is a valid thing to cover (i.e. matching it won't induce cycles in the DAG) and if so, creating a TokenFactor node. that will be used as the input node chain for the generated nodes.
Definition at line 2539 of file SelectionDAGISel.cpp.
References llvm::SmallPtrSetImplBase::clear(), llvm::SmallVectorBase::empty(), llvm::ISD::EntryToken, llvm::SelectionDAG::getEntryNode(), llvm::SelectionDAG::getNode(), llvm::SDNode::getOperand(), llvm::SDNode::hasPredecessorHelper(), llvm::SmallPtrSetImpl< PtrType >::insert(), llvm::SDNode::op_values(), llvm::MVT::Other, llvm::SmallVectorImpl< T >::pop_back_val(), llvm::SmallVectorTemplateBase< T >::push_back(), second, llvm::SmallVectorBase::size(), and llvm::ISD::TokenFactor.
Referenced by llvm::SelectionDAGISel::SelectCodeCommon().
|
static |
Definition at line 1121 of file SelectionDAGISel.cpp.
References llvm::Intrinsic::eh_exceptioncode, llvm::Intrinsic::eh_exceptionpointer, and llvm::Value::users().
Referenced by mapWasmLandingPadIndex().
|
static |
isFoldedOrDeadInstruction - Return true if the specified instruction is side-effect free and is either dead or folded into a generated instruction.
Return false if it needs to be emitted.
Definition at line 1222 of file SelectionDAGISel.cpp.
References I, llvm::Instruction::isEHPad(), llvm::FunctionLoweringInfo::isExportedInst(), llvm::Instruction::isTerminator(), and llvm::Instruction::mayWriteToMemory().
|
static |
IsPredicateKnownToFail - If we know how and can do so without pushing a scope, evaluate the current node.
If the current predicate is known to fail, set Result=true and return anything. If the current predicate is known to pass, set Result=false and return the MatcherIndex to continue with. If the current predicate is unknown, set Result=false and return the MatcherIndex to continue with.
Definition at line 2792 of file SelectionDAGISel.cpp.
References CheckAndImm(), CheckChildInteger(), CheckChildSame(), CheckChildType(), CheckCondCode(), CheckInteger(), llvm::SelectionDAGISel::CheckNodePredicate(), CheckOpcode(), CheckOrImm(), llvm::SelectionDAGISel::CheckPatternPredicate(), CheckSame(), CheckType(), CheckValueType(), llvm::SelectionDAGISel::CurDAG, llvm::SelectionDAG::DAGUpdateListener, E, llvm::SelectionDAG::getDataLayout(), llvm::SDValue::getNode(), llvm::SDValue::getValue(), I, llvm::SDNode::isMachineOpcode(), N, llvm::SelectionDAGISel::OPC_CheckAndImm, llvm::SelectionDAGISel::OPC_CheckChild0Integer, llvm::SelectionDAGISel::OPC_CheckChild0Same, llvm::SelectionDAGISel::OPC_CheckChild0Type, llvm::SelectionDAGISel::OPC_CheckChild1Integer, llvm::SelectionDAGISel::OPC_CheckChild1Same, llvm::SelectionDAGISel::OPC_CheckChild1Type, llvm::SelectionDAGISel::OPC_CheckChild2Integer, llvm::SelectionDAGISel::OPC_CheckChild2Same, llvm::SelectionDAGISel::OPC_CheckChild2Type, llvm::SelectionDAGISel::OPC_CheckChild3Integer, llvm::SelectionDAGISel::OPC_CheckChild3Same, llvm::SelectionDAGISel::OPC_CheckChild3Type, llvm::SelectionDAGISel::OPC_CheckChild4Integer, llvm::SelectionDAGISel::OPC_CheckChild4Type, llvm::SelectionDAGISel::OPC_CheckChild5Type, llvm::SelectionDAGISel::OPC_CheckChild6Type, llvm::SelectionDAGISel::OPC_CheckChild7Type, llvm::SelectionDAGISel::OPC_CheckCondCode, llvm::SelectionDAGISel::OPC_CheckInteger, llvm::SelectionDAGISel::OPC_CheckOpcode, llvm::SelectionDAGISel::OPC_CheckOrImm, llvm::SelectionDAGISel::OPC_CheckPatternPredicate, llvm::SelectionDAGISel::OPC_CheckPredicate, llvm::SelectionDAGISel::OPC_CheckSame, llvm::SelectionDAGISel::OPC_CheckType, llvm::SelectionDAGISel::OPC_CheckTypeRes, llvm::SelectionDAGISel::OPC_CheckValueType, llvm::NVPTX::PTXCvtMode::RN, and llvm::SelectionDAGISel::TLI.
Referenced by llvm::SelectionDAGISel::SelectCodeCommon().
|
static |
Definition at line 1136 of file SelectionDAGISel.cpp.
References llvm::MachineFunction::addLandingPad(), llvm::MachineBasicBlock::addLiveIn(), assert(), llvm::BuildMI(), llvm::classifyEHPersonality(), llvm::SelectionDAGISel::CurDAG, llvm::ISD::EH_LABEL, llvm::FunctionLoweringInfo::ExceptionPointerVirtReg, llvm::FunctionLoweringInfo::ExceptionSelectorVirtReg, llvm::FunctionLoweringInfo::Fn, llvm::SelectionDAGISel::FuncInfo, llvm::MCInstrInfo::get(), llvm::FuncletPadInst::getArgOperand(), llvm::MachineBasicBlock::getBasicBlock(), llvm::FunctionLoweringInfo::getCatchPadExceptionPointerVReg(), llvm::SelectionDAGBuilder::getCurDebugLoc(), llvm::SelectionDAG::getDataLayout(), llvm::TargetLoweringBase::getExceptionPointerRegister(), llvm::TargetLoweringBase::getExceptionSelectorRegister(), llvm::BasicBlock::getFirstNonPHI(), llvm::FuncletPadInst::getNumArgOperands(), llvm::MachineBasicBlock::getParent(), llvm::Function::getPersonalityFn(), llvm::TargetLoweringBase::getPointerTy(), llvm::TargetLoweringBase::getRegClassFor(), hasExceptionPointerOrCodeUser(), llvm::FunctionLoweringInfo::InsertPt, llvm::isFuncletEHPersonality(), llvm::RegState::Kill, llvm::SelectionDAGBuilder::LPadToCallSiteMap, llvm::FunctionLoweringInfo::MBB, llvm::SelectionDAGISel::MF, Reg, llvm::SelectionDAGISel::SDB, llvm::MachineFunction::setCallSiteLandingPad(), llvm::MachineFunction::setWasmLandingPadIndex(), llvm::SelectionDAGISel::TII, llvm::SelectionDAGISel::TLI, llvm::Value::users(), llvm::Wasm_CXX, and llvm::Intrinsic::wasm_landingpad_index.
|
static |
Given that the input MI is before a partial terminator sequence TSeq, return true if M + TSeq also a partial terminator sequence.
A Terminator sequence is a sequence of MachineInstrs which at this point in lowering copy vregs into physical registers, which are then passed into terminator instructors so we can satisfy ABI constraints. A partial terminator sequence is an improper subset of a terminator sequence (i.e. it may be the whole terminator sequence).
Definition at line 1817 of file SelectionDAGISel.cpp.
References assert(), llvm::MachineOperand::getReg(), llvm::MachineInstr::isCopy(), llvm::MachineInstr::isDebugValue(), llvm::MachineOperand::isDef(), llvm::MachineInstr::isImplicitDef(), llvm::TargetRegisterInfo::isPhysicalRegister(), llvm::MachineOperand::isReg(), llvm::MachineInstr::operands_begin(), and llvm::MachineInstr::operands_end().
|
static |
Definition at line 1462 of file SelectionDAGISel.cpp.
References llvm::SmallVectorBase::empty(), llvm::TargetLowering::supportSwiftError(), and llvm::FunctionLoweringInfo::SwiftErrorVals.
|
static |
Collect llvm.dbg.declare information.
This is done after argument lowering in case the declarations refer to arguments.
Definition at line 1304 of file SelectionDAGISel.cpp.
References llvm::Address, Arg, assert(), llvm::dyn_cast(), llvm::FunctionLoweringInfo::Fn, llvm::DbgDeclareInst::getAddress(), llvm::FunctionLoweringInfo::getArgumentFrameIndex(), llvm::APInt::getBoolValue(), llvm::MachineFunction::getDataLayout(), llvm::Instruction::getDebugLoc(), llvm::DbgVariableIntrinsic::getExpression(), llvm::DataLayout::getTypeSizeInBits(), llvm::DbgVariableIntrinsic::getVariable(), llvm::APInt::getZExtValue(), I, llvm::max(), llvm::SelectionDAGISel::MF, llvm::FunctionLoweringInfo::MF, llvm::DIExpression::NoDeref, llvm::DIExpression::prepend(), llvm::MachineFunction::setVariableDbgInfo(), SI, and llvm::FunctionLoweringInfo::StaticAllocaMap.
|
static |
Propagate swifterror values through the machine function CFG.
Definition at line 1348 of file SelectionDAGISel.cpp.
References llvm::MachineInstrBuilder::addMBB(), llvm::MachineInstrBuilder::addReg(), assert(), llvm::SmallVectorTemplateCommon< T >::begin(), llvm::BuildMI(), llvm::MachineRegisterInfo::createVirtualRegister(), llvm::SmallVectorBase::empty(), llvm::SmallVectorTemplateCommon< T >::end(), llvm::find_if(), llvm::MCInstrInfo::get(), llvm::MachineFunction::getDataLayout(), llvm::TargetSubtargetInfo::getInstrInfo(), llvm::FunctionLoweringInfo::getOrCreateSwiftErrorVReg(), llvm::TargetLoweringBase::getPointerTy(), llvm::TargetLoweringBase::getRegClassFor(), llvm::MachineFunction::getRegInfo(), llvm::MachineFunction::getSubtarget(), llvm::SmallSet< T, N, C >::insert(), llvm::FunctionLoweringInfo::MF, llvm::SmallVectorTemplateBase< T >::push_back(), second, llvm::FunctionLoweringInfo::setCurrentSwiftErrorVReg(), llvm::SmallVectorBase::size(), llvm::TargetLowering::supportSwiftError(), llvm::FunctionLoweringInfo::SwiftErrorVals, llvm::FunctionLoweringInfo::SwiftErrorVRegDefMap, llvm::FunctionLoweringInfo::SwiftErrorVRegUpwardsUse, llvm::SelectionDAGISel::TII, llvm::FunctionLoweringInfo::TLI, and llvm::SelectionDAGISel::TLI.
|
static |
|
static |
Set up SwiftErrorVals by going through the function.
If the function has swifterror argument, it will be the first entry.
Definition at line 1233 of file SelectionDAGISel.cpp.
References llvm::Function::arg_begin(), llvm::Function::arg_end(), assert(), llvm::SmallVectorImpl< T >::clear(), llvm::SmallVectorTemplateBase< T, bool >::push_back(), llvm::TargetLowering::supportSwiftError(), llvm::FunctionLoweringInfo::SwiftErrorArg, llvm::FunctionLoweringInfo::SwiftErrorVals, llvm::FunctionLoweringInfo::SwiftErrorVRegDefMap, llvm::FunctionLoweringInfo::SwiftErrorVRegDefUses, and llvm::FunctionLoweringInfo::SwiftErrorVRegUpwardsUse.
|
static |
SplitCriticalSideEffectEdges - Look for critical edges with a PHI value that may trap on it.
In this case we have to split the edge so that the path through the predecessor block that doesn't go to the phi block doesn't execute the possibly trapping instruction. If available, we pass domtree and loop info to be updated when we split critical edges. This is because SelectionDAGISel preserves these analyses. This is required for correctness, so it must be done at -O0.
Definition at line 349 of file SelectionDAGISel.cpp.
References llvm::Constant::canTrap(), llvm::dyn_cast(), llvm::PHINode::getIncomingBlock(), llvm::PHINode::getIncomingValue(), llvm::PHINode::getNumIncomingValues(), llvm::Instruction::getNumSuccessors(), llvm::GetSuccessorNumber(), llvm::BasicBlock::getTerminator(), I, llvm::CriticalEdgeSplittingOptions::setMergeIdenticalEdges(), and llvm::SplitCriticalEdge().
Referenced by llvm::SelectionDAGISel::runOnMachineFunction().
STATISTIC | ( | NumFastIselFailures | , |
"Number of instructions fast isel failed on" | |||
) |
STATISTIC | ( | NumFastIselSuccess | , |
"Number of instructions fast isel selected" | |||
) |
STATISTIC | ( | NumFastIselBlocks | , |
"Number of blocks selected entirely by fast isel" | |||
) |
STATISTIC | ( | NumDAGBlocks | , |
"Number of blocks selected using DAG" | |||
) |
STATISTIC | ( | NumDAGIselRetries | , |
"Number of times dag isel has to try another path" | |||
) |
STATISTIC | ( | NumEntryBlocks | , |
"Number of entry blocks encountered" | |||
) |
STATISTIC | ( | NumFastIselFailLowerArguments | , |
"Number of entry blocks where fast isel failed to lower arguments" | |||
) |
|
static |
|
static |
Referenced by llvm::SelectionDAGISel::runOnMachineFunction().
|
static |
Referenced by llvm::SelectionDAGISel::runOnMachineFunction().
|
static |
|
static |
ISHeuristic command line option for instruction schedulers.
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |