LLVM  4.0.0
MachineFunction.h
Go to the documentation of this file.
1 //===-- llvm/CodeGen/MachineFunction.h --------------------------*- C++ -*-===//
2 //
3 // The LLVM Compiler Infrastructure
4 //
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
7 //
8 //===----------------------------------------------------------------------===//
9 //
10 // Collect native machine code for a function. This class contains a list of
11 // MachineBasicBlock instances that make up the current compiled function.
12 //
13 // This class also contains pointers to various classes which hold
14 // target-specific information about the generated code.
15 //
16 //===----------------------------------------------------------------------===//
17 
18 #ifndef LLVM_CODEGEN_MACHINEFUNCTION_H
19 #define LLVM_CODEGEN_MACHINEFUNCTION_H
20 
21 #include "llvm/ADT/BitVector.h"
22 #include "llvm/ADT/ilist.h"
23 #include "llvm/ADT/Optional.h"
27 #include "llvm/IR/DebugLoc.h"
28 #include "llvm/IR/Metadata.h"
29 #include "llvm/MC/MCDwarf.h"
30 #include "llvm/MC/MCSymbol.h"
31 #include "llvm/Support/Allocator.h"
33 #include "llvm/Support/Compiler.h"
34 #include "llvm/Support/Recycler.h"
35 
36 namespace llvm {
37 
38 class Value;
39 class Function;
40 class GCModuleInfo;
41 class MachineRegisterInfo;
42 class MachineFrameInfo;
43 class MachineConstantPool;
44 class MachineJumpTableInfo;
45 class MachineModuleInfo;
46 class MCContext;
47 class Pass;
48 class PseudoSourceValueManager;
49 class TargetMachine;
50 class TargetSubtargetInfo;
51 class TargetRegisterClass;
52 struct MachinePointerInfo;
53 struct WinEHFuncInfo;
54 
57 };
58 
62 
63  template <class Iterator>
64  void transferNodesFromList(ilist_callback_traits &OldList, Iterator, Iterator) {
65  llvm_unreachable("Never transfer between lists");
66  }
67 };
68 
69 /// MachineFunctionInfo - This class can be derived from and used by targets to
70 /// hold private target-specific information for each MachineFunction. Objects
71 /// of type are accessed/created with MF::getInfo and destroyed when the
72 /// MachineFunction is destroyed.
74  virtual ~MachineFunctionInfo();
75 
76  /// \brief Factory function: default behavior is to call new using the
77  /// supplied allocator.
78  ///
79  /// This function can be overridden in a derive class.
80  template<typename Ty>
82  return new (Allocator.Allocate<Ty>()) Ty(MF);
83  }
84 };
85 
86 /// Properties which a MachineFunction may have at a given point in time.
87 /// Each of these has checking code in the MachineVerifier, and passes can
88 /// require that a property be set.
90  // Possible TODO: Allow targets to extend this (perhaps by allowing the
91  // constructor to specify the size of the bit vector)
92  // Possible TODO: Allow requiring the negative (e.g. VRegsAllocated could be
93  // stated as the negative of "has vregs"
94 
95 public:
96  // The properties are stated in "positive" form; i.e. a pass could require
97  // that the property hold, but not that it does not hold.
98 
99  // Property descriptions:
100  // IsSSA: True when the machine function is in SSA form and virtual registers
101  // have a single def.
102  // NoPHIs: The machine function does not contain any PHI instruction.
103  // TracksLiveness: True when tracking register liveness accurately.
104  // While this property is set, register liveness information in basic block
105  // live-in lists and machine instruction operands (e.g. kill flags, implicit
106  // defs) is accurate. This means it can be used to change the code in ways
107  // that affect the values in registers, for example by the register
108  // scavenger.
109  // When this property is clear, liveness is no longer reliable.
110  // NoVRegs: The machine function does not use any virtual registers.
111  // Legalized: In GlobalISel: the MachineLegalizer ran and all pre-isel generic
112  // instructions have been legalized; i.e., all instructions are now one of:
113  // - generic and always legal (e.g., COPY)
114  // - target-specific
115  // - legal pre-isel generic instructions.
116  // RegBankSelected: In GlobalISel: the RegBankSelect pass ran and all generic
117  // virtual registers have been assigned to a register bank.
118  // Selected: In GlobalISel: the InstructionSelect pass ran and all pre-isel
119  // generic instructions have been eliminated; i.e., all instructions are now
120  // target-specific or non-pre-isel generic instructions (e.g., COPY).
121  // Since only pre-isel generic instructions can have generic virtual register
122  // operands, this also means that all generic virtual registers have been
123  // constrained to virtual registers (assigned to register classes) and that
124  // all sizes attached to them have been eliminated.
125  enum class Property : unsigned {
126  IsSSA,
127  NoPHIs,
129  NoVRegs,
130  FailedISel,
131  Legalized,
133  Selected,
135  };
136 
137  bool hasProperty(Property P) const {
138  return Properties[static_cast<unsigned>(P)];
139  }
141  Properties.set(static_cast<unsigned>(P));
142  return *this;
143  }
145  Properties.reset(static_cast<unsigned>(P));
146  return *this;
147  }
148  /// Reset all the properties.
150  Properties.reset();
151  return *this;
152  }
154  Properties |= MFP.Properties;
155  return *this;
156  }
158  Properties.reset(MFP.Properties);
159  return *this;
160  }
161  // Returns true if all properties set in V (i.e. required by a pass) are set
162  // in this.
164  return !V.Properties.test(Properties);
165  }
166 
167  /// Print the MachineFunctionProperties in human-readable form.
168  void print(raw_ostream &OS) const;
169 
170 private:
171  BitVector Properties =
172  BitVector(static_cast<unsigned>(Property::LastProperty)+1);
173 };
174 
175 struct SEHHandler {
176  /// Filter or finally function. Null indicates a catch-all.
178 
179  /// Address of block to recover at. Null for a finally handler.
181 };
182 
183 
184 /// This structure is used to retain landing pad info for the current function.
186  MachineBasicBlock *LandingPadBlock; // Landing pad block.
187  SmallVector<MCSymbol *, 1> BeginLabels; // Labels prior to invoke.
188  SmallVector<MCSymbol *, 1> EndLabels; // Labels after invoke.
189  SmallVector<SEHHandler, 1> SEHHandlers; // SEH handlers active at this lpad.
190  MCSymbol *LandingPadLabel; // Label at beginning of landing pad.
191  std::vector<int> TypeIds; // List of type ids (filters negative).
192 
194  : LandingPadBlock(MBB), LandingPadLabel(nullptr) {}
195 };
196 
198  const Function *Fn;
199  const TargetMachine &Target;
200  const TargetSubtargetInfo *STI;
201  MCContext &Ctx;
202  MachineModuleInfo &MMI;
203 
204  // RegInfo - Information about each register in use in the function.
205  MachineRegisterInfo *RegInfo;
206 
207  // Used to keep track of target-specific per-machine function information for
208  // the target implementation.
209  MachineFunctionInfo *MFInfo;
210 
211  // Keep track of objects allocated on the stack.
212  MachineFrameInfo *FrameInfo;
213 
214  // Keep track of constants which are spilled to memory
216 
217  // Keep track of jump tables for switch instructions
218  MachineJumpTableInfo *JumpTableInfo;
219 
220  // Keeps track of Windows exception handling related data. This will be null
221  // for functions that aren't using a funclet-based EH personality.
222  WinEHFuncInfo *WinEHInfo = nullptr;
223 
224  // Function-level unique numbering for MachineBasicBlocks. When a
225  // MachineBasicBlock is inserted into a MachineFunction is it automatically
226  // numbered and this vector keeps track of the mapping from ID's to MBB's.
227  std::vector<MachineBasicBlock*> MBBNumbering;
228 
229  // Pool-allocate MachineFunction-lifetime and IR objects.
230  BumpPtrAllocator Allocator;
231 
232  // Allocation management for instructions in function.
233  Recycler<MachineInstr> InstructionRecycler;
234 
235  // Allocation management for operand arrays on instructions.
236  ArrayRecycler<MachineOperand> OperandRecycler;
237 
238  // Allocation management for basic blocks in function.
239  Recycler<MachineBasicBlock> BasicBlockRecycler;
240 
241  // List of machine basic blocks in function
243  BasicBlockListType BasicBlocks;
244 
245  /// FunctionNumber - This provides a unique ID for each function emitted in
246  /// this translation unit.
247  ///
248  unsigned FunctionNumber;
249 
250  /// Alignment - The alignment of the function.
251  unsigned Alignment;
252 
253  /// ExposesReturnsTwice - True if the function calls setjmp or related
254  /// functions with attribute "returns twice", but doesn't have
255  /// the attribute itself.
256  /// This is used to limit optimizations which cannot reason
257  /// about the control flow of such functions.
258  bool ExposesReturnsTwice = false;
259 
260  /// True if the function includes any inline assembly.
261  bool HasInlineAsm = false;
262 
263  /// True if any WinCFI instruction have been emitted in this function.
264  Optional<bool> HasWinCFI;
265 
266  /// Current high-level properties of the IR of the function (e.g. is in SSA
267  /// form or whether registers have been allocated)
268  MachineFunctionProperties Properties;
269 
270  // Allocation management for pseudo source values.
271  std::unique_ptr<PseudoSourceValueManager> PSVManager;
272 
273  /// List of moves done by a function's prolog. Used to construct frame maps
274  /// by debug and exception handling consumers.
275  std::vector<MCCFIInstruction> FrameInstructions;
276 
277  /// \name Exception Handling
278  /// \{
279 
280  /// List of LandingPadInfo describing the landing pad information.
281  std::vector<LandingPadInfo> LandingPads;
282 
283  /// Map a landing pad's EH symbol to the call site indexes.
285 
286  /// Map of invoke call site index values to associated begin EH_LABEL.
287  DenseMap<MCSymbol*, unsigned> CallSiteMap;
288 
289  bool CallsEHReturn = false;
290  bool CallsUnwindInit = false;
291  bool HasEHFunclets = false;
292 
293  /// List of C++ TypeInfo used.
294  std::vector<const GlobalValue *> TypeInfos;
295 
296  /// List of typeids encoding filters used.
297  std::vector<unsigned> FilterIds;
298 
299  /// List of the indices in FilterIds corresponding to filter terminators.
300  std::vector<unsigned> FilterEnds;
301 
302  EHPersonality PersonalityTypeCache = EHPersonality::Unknown;
303 
304  /// \}
305 
306  MachineFunction(const MachineFunction &) = delete;
307  void operator=(const MachineFunction&) = delete;
308 
309  /// Clear all the members of this MachineFunction, but the ones used
310  /// to initialize again the MachineFunction.
311  /// More specifically, this deallocates all the dynamically allocated
312  /// objects and get rid of all the XXXInfo data structure, but keep
313  /// unchanged the references to Fn, Target, MMI, and FunctionNumber.
314  void clear();
315  /// Allocate and initialize the different members.
316  /// In particular, the XXXInfo data structure.
317  /// \pre Fn, Target, MMI, and FunctionNumber are properly set.
318  void init();
319 public:
320 
324  unsigned Slot;
325  const DILocation *Loc;
326 
328  unsigned Slot, const DILocation *Loc)
329  : Var(Var), Expr(Expr), Slot(Slot), Loc(Loc) {}
330  };
333 
334  MachineFunction(const Function *Fn, const TargetMachine &TM,
335  unsigned FunctionNum, MachineModuleInfo &MMI);
337 
338  /// Reset the instance as if it was just created.
339  void reset() {
340  clear();
341  init();
342  }
343 
344  MachineModuleInfo &getMMI() const { return MMI; }
345  MCContext &getContext() const { return Ctx; }
346 
347  PseudoSourceValueManager &getPSVManager() const { return *PSVManager; }
348 
349  /// Return the DataLayout attached to the Module associated to this MF.
350  const DataLayout &getDataLayout() const;
351 
352  /// getFunction - Return the LLVM function that this machine code represents
353  ///
354  const Function *getFunction() const { return Fn; }
355 
356  /// getName - Return the name of the corresponding LLVM function.
357  ///
358  StringRef getName() const;
359 
360  /// getFunctionNumber - Return a unique ID for the current function.
361  ///
362  unsigned getFunctionNumber() const { return FunctionNumber; }
363 
364  /// getTarget - Return the target machine this machine code is compiled with
365  ///
366  const TargetMachine &getTarget() const { return Target; }
367 
368  /// getSubtarget - Return the subtarget for which this machine code is being
369  /// compiled.
370  const TargetSubtargetInfo &getSubtarget() const { return *STI; }
371  void setSubtarget(const TargetSubtargetInfo *ST) { STI = ST; }
372 
373  /// getSubtarget - This method returns a pointer to the specified type of
374  /// TargetSubtargetInfo. In debug builds, it verifies that the object being
375  /// returned is of the correct type.
376  template<typename STC> const STC &getSubtarget() const {
377  return *static_cast<const STC *>(STI);
378  }
379 
380  /// getRegInfo - Return information about the registers currently in use.
381  ///
382  MachineRegisterInfo &getRegInfo() { return *RegInfo; }
383  const MachineRegisterInfo &getRegInfo() const { return *RegInfo; }
384 
385  /// getFrameInfo - Return the frame info object for the current function.
386  /// This object contains information about objects allocated on the stack
387  /// frame of the current function in an abstract way.
388  ///
389  MachineFrameInfo &getFrameInfo() { return *FrameInfo; }
390  const MachineFrameInfo &getFrameInfo() const { return *FrameInfo; }
391 
392  /// getJumpTableInfo - Return the jump table info object for the current
393  /// function. This object contains information about jump tables in the
394  /// current function. If the current function has no jump tables, this will
395  /// return null.
396  const MachineJumpTableInfo *getJumpTableInfo() const { return JumpTableInfo; }
397  MachineJumpTableInfo *getJumpTableInfo() { return JumpTableInfo; }
398 
399  /// getOrCreateJumpTableInfo - Get the JumpTableInfo for this function, if it
400  /// does already exist, allocate one.
401  MachineJumpTableInfo *getOrCreateJumpTableInfo(unsigned JTEntryKind);
402 
403  /// getConstantPool - Return the constant pool object for the current
404  /// function.
405  ///
408 
409  /// getWinEHFuncInfo - Return information about how the current function uses
410  /// Windows exception handling. Returns null for functions that don't use
411  /// funclets for exception handling.
412  const WinEHFuncInfo *getWinEHFuncInfo() const { return WinEHInfo; }
413  WinEHFuncInfo *getWinEHFuncInfo() { return WinEHInfo; }
414 
415  /// getAlignment - Return the alignment (log2, not bytes) of the function.
416  ///
417  unsigned getAlignment() const { return Alignment; }
418 
419  /// setAlignment - Set the alignment (log2, not bytes) of the function.
420  ///
421  void setAlignment(unsigned A) { Alignment = A; }
422 
423  /// ensureAlignment - Make sure the function is at least 1 << A bytes aligned.
424  void ensureAlignment(unsigned A) {
425  if (Alignment < A) Alignment = A;
426  }
427 
428  /// exposesReturnsTwice - Returns true if the function calls setjmp or
429  /// any other similar functions with attribute "returns twice" without
430  /// having the attribute itself.
431  bool exposesReturnsTwice() const {
432  return ExposesReturnsTwice;
433  }
434 
435  /// setCallsSetJmp - Set a flag that indicates if there's a call to
436  /// a "returns twice" function.
438  ExposesReturnsTwice = B;
439  }
440 
441  /// Returns true if the function contains any inline assembly.
442  bool hasInlineAsm() const {
443  return HasInlineAsm;
444  }
445 
446  /// Set a flag that indicates that the function contains inline assembly.
447  void setHasInlineAsm(bool B) {
448  HasInlineAsm = B;
449  }
450 
451  bool hasWinCFI() const {
452  assert(HasWinCFI.hasValue() && "HasWinCFI not set yet!");
453  return *HasWinCFI;
454  }
455  void setHasWinCFI(bool v) { HasWinCFI = v; }
456 
457  /// Get the function properties
458  const MachineFunctionProperties &getProperties() const { return Properties; }
459  MachineFunctionProperties &getProperties() { return Properties; }
460 
461  /// getInfo - Keep track of various per-function pieces of information for
462  /// backends that would like to do so.
463  ///
464  template<typename Ty>
465  Ty *getInfo() {
466  if (!MFInfo)
467  MFInfo = Ty::template create<Ty>(Allocator, *this);
468  return static_cast<Ty*>(MFInfo);
469  }
470 
471  template<typename Ty>
472  const Ty *getInfo() const {
473  return const_cast<MachineFunction*>(this)->getInfo<Ty>();
474  }
475 
476  /// getBlockNumbered - MachineBasicBlocks are automatically numbered when they
477  /// are inserted into the machine function. The block number for a machine
478  /// basic block can be found by using the MBB::getBlockNumber method, this
479  /// method provides the inverse mapping.
480  ///
482  assert(N < MBBNumbering.size() && "Illegal block number");
483  assert(MBBNumbering[N] && "Block was removed from the machine function!");
484  return MBBNumbering[N];
485  }
486 
487  /// Should we be emitting segmented stack stuff for the function
488  bool shouldSplitStack() const;
489 
490  /// getNumBlockIDs - Return the number of MBB ID's allocated.
491  ///
492  unsigned getNumBlockIDs() const { return (unsigned)MBBNumbering.size(); }
493 
494  /// RenumberBlocks - This discards all of the MachineBasicBlock numbers and
495  /// recomputes them. This guarantees that the MBB numbers are sequential,
496  /// dense, and match the ordering of the blocks within the function. If a
497  /// specific MachineBasicBlock is specified, only that block and those after
498  /// it are renumbered.
499  void RenumberBlocks(MachineBasicBlock *MBBFrom = nullptr);
500 
501  /// print - Print out the MachineFunction in a format suitable for debugging
502  /// to the specified stream.
503  ///
504  void print(raw_ostream &OS, const SlotIndexes* = nullptr) const;
505 
506  /// viewCFG - This function is meant for use from the debugger. You can just
507  /// say 'call F->viewCFG()' and a ghostview window should pop up from the
508  /// program, displaying the CFG of the current function with the code for each
509  /// basic block inside. This depends on there being a 'dot' and 'gv' program
510  /// in your path.
511  ///
512  void viewCFG() const;
513 
514  /// viewCFGOnly - This function is meant for use from the debugger. It works
515  /// just like viewCFG, but it does not include the contents of basic blocks
516  /// into the nodes, just the label. If you are only interested in the CFG
517  /// this can make the graph smaller.
518  ///
519  void viewCFGOnly() const;
520 
521  /// dump - Print the current MachineFunction to cerr, useful for debugger use.
522  ///
523  void dump() const;
524 
525  /// Run the current MachineFunction through the machine code verifier, useful
526  /// for debugger use.
527  /// \returns true if no problems were found.
528  bool verify(Pass *p = nullptr, const char *Banner = nullptr,
529  bool AbortOnError = true) const;
530 
531  // Provide accessors for the MachineBasicBlock list...
536 
537  /// Support for MachineBasicBlock::getNextNode().
540  return &MachineFunction::BasicBlocks;
541  }
542 
543  /// addLiveIn - Add the specified physical register as a live-in value and
544  /// create a corresponding virtual register for it.
545  unsigned addLiveIn(unsigned PReg, const TargetRegisterClass *RC);
546 
547  //===--------------------------------------------------------------------===//
548  // BasicBlock accessor functions.
549  //
550  iterator begin() { return BasicBlocks.begin(); }
551  const_iterator begin() const { return BasicBlocks.begin(); }
552  iterator end () { return BasicBlocks.end(); }
553  const_iterator end () const { return BasicBlocks.end(); }
554 
555  reverse_iterator rbegin() { return BasicBlocks.rbegin(); }
556  const_reverse_iterator rbegin() const { return BasicBlocks.rbegin(); }
557  reverse_iterator rend () { return BasicBlocks.rend(); }
558  const_reverse_iterator rend () const { return BasicBlocks.rend(); }
559 
560  unsigned size() const { return (unsigned)BasicBlocks.size();}
561  bool empty() const { return BasicBlocks.empty(); }
562  const MachineBasicBlock &front() const { return BasicBlocks.front(); }
563  MachineBasicBlock &front() { return BasicBlocks.front(); }
564  const MachineBasicBlock & back() const { return BasicBlocks.back(); }
565  MachineBasicBlock & back() { return BasicBlocks.back(); }
566 
567  void push_back (MachineBasicBlock *MBB) { BasicBlocks.push_back (MBB); }
568  void push_front(MachineBasicBlock *MBB) { BasicBlocks.push_front(MBB); }
570  BasicBlocks.insert(MBBI, MBB);
571  }
572  void splice(iterator InsertPt, iterator MBBI) {
573  BasicBlocks.splice(InsertPt, BasicBlocks, MBBI);
574  }
576  BasicBlocks.splice(InsertPt, BasicBlocks, MBB);
577  }
578  void splice(iterator InsertPt, iterator MBBI, iterator MBBE) {
579  BasicBlocks.splice(InsertPt, BasicBlocks, MBBI, MBBE);
580  }
581 
582  void remove(iterator MBBI) { BasicBlocks.remove(MBBI); }
583  void remove(MachineBasicBlock *MBBI) { BasicBlocks.remove(MBBI); }
584  void erase(iterator MBBI) { BasicBlocks.erase(MBBI); }
585  void erase(MachineBasicBlock *MBBI) { BasicBlocks.erase(MBBI); }
586 
587  template <typename Comp>
588  void sort(Comp comp) {
589  BasicBlocks.sort(comp);
590  }
591 
592  //===--------------------------------------------------------------------===//
593  // Internal functions used to automatically number MachineBasicBlocks
594  //
595 
596  /// \brief Adds the MBB to the internal numbering. Returns the unique number
597  /// assigned to the MBB.
598  ///
600  MBBNumbering.push_back(MBB);
601  return (unsigned)MBBNumbering.size()-1;
602  }
603 
604  /// removeFromMBBNumbering - Remove the specific machine basic block from our
605  /// tracker, this is only really to be used by the MachineBasicBlock
606  /// implementation.
607  void removeFromMBBNumbering(unsigned N) {
608  assert(N < MBBNumbering.size() && "Illegal basic block #");
609  MBBNumbering[N] = nullptr;
610  }
611 
612  /// CreateMachineInstr - Allocate a new MachineInstr. Use this instead
613  /// of `new MachineInstr'.
614  ///
615  MachineInstr *CreateMachineInstr(const MCInstrDesc &MCID, const DebugLoc &DL,
616  bool NoImp = false);
617 
618  /// CloneMachineInstr - Create a new MachineInstr which is a copy of the
619  /// 'Orig' instruction, identical in all ways except the instruction
620  /// has no parent, prev, or next.
621  ///
622  /// See also TargetInstrInfo::duplicate() for target-specific fixes to cloned
623  /// instructions.
625 
626  /// DeleteMachineInstr - Delete the given MachineInstr.
627  ///
629 
630  /// CreateMachineBasicBlock - Allocate a new MachineBasicBlock. Use this
631  /// instead of `new MachineBasicBlock'.
632  ///
634 
635  /// DeleteMachineBasicBlock - Delete the given MachineBasicBlock.
636  ///
638 
639  /// getMachineMemOperand - Allocate a new MachineMemOperand.
640  /// MachineMemOperands are owned by the MachineFunction and need not be
641  /// explicitly deallocated.
643  MachinePointerInfo PtrInfo, MachineMemOperand::Flags f, uint64_t s,
644  unsigned base_alignment, const AAMDNodes &AAInfo = AAMDNodes(),
645  const MDNode *Ranges = nullptr,
646  SynchronizationScope SynchScope = CrossThread,
648  AtomicOrdering FailureOrdering = AtomicOrdering::NotAtomic);
649 
650  /// getMachineMemOperand - Allocate a new MachineMemOperand by copying
651  /// an existing one, adjusting by an offset and using the given size.
652  /// MachineMemOperands are owned by the MachineFunction and need not be
653  /// explicitly deallocated.
655  int64_t Offset, uint64_t Size);
656 
658 
659  /// Allocate an array of MachineOperands. This is only intended for use by
660  /// internal MachineInstr functions.
662  return OperandRecycler.allocate(Cap, Allocator);
663  }
664 
665  /// Dellocate an array of MachineOperands and recycle the memory. This is
666  /// only intended for use by internal MachineInstr functions.
667  /// Cap must be the same capacity that was used to allocate the array.
669  OperandRecycler.deallocate(Cap, Array);
670  }
671 
672  /// \brief Allocate and initialize a register mask with @p NumRegister bits.
673  uint32_t *allocateRegisterMask(unsigned NumRegister) {
674  unsigned Size = (NumRegister + 31) / 32;
675  uint32_t *Mask = Allocator.Allocate<uint32_t>(Size);
676  for (unsigned i = 0; i != Size; ++i)
677  Mask[i] = 0;
678  return Mask;
679  }
680 
681  /// allocateMemRefsArray - Allocate an array to hold MachineMemOperand
682  /// pointers. This array is owned by the MachineFunction.
684 
685  /// extractLoadMemRefs - Allocate an array and populate it with just the
686  /// load information from the given MachineMemOperand sequence.
687  std::pair<MachineInstr::mmo_iterator,
691 
692  /// extractStoreMemRefs - Allocate an array and populate it with just the
693  /// store information from the given MachineMemOperand sequence.
694  std::pair<MachineInstr::mmo_iterator,
698 
699  /// Allocate a string and populate it with the given external symbol name.
701 
702  //===--------------------------------------------------------------------===//
703  // Label Manipulation.
704  //
705 
706  /// getJTISymbol - Return the MCSymbol for the specified non-empty jump table.
707  /// If isLinkerPrivate is specified, an 'l' label is returned, otherwise a
708  /// normal 'L' label is returned.
709  MCSymbol *getJTISymbol(unsigned JTI, MCContext &Ctx,
710  bool isLinkerPrivate = false) const;
711 
712  /// getPICBaseSymbol - Return a function-local symbol to represent the PIC
713  /// base.
714  MCSymbol *getPICBaseSymbol() const;
715 
716  /// Returns a reference to a list of cfi instructions in the function's
717  /// prologue. Used to construct frame maps for debug and exception handling
718  /// comsumers.
719  const std::vector<MCCFIInstruction> &getFrameInstructions() const {
720  return FrameInstructions;
721  }
722 
724  FrameInstructions.push_back(Inst);
725  return FrameInstructions.size() - 1;
726  }
727 
728  /// \name Exception Handling
729  /// \{
730 
731  bool callsEHReturn() const { return CallsEHReturn; }
732  void setCallsEHReturn(bool b) { CallsEHReturn = b; }
733 
734  bool callsUnwindInit() const { return CallsUnwindInit; }
735  void setCallsUnwindInit(bool b) { CallsUnwindInit = b; }
736 
737  bool hasEHFunclets() const { return HasEHFunclets; }
738  void setHasEHFunclets(bool V) { HasEHFunclets = V; }
739 
740  /// Find or create an LandingPadInfo for the specified MachineBasicBlock.
742 
743  /// Remap landing pad labels and remove any deleted landing pads.
744  void tidyLandingPads(DenseMap<MCSymbol*, uintptr_t> *LPMap = nullptr);
745 
746  /// Return a reference to the landing pad info for the current function.
747  const std::vector<LandingPadInfo> &getLandingPads() const {
748  return LandingPads;
749  }
750 
751  /// Provide the begin and end labels of an invoke style call and associate it
752  /// with a try landing pad block.
753  void addInvoke(MachineBasicBlock *LandingPad,
754  MCSymbol *BeginLabel, MCSymbol *EndLabel);
755 
756  /// Add a new panding pad. Returns the label ID for the landing pad entry.
758 
759  /// Provide the catch typeinfo for a landing pad.
760  void addCatchTypeInfo(MachineBasicBlock *LandingPad,
762 
763  /// Provide the filter typeinfo for a landing pad.
764  void addFilterTypeInfo(MachineBasicBlock *LandingPad,
766 
767  /// Add a cleanup action for a landing pad.
768  void addCleanup(MachineBasicBlock *LandingPad);
769 
770  void addSEHCatchHandler(MachineBasicBlock *LandingPad, const Function *Filter,
771  const BlockAddress *RecoverLabel);
772 
773  void addSEHCleanupHandler(MachineBasicBlock *LandingPad,
774  const Function *Cleanup);
775 
776  /// Return the type id for the specified typeinfo. This is function wide.
777  unsigned getTypeIDFor(const GlobalValue *TI);
778 
779  /// Return the id of the filter encoded by TyIds. This is function wide.
780  int getFilterIDFor(std::vector<unsigned> &TyIds);
781 
782  /// Map the landing pad's EH symbol to the call site indexes.
784 
785  /// Get the call site indexes for a landing pad EH symbol.
788  "missing call site number for landing pad!");
789  return LPadToCallSiteMap[Sym];
790  }
791 
792  /// Return true if the landing pad Eh symbol has an associated call site.
794  return !LPadToCallSiteMap[Sym].empty();
795  }
796 
797  /// Map the begin label for a call site.
798  void setCallSiteBeginLabel(MCSymbol *BeginLabel, unsigned Site) {
799  CallSiteMap[BeginLabel] = Site;
800  }
801 
802  /// Get the call site number for a begin label.
803  unsigned getCallSiteBeginLabel(MCSymbol *BeginLabel) const {
804  assert(hasCallSiteBeginLabel(BeginLabel) &&
805  "Missing call site number for EH_LABEL!");
806  return CallSiteMap.lookup(BeginLabel);
807  }
808 
809  /// Return true if the begin label has a call site number associated with it.
810  bool hasCallSiteBeginLabel(MCSymbol *BeginLabel) const {
811  return CallSiteMap.count(BeginLabel);
812  }
813 
814  /// Return a reference to the C++ typeinfo for the current function.
815  const std::vector<const GlobalValue *> &getTypeInfos() const {
816  return TypeInfos;
817  }
818 
819  /// Return a reference to the typeids encoding filters used in the current
820  /// function.
821  const std::vector<unsigned> &getFilterIds() const {
822  return FilterIds;
823  }
824 
825  /// \}
826 
827  /// Collect information used to emit debugging information of a variable.
828  void setVariableDbgInfo(const DILocalVariable *Var, const DIExpression *Expr,
829  unsigned Slot, const DILocation *Loc) {
830  VariableDbgInfos.emplace_back(Var, Expr, Slot, Loc);
831  }
832 
835  return VariableDbgInfos;
836  }
837 };
838 
839 /// \name Exception Handling
840 /// \{
841 
842 /// Extract the exception handling information from the landingpad instruction
843 /// and add them to the specified machine module info.
844 void addLandingPadInfo(const LandingPadInst &I, MachineBasicBlock &MBB);
845 
846 /// \}
847 
848 //===--------------------------------------------------------------------===//
849 // GraphTraits specializations for function basic block graphs (CFGs)
850 //===--------------------------------------------------------------------===//
851 
852 // Provide specializations of GraphTraits to be able to treat a
853 // machine function as a graph of machine basic blocks... these are
854 // the same as the machine basic block iterators, except that the root
855 // node is implicitly the first node of the function.
856 //
857 template <> struct GraphTraits<MachineFunction*> :
859  static NodeRef getEntryNode(MachineFunction *F) { return &F->front(); }
860 
861  // nodes_iterator/begin/end - Allow iteration over all nodes in the graph
863  static nodes_iterator nodes_begin(MachineFunction *F) {
864  return nodes_iterator(F->begin());
865  }
866  static nodes_iterator nodes_end(MachineFunction *F) {
867  return nodes_iterator(F->end());
868  }
869  static unsigned size (MachineFunction *F) { return F->size(); }
870 };
871 template <> struct GraphTraits<const MachineFunction*> :
873  static NodeRef getEntryNode(const MachineFunction *F) { return &F->front(); }
874 
875  // nodes_iterator/begin/end - Allow iteration over all nodes in the graph
877  static nodes_iterator nodes_begin(const MachineFunction *F) {
878  return nodes_iterator(F->begin());
879  }
880  static nodes_iterator nodes_end (const MachineFunction *F) {
881  return nodes_iterator(F->end());
882  }
883  static unsigned size (const MachineFunction *F) {
884  return F->size();
885  }
886 };
887 
888 
889 // Provide specializations of GraphTraits to be able to treat a function as a
890 // graph of basic blocks... and to walk it in inverse order. Inverse order for
891 // a function is considered to be when traversing the predecessor edges of a BB
892 // instead of the successor edges.
893 //
894 template <> struct GraphTraits<Inverse<MachineFunction*> > :
897  return &G.Graph->front();
898  }
899 };
900 template <> struct GraphTraits<Inverse<const MachineFunction*> > :
903  return &G.Graph->front();
904  }
905 };
906 
907 } // End llvm namespace
908 
909 #endif
void push_front(MachineBasicBlock *MBB)
Pass interface - Implemented by all 'passes'.
Definition: Pass.h:81
A parsed version of the target data layout string in and methods for querying it. ...
Definition: DataLayout.h:102
BitVector & set()
Definition: BitVector.h:219
The MachineConstantPool class keeps track of constants referenced by a function which must be spilled...
unsigned getAlignment() const
getAlignment - Return the alignment (log2, not bytes) of the function.
bool verify(Pass *p=nullptr, const char *Banner=nullptr, bool AbortOnError=true) const
Run the current MachineFunction through the machine code verifier, useful for debugger use...
bool hasCallSiteLandingPad(MCSymbol *Sym)
Return true if the landing pad Eh symbol has an associated call site.
void setVariableDbgInfo(const DILocalVariable *Var, const DIExpression *Expr, unsigned Slot, const DILocation *Loc)
Collect information used to emit debugging information of a variable.
static BasicBlockListType MachineFunction::* getSublistAccess(MachineBasicBlock *)
Support for MachineBasicBlock::getNextNode().
iterator erase(iterator where)
Definition: ilist.h:280
bool hasValue() const
Definition: Optional.h:125
size_t i
MachineFunctionProperties & reset(Property P)
void RenumberBlocks(MachineBasicBlock *MBBFrom=nullptr)
RenumberBlocks - This discards all of the MachineBasicBlock numbers and recomputes them...
MCSymbol * addLandingPad(MachineBasicBlock *LandingPad)
Add a new panding pad. Returns the label ID for the landing pad entry.
void addNodeToList(NodeTy *)
When an MBB is added to an MF, we need to update the parent pointer of the MBB, the MBB numbering...
Definition: ilist.h:66
bool hasProperty(Property P) const
void setCallsUnwindInit(bool b)
T * allocate(Capacity Cap, AllocatorType &Allocator)
Allocate an array of at least the requested capacity.
MCSymbol - Instances of this class represent a symbol name in the MC file, and MCSymbols are created ...
Definition: MCSymbol.h:39
aarch64 AArch64 CCMP Pass
void transferNodesFromList(ilist_callback_traits &OldList, Iterator, Iterator)
static nodes_iterator nodes_end(MachineFunction *F)
void setHasEHFunclets(bool V)
const Function * FilterOrFinally
Filter or finally function. Null indicates a catch-all.
void addLandingPadInfo(const LandingPadInst &I, MachineBasicBlock &MBB)
Extract the exception handling information from the landingpad instruction and add them to the specif...
unsigned addLiveIn(unsigned PReg, const TargetRegisterClass *RC)
addLiveIn - Add the specified physical register as a live-in value and create a corresponding virtual...
Describe properties that are true of each instruction in the target description file.
Definition: MCInstrDesc.h:163
bool callsEHReturn() const
bool hasInlineAsm() const
Returns true if the function contains any inline assembly.
This file contains the declarations for metadata subclasses.
ArrayRecycler< MachineOperand >::Capacity OperandCapacity
const std::vector< LandingPadInfo > & getLandingPads() const
Return a reference to the landing pad info for the current function.
const std::vector< unsigned > & getFilterIds() const
Return a reference to the typeids encoding filters used in the current function.
void sort(Comp comp)
A debug info location.
Definition: DebugLoc.h:34
Metadata node.
Definition: Metadata.h:830
const Function * getFunction() const
getFunction - Return the LLVM function that this machine code represents
const std::vector< const GlobalValue * > & getTypeInfos() const
Return a reference to the C++ typeinfo for the current function.
unsigned getTypeIDFor(const GlobalValue *TI)
Return the type id for the specified typeinfo. This is function wide.
unsigned getFunctionNumber() const
getFunctionNumber - Return a unique ID for the current function.
MachineInstr * CreateMachineInstr(const MCInstrDesc &MCID, const DebugLoc &DL, bool NoImp=false)
CreateMachineInstr - Allocate a new MachineInstr.
static nodes_iterator nodes_begin(const MachineFunction *F)
void DeleteMachineBasicBlock(MachineBasicBlock *MBB)
DeleteMachineBasicBlock - Delete the given MachineBasicBlock.
VariableDbgInfoMapTy & getVariableDbgInfo()
This file defines the MallocAllocator and BumpPtrAllocator interfaces.
MachineJumpTableInfo * getOrCreateJumpTableInfo(unsigned JTEntryKind)
getOrCreateJumpTableInfo - Get the JumpTableInfo for this function, if it does already exist...
void viewCFG() const
viewCFG - This function is meant for use from the debugger.
static nodes_iterator nodes_begin(MachineFunction *F)
MachineFunctionInfo - This class can be derived from and used by targets to hold private target-speci...
pointer_iterator< MachineFunction::iterator > nodes_iterator
The address of a basic block.
Definition: Constants.h:822
VariableDbgInfo(const DILocalVariable *Var, const DIExpression *Expr, unsigned Slot, const DILocation *Loc)
void addSEHCleanupHandler(MachineBasicBlock *LandingPad, const Function *Cleanup)
A description of a memory reference used in the backend.
unsigned getNumBlockIDs() const
getNumBlockIDs - Return the number of MBB ID's allocated.
const TargetSubtargetInfo & getSubtarget() const
getSubtarget - Return the subtarget for which this machine code is being compiled.
MachineJumpTableInfo * getJumpTableInfo()
MachineFunctionProperties & set(const MachineFunctionProperties &MFP)
SmallVector< MCSymbol *, 1 > EndLabels
const_reverse_iterator rend() const
SmallVector< SEHHandler, 1 > SEHHandlers
void addCatchTypeInfo(MachineBasicBlock *LandingPad, ArrayRef< const GlobalValue * > TyInfo)
Provide the catch typeinfo for a landing pad.
const STC & getSubtarget() const
getSubtarget - This method returns a pointer to the specified type of TargetSubtargetInfo.
const MachineFunctionProperties & getProperties() const
Get the function properties.
void addFilterTypeInfo(MachineBasicBlock *LandingPad, ArrayRef< const GlobalValue * > TyInfo)
Provide the filter typeinfo for a landing pad.
MachineMemOperand ** mmo_iterator
Definition: MachineInstr.h:56
The MachineFrameInfo class represents an abstract stack frame until prolog/epilog code is inserted...
std::pair< MachineInstr::mmo_iterator, MachineInstr::mmo_iterator > extractLoadMemRefs(MachineInstr::mmo_iterator Begin, MachineInstr::mmo_iterator End)
extractLoadMemRefs - Allocate an array and populate it with just the load information from the given ...
SynchronizationScope
Definition: Instructions.h:50
int getFilterIDFor(std::vector< unsigned > &TyIds)
Return the id of the filter encoded by TyIds. This is function wide.
LLVM_NODISCARD unsigned addFrameInst(const MCCFIInstruction &Inst)
SmallVectorImpl< unsigned > & getCallSiteLandingPad(MCSymbol *Sym)
Get the call site indexes for a landing pad EH symbol.
AtomicOrdering
Atomic ordering for LLVM's memory model.
Context object for machine code objects.
Definition: MCContext.h:51
SmallVector< VariableDbgInfo, 4 > VariableDbgInfoMapTy
const MachineBasicBlock & front() const
This structure is used to retain landing pad info for the current function.
#define F(x, y, z)
Definition: MD5.cpp:51
SlotIndexes pass.
Definition: SlotIndexes.h:323
void erase(MachineBasicBlock *MBBI)
MachineBasicBlock * MBB
void setCallSiteBeginLabel(MCSymbol *BeginLabel, unsigned Site)
Map the begin label for a call site.
const MachineJumpTableInfo * getJumpTableInfo() const
getJumpTableInfo - Return the jump table info object for the current function.
ArrayRef - Represent a constant reference to an array (0 or more elements consecutively in memory)...
Definition: APInt.h:33
static GCRegistry::Add< OcamlGC > B("ocaml","ocaml 3.10-compatible GC")
MCContext & getContext() const
const DataLayout & getDataLayout() const
Return the DataLayout attached to the Module associated to this MF.
Debug location.
BasicBlockListType::reverse_iterator reverse_iterator
PseudoSourceValueManager & getPSVManager() const
MachineBasicBlock * CreateMachineBasicBlock(const BasicBlock *bb=nullptr)
CreateMachineBasicBlock - Allocate a new MachineBasicBlock.
const MachineRegisterInfo & getRegInfo() const
BasicBlockListType::const_reverse_iterator const_reverse_iterator
Use delete by default for iplist and ilist.
Definition: ilist.h:41
#define P(N)
LLVM Basic Block Representation.
Definition: BasicBlock.h:51
void addInvoke(MachineBasicBlock *LandingPad, MCSymbol *BeginLabel, MCSymbol *EndLabel)
Provide the begin and end labels of an invoke style call and associate it with a try landing pad bloc...
void addSEHCatchHandler(MachineBasicBlock *LandingPad, const Function *Filter, const BlockAddress *RecoverLabel)
Allocate memory in an ever growing pool, as if by bump-pointer.
Definition: Allocator.h:138
void push_front(pointer val)
Definition: ilist.h:325
MachineFrameInfo & getFrameInfo()
getFrameInfo - Return the frame info object for the current function.
SmallVector< MCSymbol *, 1 > BeginLabels
static NodeRef getEntryNode(MachineFunction *F)
static NodeRef getEntryNode(Inverse< const MachineFunction * > G)
const VariableDbgInfoMapTy & getVariableDbgInfo() const
LLVM_ATTRIBUTE_RETURNS_NONNULL LLVM_ATTRIBUTE_RETURNS_NOALIAS void * Allocate(size_t Size, size_t Alignment)
Allocate space at the specified alignment.
Definition: Allocator.h:212
void ensureAlignment(unsigned A)
ensureAlignment - Make sure the function is at least 1 << A bytes aligned.
void viewCFGOnly() const
viewCFGOnly - This function is meant for use from the debugger.
Greedy Register Allocator
void splice(iterator where, iplist_impl &L2)
Definition: ilist.h:342
bool shouldSplitStack() const
Should we be emitting segmented stack stuff for the function.
BitVector & reset()
Definition: BitVector.h:260
uint32_t Offset
std::vector< int > TypeIds
void setSubtarget(const TargetSubtargetInfo *ST)
void print(raw_ostream &OS) const
Print the MachineFunctionProperties in human-readable form.
static const unsigned End
Ty * getInfo()
getInfo - Keep track of various per-function pieces of information for backends that would like to do...
const std::vector< MCCFIInstruction > & getFrameInstructions() const
Returns a reference to a list of cfi instructions in the function's prologue.
void setHasInlineAsm(bool B)
Set a flag that indicates that the function contains inline assembly.
void splice(iterator InsertPt, iterator MBBI, iterator MBBE)
WinEHFuncInfo * getWinEHFuncInfo()
MachineConstantPool * getConstantPool()
getConstantPool - Return the constant pool object for the current function.
unsigned size() const
void DeleteMachineInstr(MachineInstr *MI)
DeleteMachineInstr - Delete the given MachineInstr.
uint32_t * allocateRegisterMask(unsigned NumRegister)
Allocate and initialize a register mask with NumRegister bits.
MachineBasicBlock & back()
An intrusive list with ownership and callbacks specified/controlled by ilist_traits, only with API safe for polymorphic types.
Definition: ilist.h:403
This class contains a discriminated union of information about pointers in memory operands...
const char * createExternalSymbolName(StringRef Name)
Allocate a string and populate it with the given external symbol name.
#define llvm_unreachable(msg)
Marks that the current location is not supposed to be reachable.
void dump() const
dump - Print the current MachineFunction to cerr, useful for debugger use.
void addCleanup(MachineBasicBlock *LandingPad)
Add a cleanup action for a landing pad.
Iterator for intrusive lists based on ilist_node.
const GraphType & Graph
Definition: GraphTraits.h:80
MCSymbol * getPICBaseSymbol() const
getPICBaseSymbol - Return a function-local symbol to represent the PIC base.
Recycler - This class manages a linked-list of deallocated nodes and facilitates reusing deallocated ...
Definition: Recycler.h:35
BasicBlockListType::const_iterator const_iterator
void splice(iterator InsertPt, iterator MBBI)
MachineInstr * CloneMachineInstr(const MachineInstr *Orig)
CloneMachineInstr - Create a new MachineInstr which is a copy of the 'Orig' instruction, identical in all ways except the instruction has no parent, prev, or next.
void removeNodeFromList(NodeTy *)
Definition: ilist.h:67
MachineOperand class - Representation of each machine instruction operand.
This is a 'vector' (really, a variable-sized array), optimized for the case when the array is small...
Definition: SmallVector.h:843
bool test(unsigned Idx) const
Definition: BitVector.h:323
MachineBasicBlock * getBlockNumbered(unsigned N) const
getBlockNumbered - MachineBasicBlocks are automatically numbered when they are inserted into the mach...
const DataFlowGraph & G
Definition: RDFGraph.cpp:206
A collection of metadata nodes that might be associated with a memory access used by the alias-analys...
Definition: Metadata.h:625
bool verifyRequiredProperties(const MachineFunctionProperties &V) const
void setCallsEHReturn(bool b)
MachineFunctionProperties & getProperties()
const_iterator end() const
static void deleteNode(NodeTy *V)
Definition: ilist.h:42
DWARF expression.
reverse_iterator rend()
const MachineConstantPool * getConstantPool() const
void splice(iterator InsertPt, MachineBasicBlock *MBB)
MCSymbol * getJTISymbol(unsigned JTI, MCContext &Ctx, bool isLinkerPrivate=false) const
getJTISymbol - Return the MCSymbol for the specified non-empty jump table.
MachineFunctionProperties & reset()
Reset all the properties.
void setCallSiteLandingPad(MCSymbol *Sym, ArrayRef< unsigned > Sites)
Map the landing pad's EH symbol to the call site indexes.
MachineMemOperand * getMachineMemOperand(MachinePointerInfo PtrInfo, MachineMemOperand::Flags f, uint64_t s, unsigned base_alignment, const AAMDNodes &AAInfo=AAMDNodes(), const MDNode *Ranges=nullptr, SynchronizationScope SynchScope=CrossThread, AtomicOrdering Ordering=AtomicOrdering::NotAtomic, AtomicOrdering FailureOrdering=AtomicOrdering::NotAtomic)
getMachineMemOperand - Allocate a new MachineMemOperand.
Target - Wrapper for Target specific information.
void push_back(pointer val)
Definition: ilist.h:326
bool hasEHFunclets() const
static unsigned size(MachineFunction *F)
MachineBasicBlock * LandingPadBlock
Flags
Flags values. These may be or'd together.
MachineRegisterInfo - Keep track of information for virtual and physical registers, including vreg register classes, use/def chains for registers, etc.
MachineFunctionProperties & set(Property P)
TargetSubtargetInfo - Generic base class for all target subtargets.
Representation of each machine instruction.
Definition: MachineInstr.h:52
pointer remove(iterator &IT)
Definition: ilist.h:264
static NodeRef getEntryNode(Inverse< MachineFunction * > G)
static Ty * create(BumpPtrAllocator &Allocator, MachineFunction &MF)
Factory function: default behavior is to call new using the supplied allocator.
void reset()
Reset the instance as if it was just created.
iterator insert(iterator where, pointer New)
Definition: ilist.h:241
void emplace_back(ArgTypes &&...Args)
Definition: SmallVector.h:635
static unsigned size(const MachineFunction *F)
MachineRegisterInfo & getRegInfo()
getRegInfo - Return information about the registers currently in use.
bool exposesReturnsTwice() const
exposesReturnsTwice - Returns true if the function calls setjmp or any other similar functions with a...
LandingPadInfo(MachineBasicBlock *MBB)
#define I(x, y, z)
Definition: MD5.cpp:54
#define N
const MachineFrameInfo & getFrameInfo() const
bool callsUnwindInit() const
const TargetMachine & getTarget() const
getTarget - Return the target machine this machine code is compiled with
MachineBasicBlock & front()
void print(raw_ostream &OS, const SlotIndexes *=nullptr) const
print - Print out the MachineFunction in a format suitable for debugging to the specified stream...
const WinEHFuncInfo * getWinEHFuncInfo() const
getWinEHFuncInfo - Return information about how the current function uses Windows exception handling...
void setExposesReturnsTwice(bool B)
setCallsSetJmp - Set a flag that indicates if there's a call to a "returns twice" function...
void removeFromMBBNumbering(unsigned N)
removeFromMBBNumbering - Remove the specific machine basic block from our tracker, this is only really to be used by the MachineBasicBlock implementation.
bool hasCallSiteBeginLabel(MCSymbol *BeginLabel) const
Return true if the begin label has a call site number associated with it.
pointer_iterator< MachineFunction::const_iterator > nodes_iterator
#define LLVM_NODISCARD
LLVM_NODISCARD - Warn if a type or return value is discarded.
Definition: Compiler.h:132
static NodeRef getEntryNode(const MachineFunction *F)
const Ty * getInfo() const
std::pair< MachineInstr::mmo_iterator, MachineInstr::mmo_iterator > extractStoreMemRefs(MachineInstr::mmo_iterator Begin, MachineInstr::mmo_iterator End)
extractStoreMemRefs - Allocate an array and populate it with just the store information from the give...
void erase(iterator MBBI)
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
void insert(iterator MBBI, MachineBasicBlock *MBB)
static nodes_iterator nodes_end(const MachineFunction *F)
MachineFunctionProperties & reset(const MachineFunctionProperties &MFP)
aarch64 promote const
LandingPadInfo & getOrCreateLandingPadInfo(MachineBasicBlock *LandingPad)
Find or create an LandingPadInfo for the specified MachineBasicBlock.
unsigned addToMBBNumbering(MachineBasicBlock *MBB)
Adds the MBB to the internal numbering.
void deallocateOperandArray(OperandCapacity Cap, MachineOperand *Array)
Dellocate an array of MachineOperands and recycle the memory.
void push_back(MachineBasicBlock *MBB)
const BlockAddress * RecoverBA
Address of block to recover at. Null for a finally handler.
std::underlying_type< E >::type Mask()
Get a bitmask with 1s in all places up to the high-order bit of E's largest value.
Definition: BitmaskEnum.h:81
void setAlignment(unsigned A)
setAlignment - Set the alignment (log2, not bytes) of the function.
BasicBlockListType::iterator iterator
This class implements an extremely fast bulk output stream that can only output to a stream...
Definition: raw_ostream.h:44
Callbacks do nothing by default in iplist and ilist.
Definition: ilist.h:65
Primary interface to the complete machine description for the target machine.
const MachineBasicBlock & back() const
const_reverse_iterator rbegin() const
void deallocate(Capacity Cap, T *Ptr)
Deallocate an array with the specified Capacity.
IRTranslator LLVM IR MI
Manages creation of pseudo source values.
StringRef - Represent a constant reference to a string, i.e.
Definition: StringRef.h:47
MachineModuleInfo & getMMI() const
StringRef getName() const
getName - Return the name of the corresponding LLVM function.
unsigned getCallSiteBeginLabel(MCSymbol *BeginLabel) const
Get the call site number for a begin label.
const_iterator begin() const
static GCRegistry::Add< ErlangGC > A("erlang","erlang-compatible garbage collector")
reverse_iterator rbegin()
VariableDbgInfoMapTy VariableDbgInfos
MachineInstr::mmo_iterator allocateMemRefsArray(unsigned long Num)
allocateMemRefsArray - Allocate an array to hold MachineMemOperand pointers.
MachineOperand * allocateOperandArray(OperandCapacity Cap)
Allocate an array of MachineOperands.
Properties which a MachineFunction may have at a given point in time.
This class contains meta information specific to a module.
void tidyLandingPads(DenseMap< MCSymbol *, uintptr_t > *LPMap=nullptr)
Remap landing pad labels and remove any deleted landing pads.