LLVM  14.0.0git
SelectionDAGISel.h
Go to the documentation of this file.
1 //===-- llvm/CodeGen/SelectionDAGISel.h - Common Base Class------*- C++ -*-===//
2 //
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6 //
7 //===----------------------------------------------------------------------===//
8 //
9 // This file implements the SelectionDAGISel class, which is used as the common
10 // base class for SelectionDAG-based instruction selectors.
11 //
12 //===----------------------------------------------------------------------===//
13 
14 #ifndef LLVM_CODEGEN_SELECTIONDAGISEL_H
15 #define LLVM_CODEGEN_SELECTIONDAGISEL_H
16 
20 #include "llvm/IR/BasicBlock.h"
21 #include <memory>
22 
23 namespace llvm {
24 class AAResults;
25 class SelectionDAGBuilder;
26 class SDValue;
27 class MachineRegisterInfo;
28 class MachineFunction;
29 class OptimizationRemarkEmitter;
30 class TargetLowering;
31 class TargetLibraryInfo;
32 class FunctionLoweringInfo;
33 class SwiftErrorValueTracking;
34 class GCFunctionInfo;
35 class ScheduleDAGSDNodes;
36 
37 /// SelectionDAGISel - This is the common base class used for SelectionDAG-based
38 /// pattern-matching instruction selectors.
40 public:
43  std::unique_ptr<FunctionLoweringInfo> FuncInfo;
48  std::unique_ptr<SelectionDAGBuilder> SDB;
56 
57  /// Current optimization remark emitter.
58  /// Used to report things like combines and FastISel failures.
59  std::unique_ptr<OptimizationRemarkEmitter> ORE;
60 
61  static char ID;
62 
63  explicit SelectionDAGISel(TargetMachine &tm,
65  ~SelectionDAGISel() override;
66 
67  const TargetLowering *getTargetLowering() const { return TLI; }
68 
69  void getAnalysisUsage(AnalysisUsage &AU) const override;
70 
71  bool runOnMachineFunction(MachineFunction &MF) override;
72 
73  virtual void emitFunctionEntryCode() {}
74 
75  /// PreprocessISelDAG - This hook allows targets to hack on the graph before
76  /// instruction selection starts.
77  virtual void PreprocessISelDAG() {}
78 
79  /// PostprocessISelDAG() - This hook allows the target to hack on the graph
80  /// right after selection.
81  virtual void PostprocessISelDAG() {}
82 
83  /// Main hook for targets to transform nodes into machine nodes.
84  virtual void Select(SDNode *N) = 0;
85 
86  /// SelectInlineAsmMemoryOperand - Select the specified address as a target
87  /// addressing mode, according to the specified constraint. If this does
88  /// not match or is not implemented, return true. The resultant operands
89  /// (which will appear in the machine instruction) should be added to the
90  /// OutOps vector.
92  unsigned ConstraintID,
93  std::vector<SDValue> &OutOps) {
94  return true;
95  }
96 
97  /// IsProfitableToFold - Returns true if it's profitable to fold the specific
98  /// operand node N of U during instruction selection that starts at Root.
99  virtual bool IsProfitableToFold(SDValue N, SDNode *U, SDNode *Root) const;
100 
101  /// IsLegalToFold - Returns true if the specific operand node N of
102  /// U can be folded during instruction selection that starts at Root.
103  /// FIXME: This is a static member function because the MSP430/X86
104  /// targets, which uses it during isel. This could become a proper member.
105  static bool IsLegalToFold(SDValue N, SDNode *U, SDNode *Root,
107  bool IgnoreChains = false);
108 
109  static void InvalidateNodeId(SDNode *N);
110  static int getUninvalidatedNodeId(SDNode *N);
111 
112  static void EnforceNodeIdInvariant(SDNode *N);
113 
114  // Opcodes used by the DAG state machine:
150 
164  // Space-optimized forms that implicitly encode number of result VTs.
167  // Space-optimized forms that implicitly encode number of result VTs.
170  // Contains offset in table for pattern being selected
172  };
173 
174  enum {
175  OPFL_None = 0, // Node has no chain or glue input and isn't variadic.
176  OPFL_Chain = 1, // Node has a chain input.
177  OPFL_GlueInput = 2, // Node has a glue input.
178  OPFL_GlueOutput = 4, // Node has a glue output.
179  OPFL_MemRefs = 8, // Node gets accumulated MemRefs.
180  OPFL_Variadic0 = 1<<4, // Node is variadic, root has 0 fixed inputs.
181  OPFL_Variadic1 = 2<<4, // Node is variadic, root has 1 fixed inputs.
182  OPFL_Variadic2 = 3<<4, // Node is variadic, root has 2 fixed inputs.
183  OPFL_Variadic3 = 4<<4, // Node is variadic, root has 3 fixed inputs.
184  OPFL_Variadic4 = 5<<4, // Node is variadic, root has 4 fixed inputs.
185  OPFL_Variadic5 = 6<<4, // Node is variadic, root has 5 fixed inputs.
186  OPFL_Variadic6 = 7<<4, // Node is variadic, root has 6 fixed inputs.
187 
189  };
190 
191  /// getNumFixedFromVariadicInfo - Transform an EmitNode flags word into the
192  /// number of fixed arity values that should be skipped when copying from the
193  /// root.
194  static inline int getNumFixedFromVariadicInfo(unsigned Flags) {
195  return ((Flags&OPFL_VariadicInfo) >> 4)-1;
196  }
197 
198 
199 protected:
200  /// DAGSize - Size of DAG being instruction selected.
201  ///
202  unsigned DAGSize;
203 
204  /// ReplaceUses - replace all uses of the old node F with the use
205  /// of the new node T.
208  EnforceNodeIdInvariant(T.getNode());
209  }
210 
211  /// ReplaceUses - replace all uses of the old nodes F with the use
212  /// of the new nodes T.
213  void ReplaceUses(const SDValue *F, const SDValue *T, unsigned Num) {
215  for (unsigned i = 0; i < Num; ++i)
216  EnforceNodeIdInvariant(T[i].getNode());
217  }
218 
219  /// ReplaceUses - replace all uses of the old node F with the use
220  /// of the new node T.
221  void ReplaceUses(SDNode *F, SDNode *T) {
224  }
225 
226  /// Replace all uses of \c F with \c T, then remove \c F from the DAG.
227  void ReplaceNode(SDNode *F, SDNode *T) {
231  }
232 
233  /// SelectInlineAsmMemoryOperands - Calls to this are automatically generated
234  /// by tblgen. Others should not call it.
235  void SelectInlineAsmMemoryOperands(std::vector<SDValue> &Ops,
236  const SDLoc &DL);
237 
238  /// getPatternForIndex - Patterns selected by tablegen during ISEL
239  virtual StringRef getPatternForIndex(unsigned index) {
240  llvm_unreachable("Tblgen should generate the implementation of this!");
241  }
242 
243  /// getIncludePathForIndex - get the td source location of pattern instantiation
245  llvm_unreachable("Tblgen should generate the implementation of this!");
246  }
247 
248  bool shouldOptForSize(const MachineFunction *MF) const {
249  return CurDAG->shouldOptForSize();
250  }
251 
252 public:
253  // Calls to these predicates are generated by tblgen.
254  bool CheckAndMask(SDValue LHS, ConstantSDNode *RHS,
255  int64_t DesiredMaskS) const;
256  bool CheckOrMask(SDValue LHS, ConstantSDNode *RHS,
257  int64_t DesiredMaskS) const;
258 
259 
260  /// CheckPatternPredicate - This function is generated by tblgen in the
261  /// target. It runs the specified pattern predicate and returns true if it
262  /// succeeds or false if it fails. The number is a private implementation
263  /// detail to the code tblgen produces.
264  virtual bool CheckPatternPredicate(unsigned PredNo) const {
265  llvm_unreachable("Tblgen should generate the implementation of this!");
266  }
267 
268  /// CheckNodePredicate - This function is generated by tblgen in the target.
269  /// It runs node predicate number PredNo and returns true if it succeeds or
270  /// false if it fails. The number is a private implementation
271  /// detail to the code tblgen produces.
272  virtual bool CheckNodePredicate(SDNode *N, unsigned PredNo) const {
273  llvm_unreachable("Tblgen should generate the implementation of this!");
274  }
275 
276  /// CheckNodePredicateWithOperands - This function is generated by tblgen in
277  /// the target.
278  /// It runs node predicate number PredNo and returns true if it succeeds or
279  /// false if it fails. The number is a private implementation detail to the
280  /// code tblgen produces.
282  SDNode *N, unsigned PredNo,
283  const SmallVectorImpl<SDValue> &Operands) const {
284  llvm_unreachable("Tblgen should generate the implementation of this!");
285  }
286 
287  virtual bool CheckComplexPattern(SDNode *Root, SDNode *Parent, SDValue N,
288  unsigned PatternNo,
289  SmallVectorImpl<std::pair<SDValue, SDNode*> > &Result) {
290  llvm_unreachable("Tblgen should generate the implementation of this!");
291  }
292 
293  virtual SDValue RunSDNodeXForm(SDValue V, unsigned XFormNo) {
294  llvm_unreachable("Tblgen should generate this!");
295  }
296 
297  void SelectCodeCommon(SDNode *NodeToMatch, const unsigned char *MatcherTable,
298  unsigned TableSize);
299 
300  /// Return true if complex patterns for this target can mutate the
301  /// DAG.
302  virtual bool ComplexPatternFuncMutatesDAG() const {
303  return false;
304  }
305 
306  /// Return whether the node may raise an FP exception.
307  bool mayRaiseFPException(SDNode *Node) const;
308 
309  bool isOrEquivalentToAdd(const SDNode *N) const;
310 
311 private:
312 
313  // Calls to these functions are generated by tblgen.
314  void Select_INLINEASM(SDNode *N);
315  void Select_READ_REGISTER(SDNode *Op);
316  void Select_WRITE_REGISTER(SDNode *Op);
317  void Select_UNDEF(SDNode *N);
318  void CannotYetSelect(SDNode *N);
319 
320  void Select_FREEZE(SDNode *N);
321  void Select_ARITH_FENCE(SDNode *N);
322 
323 private:
324  void DoInstructionSelection();
325  SDNode *MorphNode(SDNode *Node, unsigned TargetOpc, SDVTList VTList,
326  ArrayRef<SDValue> Ops, unsigned EmitNodeInfo);
327 
328  /// Prepares the landing pad to take incoming values or do other EH
329  /// personality specific tasks. Returns true if the block should be
330  /// instruction selected, false if no code should be emitted for it.
331  bool PrepareEHLandingPad();
332 
333  /// Perform instruction selection on all basic blocks in the function.
334  void SelectAllBasicBlocks(const Function &Fn);
335 
336  /// Perform instruction selection on a single basic block, for
337  /// instructions between \p Begin and \p End. \p HadTailCall will be set
338  /// to true if a call in the block was translated as a tail call.
339  void SelectBasicBlock(BasicBlock::const_iterator Begin,
341  bool &HadTailCall);
342  void FinishBasicBlock();
343 
344  void CodeGenAndEmitDAG();
345 
346  /// Generate instructions for lowering the incoming arguments of the
347  /// given function.
348  void LowerArguments(const Function &F);
349 
350  void ComputeLiveOutVRegInfo();
351 
352  /// Create the scheduler. If a specific scheduler was specified
353  /// via the SchedulerRegistry, use it, otherwise select the
354  /// one preferred by the target.
355  ///
356  ScheduleDAGSDNodes *CreateScheduler();
357 
358  /// OpcodeOffset - This is a cache used to dispatch efficiently into isel
359  /// state machines that start with a OPC_SwitchOpcode node.
360  std::vector<unsigned> OpcodeOffset;
361 
362  void UpdateChains(SDNode *NodeToMatch, SDValue InputChain,
363  SmallVectorImpl<SDNode *> &ChainNodesMatched,
364  bool isMorphNodeTo);
365 };
366 
367 }
368 
369 #endif /* LLVM_CODEGEN_SELECTIONDAGISEL_H */
llvm::SelectionDAGISel::OPC_MoveChild2
@ OPC_MoveChild2
Definition: SelectionDAGISel.h:123
i
i
Definition: README.txt:29
llvm::SelectionDAGISel::FastISelFailed
bool FastISelFailed
Definition: SelectionDAGISel.h:54
llvm::ConstantSDNode
Definition: SelectionDAGNodes.h:1556
llvm::SelectionDAGISel::OPC_CheckComplexPat
@ OPC_CheckComplexPat
Definition: SelectionDAGISel.h:145
llvm::SelectionDAGISel::OPC_EmitInteger
@ OPC_EmitInteger
Definition: SelectionDAGISel.h:151
llvm::SelectionDAGISel::getTargetLowering
const TargetLowering * getTargetLowering() const
Definition: SelectionDAGISel.h:67
llvm::SelectionDAGISel::OPC_CheckChild2Integer
@ OPC_CheckChild2Integer
Definition: SelectionDAGISel.h:141
llvm::SelectionDAGISel::TLI
const TargetLowering * TLI
Definition: SelectionDAGISel.h:53
llvm
---------------------— PointerInfo ------------------------------------—
Definition: AllocatorList.h:23
llvm::SelectionDAGISel::getIncludePathForIndex
virtual StringRef getIncludePathForIndex(unsigned index)
getIncludePathForIndex - get the td source location of pattern instantiation
Definition: SelectionDAGISel.h:244
llvm::SelectionDAGISel::TM
TargetMachine & TM
Definition: SelectionDAGISel.h:41
llvm::SelectionDAGISel::isOrEquivalentToAdd
bool isOrEquivalentToAdd(const SDNode *N) const
Definition: SelectionDAGISel.cpp:3767
llvm::ScheduleDAGSDNodes
ScheduleDAGSDNodes - A ScheduleDAG for scheduling SDNode-based DAGs.
Definition: ScheduleDAGSDNodes.h:46
llvm::SDLoc
Wrapper class for IR location info (IR ordering and DebugLoc) to be passed into SDNode creation funct...
Definition: SelectionDAGNodes.h:1086
llvm::SelectionDAGISel::OPC_EmitMergeInputChains1_2
@ OPC_EmitMergeInputChains1_2
Definition: SelectionDAGISel.h:159
llvm::SelectionDAGISel::EnforceNodeIdInvariant
static void EnforceNodeIdInvariant(SDNode *N)
Definition: SelectionDAGISel.cpp:1067
llvm::SelectionDAGISel::CheckComplexPattern
virtual bool CheckComplexPattern(SDNode *Root, SDNode *Parent, SDValue N, unsigned PatternNo, SmallVectorImpl< std::pair< SDValue, SDNode * > > &Result)
Definition: SelectionDAGISel.h:287
llvm::SelectionDAGISel::OPC_RecordChild7
@ OPC_RecordChild7
Definition: SelectionDAGISel.h:119
llvm::SelectionDAGISel::PostprocessISelDAG
virtual void PostprocessISelDAG()
PostprocessISelDAG() - This hook allows the target to hack on the graph right after selection.
Definition: SelectionDAGISel.h:81
llvm::SelectionDAGISel::DAGSize
unsigned DAGSize
DAGSize - Size of DAG being instruction selected.
Definition: SelectionDAGISel.h:202
llvm::MachineRegisterInfo
MachineRegisterInfo - Keep track of information for virtual and physical registers,...
Definition: MachineRegisterInfo.h:52
llvm::SelectionDAGISel::OPC_EmitNode
@ OPC_EmitNode
Definition: SelectionDAGISel.h:163
llvm::Function
Definition: Function.h:61
llvm::SelectionDAGISel::emitFunctionEntryCode
virtual void emitFunctionEntryCode()
Definition: SelectionDAGISel.h:73
llvm::SelectionDAGISel::SelectInlineAsmMemoryOperands
void SelectInlineAsmMemoryOperands(std::vector< SDValue > &Ops, const SDLoc &DL)
SelectInlineAsmMemoryOperands - Calls to this are automatically generated by tblgen.
Definition: SelectionDAGISel.cpp:2093
llvm::SelectionDAGISel::OPC_CheckOrImm
@ OPC_CheckOrImm
Definition: SelectionDAGISel.h:146
llvm::SelectionDAGISel::OPC_RecordChild3
@ OPC_RecordChild3
Definition: SelectionDAGISel.h:118
llvm::SelectionDAGISel::OPC_EmitNode1
@ OPC_EmitNode1
Definition: SelectionDAGISel.h:165
llvm::SelectionDAGISel::OPC_CheckChild1Integer
@ OPC_CheckChild1Integer
Definition: SelectionDAGISel.h:141
llvm::SelectionDAGISel::OPC_CheckFoldableChainNode
@ OPC_CheckFoldableChainNode
Definition: SelectionDAGISel.h:149
llvm::MachineFunctionPass
MachineFunctionPass - This class adapts the FunctionPass interface to allow convenient creation of pa...
Definition: MachineFunctionPass.h:30
llvm::SelectionDAGISel::OPC_CheckChild1Same
@ OPC_CheckChild1Same
Definition: SelectionDAGISel.h:127
llvm::GCFunctionInfo
Garbage collection metadata for a single function.
Definition: GCMetadata.h:77
llvm::SDNode
Represents one node in the SelectionDAG.
Definition: SelectionDAGNodes.h:455
llvm::SelectionDAG::ReplaceAllUsesWith
void ReplaceAllUsesWith(SDValue From, SDValue To)
Modify anything using 'From' to use 'To' instead.
Definition: SelectionDAG.cpp:9423
llvm::SelectionDAGISel::OPC_MorphNodeTo2
@ OPC_MorphNodeTo2
Definition: SelectionDAGISel.h:168
llvm::SelectionDAGISel::OPC_MoveChild7
@ OPC_MoveChild7
Definition: SelectionDAGISel.h:124
llvm::SelectionDAGISel::CheckPatternPredicate
virtual bool CheckPatternPredicate(unsigned PredNo) const
CheckPatternPredicate - This function is generated by tblgen in the target.
Definition: SelectionDAGISel.h:264
llvm::SelectionDAGISel::OPC_CaptureGlueInput
@ OPC_CaptureGlueInput
Definition: SelectionDAGISel.h:121
llvm::SelectionDAGISel::OPC_EmitNodeXForm
@ OPC_EmitNodeXForm
Definition: SelectionDAGISel.h:162
llvm::SelectionDAGISel::OPFL_Variadic0
@ OPFL_Variadic0
Definition: SelectionDAGISel.h:180
llvm::SelectionDAGISel::OPC_CheckChild0Same
@ OPC_CheckChild0Same
Definition: SelectionDAGISel.h:127
llvm::SelectionDAGISel::OPFL_Variadic2
@ OPFL_Variadic2
Definition: SelectionDAGISel.h:182
llvm::SelectionDAGISel::OPFL_VariadicInfo
@ OPFL_VariadicInfo
Definition: SelectionDAGISel.h:188
T
#define T
Definition: Mips16ISelLowering.cpp:341
llvm::SelectionDAGISel::OPC_CheckPredicate
@ OPC_CheckPredicate
Definition: SelectionDAGISel.h:130
llvm::SmallPtrSet
SmallPtrSet - This class implements a set which is optimized for holding SmallSize or less elements.
Definition: SmallPtrSet.h:449
llvm::SelectionDAGISel::OPC_Coverage
@ OPC_Coverage
Definition: SelectionDAGISel.h:171
llvm::SelectionDAGISel::OPC_CheckAndImm
@ OPC_CheckAndImm
Definition: SelectionDAGISel.h:146
llvm::SelectionDAGISel::OPC_EmitCopyToReg
@ OPC_EmitCopyToReg
Definition: SelectionDAGISel.h:160
llvm::SelectionDAGISel::OPC_SwitchType
@ OPC_SwitchType
Definition: SelectionDAGISel.h:136
llvm::SelectionDAGISel::OPC_CheckChild0Type
@ OPC_CheckChild0Type
Definition: SelectionDAGISel.h:137
llvm::SelectionDAGISel::OPC_CheckCondCode
@ OPC_CheckCondCode
Definition: SelectionDAGISel.h:143
SelectionDAG.h
llvm::SelectionDAGISel::OPC_CheckChild7Type
@ OPC_CheckChild7Type
Definition: SelectionDAGISel.h:139
llvm::SelectionDAGISel::OPC_CheckChild1Type
@ OPC_CheckChild1Type
Definition: SelectionDAGISel.h:137
llvm::SelectionDAGISel::OPC_EmitStringInteger
@ OPC_EmitStringInteger
Definition: SelectionDAGISel.h:152
llvm::SelectionDAG::ReplaceAllUsesOfValuesWith
void ReplaceAllUsesOfValuesWith(const SDValue *From, const SDValue *To, unsigned Num)
Like ReplaceAllUsesOfValueWith, but for multiple values at once.
Definition: SelectionDAG.cpp:9717
F
#define F(x, y, z)
Definition: MD5.cpp:56
llvm::SelectionDAGISel::PreprocessISelDAG
virtual void PreprocessISelDAG()
PreprocessISelDAG - This hook allows targets to hack on the graph before instruction selection starts...
Definition: SelectionDAGISel.h:77
llvm::SelectionDAGISel::OPFL_Variadic4
@ OPFL_Variadic4
Definition: SelectionDAGISel.h:184
llvm::SelectionDAGISel::OPC_EmitMergeInputChains1_0
@ OPC_EmitMergeInputChains1_0
Definition: SelectionDAGISel.h:157
llvm::SelectionDAGISel::ElidedArgCopyInstrs
SmallPtrSet< const Instruction *, 4 > ElidedArgCopyInstrs
Definition: SelectionDAGISel.h:55
llvm::SelectionDAGISel::OPC_MoveChild5
@ OPC_MoveChild5
Definition: SelectionDAGISel.h:124
llvm::SelectionDAGISel::OPC_RecordChild6
@ OPC_RecordChild6
Definition: SelectionDAGISel.h:119
llvm::TargetInstrInfo
TargetInstrInfo - Interface to description of machine instruction set.
Definition: TargetInstrInfo.h:97
llvm::SelectionDAGISel::OPC_RecordChild1
@ OPC_RecordChild1
Definition: SelectionDAGISel.h:118
llvm::SelectionDAGISel::OPC_EmitNode0
@ OPC_EmitNode0
Definition: SelectionDAGISel.h:165
llvm::SelectionDAG
This is used to represent a portion of an LLVM function in a low-level Data Dependence DAG representa...
Definition: SelectionDAG.h:216
llvm::SelectionDAGISel::RunSDNodeXForm
virtual SDValue RunSDNodeXForm(SDValue V, unsigned XFormNo)
Definition: SelectionDAGISel.h:293
llvm::SelectionDAGISel::SDB
std::unique_ptr< SelectionDAGBuilder > SDB
Definition: SelectionDAGISel.h:48
llvm::SelectionDAGISel::OPC_CheckOpcode
@ OPC_CheckOpcode
Definition: SelectionDAGISel.h:132
llvm::AAResults
Definition: AliasAnalysis.h:456
llvm::SelectionDAGISel::OPC_CheckPatternPredicate
@ OPC_CheckPatternPredicate
Definition: SelectionDAGISel.h:129
llvm::SelectionDAGISel::ReplaceUses
void ReplaceUses(SDNode *F, SDNode *T)
ReplaceUses - replace all uses of the old node F with the use of the new node T.
Definition: SelectionDAGISel.h:221
llvm::SelectionDAGISel::OPC_MoveChild
@ OPC_MoveChild
Definition: SelectionDAGISel.h:122
llvm::SelectionDAGISel::RegInfo
MachineRegisterInfo * RegInfo
Definition: SelectionDAGISel.h:46
llvm::SelectionDAGISel::OptLevel
CodeGenOpt::Level OptLevel
Definition: SelectionDAGISel.h:51
llvm::SelectionDAGISel::OPFL_GlueInput
@ OPFL_GlueInput
Definition: SelectionDAGISel.h:177
llvm::SelectionDAGISel::CheckNodePredicate
virtual bool CheckNodePredicate(SDNode *N, unsigned PredNo) const
CheckNodePredicate - This function is generated by tblgen in the target.
Definition: SelectionDAGISel.h:272
llvm::SelectionDAGISel::OPFL_Variadic1
@ OPFL_Variadic1
Definition: SelectionDAGISel.h:181
llvm::TargetLowering
This class defines information used to lower LLVM code to legal SelectionDAG operators that the targe...
Definition: TargetLowering.h:3189
llvm::SelectionDAGISel::ComplexPatternFuncMutatesDAG
virtual bool ComplexPatternFuncMutatesDAG() const
Return true if complex patterns for this target can mutate the DAG.
Definition: SelectionDAGISel.h:302
llvm::SelectionDAGISel::OPFL_Chain
@ OPFL_Chain
Definition: SelectionDAGISel.h:176
llvm::AnalysisUsage
Represent the analysis usage information of a pass.
Definition: PassAnalysisSupport.h:47
llvm::SelectionDAGISel::ReplaceNode
void ReplaceNode(SDNode *F, SDNode *T)
Replace all uses of F with T, then remove F from the DAG.
Definition: SelectionDAGISel.h:227
llvm::SelectionDAGISel::ORE
std::unique_ptr< OptimizationRemarkEmitter > ORE
Current optimization remark emitter.
Definition: SelectionDAGISel.h:59
llvm::SelectionDAGISel::OPC_MorphNodeTo1
@ OPC_MorphNodeTo1
Definition: SelectionDAGISel.h:168
llvm::SelectionDAGISel::OPFL_Variadic6
@ OPFL_Variadic6
Definition: SelectionDAGISel.h:186
llvm::SelectionDAGISel::OPFL_None
@ OPFL_None
Definition: SelectionDAGISel.h:175
llvm::SelectionDAGISel::ID
static char ID
Definition: SelectionDAGISel.h:61
llvm::SelectionDAGISel::OPC_CheckSame
@ OPC_CheckSame
Definition: SelectionDAGISel.h:126
Operands
mir Rename Register Operands
Definition: MIRNamerPass.cpp:78
llvm::SelectionDAGISel::InvalidateNodeId
static void InvalidateNodeId(SDNode *N)
Definition: SelectionDAGISel.cpp:1086
BasicBlock.h
llvm::SelectionDAGISel::OPC_CheckChild4Integer
@ OPC_CheckChild4Integer
Definition: SelectionDAGISel.h:142
llvm::SelectionDAGISel::OPC_CheckValueType
@ OPC_CheckValueType
Definition: SelectionDAGISel.h:144
llvm::SelectionDAG::RemoveDeadNode
void RemoveDeadNode(SDNode *N)
Remove the specified node from the system.
Definition: SelectionDAG.cpp:884
llvm::SelectionDAGISel::OPC_CheckImmAllZerosV
@ OPC_CheckImmAllZerosV
Definition: SelectionDAGISel.h:148
llvm::SelectionDAGISel::OPFL_Variadic3
@ OPFL_Variadic3
Definition: SelectionDAGISel.h:183
llvm::CodeGenOpt::Default
@ Default
Definition: CodeGen.h:55
llvm::SelectionDAGISel::OPC_CheckInteger
@ OPC_CheckInteger
Definition: SelectionDAGISel.h:140
llvm::SelectionDAGISel::IsProfitableToFold
virtual bool IsProfitableToFold(SDValue N, SDNode *U, SDNode *Root) const
IsProfitableToFold - Returns true if it's profitable to fold the specific operand node N of U during ...
Definition: SelectionDAGISel.cpp:2206
index
splat index
Definition: README_ALTIVEC.txt:181
llvm::SelectionDAGISel::OPC_RecordMemRef
@ OPC_RecordMemRef
Definition: SelectionDAGISel.h:120
llvm::SelectionDAGISel::getAnalysisUsage
void getAnalysisUsage(AnalysisUsage &AU) const override
getAnalysisUsage - Subclasses that override getAnalysisUsage must call this.
Definition: SelectionDAGISel.cpp:334
llvm::SelectionDAGISel::TII
const TargetInstrInfo * TII
Definition: SelectionDAGISel.h:52
llvm::SelectionDAGISel::OPC_RecordChild0
@ OPC_RecordChild0
Definition: SelectionDAGISel.h:118
llvm::SelectionDAGISel::FuncInfo
std::unique_ptr< FunctionLoweringInfo > FuncInfo
Definition: SelectionDAGISel.h:43
llvm::SelectionDAGISel::IsLegalToFold
static bool IsLegalToFold(SDValue N, SDNode *U, SDNode *Root, CodeGenOpt::Level OptLevel, bool IgnoreChains=false)
IsLegalToFold - Returns true if the specific operand node N of U can be folded during instruction sel...
Definition: SelectionDAGISel.cpp:2214
llvm::SelectionDAGISel::mayRaiseFPException
bool mayRaiseFPException(SDNode *Node) const
Return whether the node may raise an FP exception.
Definition: SelectionDAGISel.cpp:3753
llvm::SelectionDAGISel::OPC_CheckChild2Same
@ OPC_CheckChild2Same
Definition: SelectionDAGISel.h:128
llvm::SelectionDAG::shouldOptForSize
bool shouldOptForSize() const
Definition: SelectionDAG.cpp:1194
llvm::SwiftErrorValueTracking
Definition: SwiftErrorValueTracking.h:36
llvm::SelectionDAGISel::OPC_CheckChild4Type
@ OPC_CheckChild4Type
Definition: SelectionDAGISel.h:138
llvm::SelectionDAGISel::getPatternForIndex
virtual StringRef getPatternForIndex(unsigned index)
getPatternForIndex - Patterns selected by tablegen during ISEL
Definition: SelectionDAGISel.h:239
MachineFunctionPass.h
llvm::SelectionDAGISel::OPC_CheckImmAllOnesV
@ OPC_CheckImmAllOnesV
Definition: SelectionDAGISel.h:147
llvm::SelectionDAGISel::OPC_SwitchOpcode
@ OPC_SwitchOpcode
Definition: SelectionDAGISel.h:133
llvm::SelectionDAGISel::OPC_CheckChild3Integer
@ OPC_CheckChild3Integer
Definition: SelectionDAGISel.h:142
llvm::SelectionDAGISel::CheckOrMask
bool CheckOrMask(SDValue LHS, ConstantSDNode *RHS, int64_t DesiredMaskS) const
CheckOrMask - The isel is trying to match something like (or X, 255).
Definition: SelectionDAGISel.cpp:2063
llvm::TargetMachine
Primary interface to the complete machine description for the target machine.
Definition: TargetMachine.h:79
llvm::SelectionDAGISel::OPFL_MemRefs
@ OPFL_MemRefs
Definition: SelectionDAGISel.h:179
llvm::SelectionDAGISel::~SelectionDAGISel
~SelectionDAGISel() override
Definition: SelectionDAGISel.cpp:329
llvm::SelectionDAGISel::OPC_EmitMergeInputChains
@ OPC_EmitMergeInputChains
Definition: SelectionDAGISel.h:156
llvm::SelectionDAGISel::CurDAG
SelectionDAG * CurDAG
Definition: SelectionDAGISel.h:47
llvm::SelectionDAGISel::getUninvalidatedNodeId
static int getUninvalidatedNodeId(SDNode *N)
Definition: SelectionDAGISel.cpp:1092
llvm::SelectionDAGISel::SelectionDAGISel
SelectionDAGISel(TargetMachine &tm, CodeGenOpt::Level OL=CodeGenOpt::Default)
Definition: SelectionDAGISel.cpp:315
llvm::SelectionDAGISel::OPC_CheckPredicateWithOperands
@ OPC_CheckPredicateWithOperands
Definition: SelectionDAGISel.h:131
llvm::MachineFunction
Definition: MachineFunction.h:230
llvm::SelectionDAGISel::CheckNodePredicateWithOperands
virtual bool CheckNodePredicateWithOperands(SDNode *N, unsigned PredNo, const SmallVectorImpl< SDValue > &Operands) const
CheckNodePredicateWithOperands - This function is generated by tblgen in the target.
Definition: SelectionDAGISel.h:281
llvm::ArrayRef
ArrayRef - Represent a constant reference to an array (0 or more elements consecutively in memory),...
Definition: APInt.h:32
llvm::SelectionDAGISel::OPC_CheckChild3Type
@ OPC_CheckChild3Type
Definition: SelectionDAGISel.h:138
llvm::StringRef
StringRef - Represent a constant reference to a string, i.e.
Definition: StringRef.h:58
llvm::SelectionDAGISel::SelectInlineAsmMemoryOperand
virtual bool SelectInlineAsmMemoryOperand(const SDValue &Op, unsigned ConstraintID, std::vector< SDValue > &OutOps)
SelectInlineAsmMemoryOperand - Select the specified address as a target addressing mode,...
Definition: SelectionDAGISel.h:91
llvm_unreachable
#define llvm_unreachable(msg)
Marks that the current location is not supposed to be reachable.
Definition: ErrorHandling.h:136
llvm::SelectionDAG::ReplaceAllUsesOfValueWith
void ReplaceAllUsesOfValueWith(SDValue From, SDValue To)
Replace any uses of From with To, leaving uses of other values produced by From.getNode() alone.
Definition: SelectionDAG.cpp:9577
TargetSubtargetInfo.h
DL
MachineBasicBlock MachineBasicBlock::iterator DebugLoc DL
Definition: AArch64SLSHardening.cpp:76
llvm::SelectionDAGISel::OPC_MoveChild3
@ OPC_MoveChild3
Definition: SelectionDAGISel.h:123
llvm::SelectionDAGISel::OPC_MoveChild6
@ OPC_MoveChild6
Definition: SelectionDAGISel.h:124
Node
Definition: ItaniumDemangle.h:234
llvm::CodeGenOpt::Level
Level
Definition: CodeGen.h:52
llvm::SelectionDAGISel::OPC_EmitNode2
@ OPC_EmitNode2
Definition: SelectionDAGISel.h:165
llvm::SDVTList
This represents a list of ValueType's that has been intern'd by a SelectionDAG.
Definition: SelectionDAGNodes.h:79
llvm::SelectionDAGISel::SwiftError
SwiftErrorValueTracking * SwiftError
Definition: SelectionDAGISel.h:44
llvm::SelectionDAGISel::OPC_CheckChild3Same
@ OPC_CheckChild3Same
Definition: SelectionDAGISel.h:128
llvm::SelectionDAGISel::ReplaceUses
void ReplaceUses(const SDValue *F, const SDValue *T, unsigned Num)
ReplaceUses - replace all uses of the old nodes F with the use of the new nodes T.
Definition: SelectionDAGISel.h:213
llvm::SelectionDAGISel::BuiltinOpcodes
BuiltinOpcodes
Definition: SelectionDAGISel.h:115
llvm::SelectionDAGISel::OPFL_GlueOutput
@ OPFL_GlueOutput
Definition: SelectionDAGISel.h:178
llvm::SelectionDAGISel::MF
MachineFunction * MF
Definition: SelectionDAGISel.h:45
llvm::SelectionDAGISel::shouldOptForSize
bool shouldOptForSize(const MachineFunction *MF) const
Definition: SelectionDAGISel.h:248
llvm::SelectionDAGISel::AA
AAResults * AA
Definition: SelectionDAGISel.h:49
llvm::SelectionDAGISel::OPC_EmitMergeInputChains1_1
@ OPC_EmitMergeInputChains1_1
Definition: SelectionDAGISel.h:158
llvm::SelectionDAGISel::OPC_RecordChild2
@ OPC_RecordChild2
Definition: SelectionDAGISel.h:118
llvm::AMDGPU::SendMsg::Op
Op
Definition: SIDefines.h:321
llvm::SelectionDAGISel::getNumFixedFromVariadicInfo
static int getNumFixedFromVariadicInfo(unsigned Flags)
getNumFixedFromVariadicInfo - Transform an EmitNode flags word into the number of fixed arity values ...
Definition: SelectionDAGISel.h:194
llvm::SelectionDAGISel::ReplaceUses
void ReplaceUses(SDValue F, SDValue T)
ReplaceUses - replace all uses of the old node F with the use of the new node T.
Definition: SelectionDAGISel.h:206
llvm::SelectionDAGISel::OPC_CompleteMatch
@ OPC_CompleteMatch
Definition: SelectionDAGISel.h:169
llvm::SelectionDAGISel::OPC_CheckChild6Type
@ OPC_CheckChild6Type
Definition: SelectionDAGISel.h:139
llvm::TargetLibraryInfo
Provides information about what library functions are available for the current target.
Definition: TargetLibraryInfo.h:219
llvm::SDValue
Unlike LLVM values, Selection DAG nodes may return multiple values as the result of a computation.
Definition: SelectionDAGNodes.h:138
llvm::SelectionDAGISel::GFI
GCFunctionInfo * GFI
Definition: SelectionDAGISel.h:50
llvm::SelectionDAGISel::OPC_EmitRegister2
@ OPC_EmitRegister2
Definition: SelectionDAGISel.h:154
llvm::SelectionDAGISel::OPC_CheckChild2Type
@ OPC_CheckChild2Type
Definition: SelectionDAGISel.h:137
llvm::SelectionDAGISel::OPFL_Variadic5
@ OPFL_Variadic5
Definition: SelectionDAGISel.h:185
llvm::SelectionDAGISel::OPC_EmitConvertToTarget
@ OPC_EmitConvertToTarget
Definition: SelectionDAGISel.h:155
llvm::SelectionDAGISel::OPC_MoveChild0
@ OPC_MoveChild0
Definition: SelectionDAGISel.h:123
llvm::SelectionDAGISel::LibInfo
const TargetLibraryInfo * LibInfo
Definition: SelectionDAGISel.h:42
llvm::SelectionDAGISel
SelectionDAGISel - This is the common base class used for SelectionDAG-based pattern-matching instruc...
Definition: SelectionDAGISel.h:39
llvm::SelectionDAGISel::OPC_CheckChild2CondCode
@ OPC_CheckChild2CondCode
Definition: SelectionDAGISel.h:143
llvm::SelectionDAGISel::OPC_RecordNode
@ OPC_RecordNode
Definition: SelectionDAGISel.h:117
N
#define N
llvm::SelectionDAGISel::OPC_MorphNodeTo
@ OPC_MorphNodeTo
Definition: SelectionDAGISel.h:166
llvm::SelectionDAGISel::OPC_CheckTypeRes
@ OPC_CheckTypeRes
Definition: SelectionDAGISel.h:135
llvm::SelectionDAGISel::OPC_MoveParent
@ OPC_MoveParent
Definition: SelectionDAGISel.h:125
llvm::SmallVectorImpl
This class consists of common code factored out of the SmallVector class to reduce code duplication b...
Definition: APFloat.h:43
llvm::SelectionDAGISel::SelectCodeCommon
void SelectCodeCommon(SDNode *NodeToMatch, const unsigned char *MatcherTable, unsigned TableSize)
Definition: SelectionDAGISel.cpp:2841
llvm::SelectionDAGISel::OPC_MorphNodeTo0
@ OPC_MorphNodeTo0
Definition: SelectionDAGISel.h:168
llvm::SelectionDAGISel::OPC_CheckChild5Type
@ OPC_CheckChild5Type
Definition: SelectionDAGISel.h:138
llvm::SelectionDAGISel::OPC_RecordChild4
@ OPC_RecordChild4
Definition: SelectionDAGISel.h:119
llvm::SelectionDAGISel::Select
virtual void Select(SDNode *N)=0
Main hook for targets to transform nodes into machine nodes.
llvm::SelectionDAGISel::OPC_RecordChild5
@ OPC_RecordChild5
Definition: SelectionDAGISel.h:119
llvm::SelectionDAGISel::runOnMachineFunction
bool runOnMachineFunction(MachineFunction &MF) override
runOnMachineFunction - This method must be overloaded to perform the desired machine code transformat...
Definition: SelectionDAGISel.cpp:415
llvm::SelectionDAGISel::OPC_CheckType
@ OPC_CheckType
Definition: SelectionDAGISel.h:134
llvm::SelectionDAGISel::CheckAndMask
bool CheckAndMask(SDValue LHS, ConstantSDNode *RHS, int64_t DesiredMaskS) const
CheckAndMask - The isel is trying to match something like (and X, 255).
Definition: SelectionDAGISel.cpp:2034
llvm::SelectionDAGISel::OPC_MoveChild1
@ OPC_MoveChild1
Definition: SelectionDAGISel.h:123
llvm::SelectionDAGISel::OPC_MoveChild4
@ OPC_MoveChild4
Definition: SelectionDAGISel.h:124
llvm::SelectionDAGISel::OPC_EmitRegister
@ OPC_EmitRegister
Definition: SelectionDAGISel.h:153
llvm::SelectionDAGISel::OPC_CheckChild0Integer
@ OPC_CheckChild0Integer
Definition: SelectionDAGISel.h:141
llvm::SelectionDAGISel::OPC_Scope
@ OPC_Scope
Definition: SelectionDAGISel.h:116
llvm::BasicBlock::const_iterator
InstListType::const_iterator const_iterator
Definition: BasicBlock.h:91
llvm::SelectionDAGISel::OPC_EmitCopyToReg2
@ OPC_EmitCopyToReg2
Definition: SelectionDAGISel.h:161