Coverage Report

Created: 2019-02-20 00:17

/Users/buildslave/jenkins/workspace/clang-stage2-coverage-R/llvm/include/llvm/CodeGen/MachineBasicBlock.h
Line
Count
Source (jump to first uncovered line)
1
//===- llvm/CodeGen/MachineBasicBlock.h -------------------------*- 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
// Collect the sequence of machine instructions for a basic block.
10
//
11
//===----------------------------------------------------------------------===//
12
13
#ifndef LLVM_CODEGEN_MACHINEBASICBLOCK_H
14
#define LLVM_CODEGEN_MACHINEBASICBLOCK_H
15
16
#include "llvm/ADT/GraphTraits.h"
17
#include "llvm/ADT/ilist.h"
18
#include "llvm/ADT/ilist_node.h"
19
#include "llvm/ADT/iterator_range.h"
20
#include "llvm/ADT/simple_ilist.h"
21
#include "llvm/CodeGen/MachineInstr.h"
22
#include "llvm/CodeGen/MachineInstrBundleIterator.h"
23
#include "llvm/IR/DebugLoc.h"
24
#include "llvm/MC/LaneBitmask.h"
25
#include "llvm/MC/MCRegisterInfo.h"
26
#include "llvm/Support/BranchProbability.h"
27
#include "llvm/Support/Printable.h"
28
#include <cassert>
29
#include <cstdint>
30
#include <functional>
31
#include <iterator>
32
#include <string>
33
#include <vector>
34
35
namespace llvm {
36
37
class BasicBlock;
38
class MachineFunction;
39
class MCSymbol;
40
class ModuleSlotTracker;
41
class Pass;
42
class SlotIndexes;
43
class StringRef;
44
class raw_ostream;
45
class TargetRegisterClass;
46
class TargetRegisterInfo;
47
48
template <> struct ilist_traits<MachineInstr> {
49
private:
50
  friend class MachineBasicBlock; // Set by the owning MachineBasicBlock.
51
52
  MachineBasicBlock *Parent;
53
54
  using instr_iterator =
55
      simple_ilist<MachineInstr, ilist_sentinel_tracking<true>>::iterator;
56
57
public:
58
  void addNodeToList(MachineInstr *N);
59
  void removeNodeFromList(MachineInstr *N);
60
  void transferNodesFromList(ilist_traits &FromList, instr_iterator First,
61
                             instr_iterator Last);
62
  void deleteNode(MachineInstr *MI);
63
};
64
65
class MachineBasicBlock
66
    : public ilist_node_with_parent<MachineBasicBlock, MachineFunction> {
67
public:
68
  /// Pair of physical register and lane mask.
69
  /// This is not simply a std::pair typedef because the members should be named
70
  /// clearly as they both have an integer type.
71
  struct RegisterMaskPair {
72
  public:
73
    MCPhysReg PhysReg;
74
    LaneBitmask LaneMask;
75
76
    RegisterMaskPair(MCPhysReg PhysReg, LaneBitmask LaneMask)
77
17.3M
        : PhysReg(PhysReg), LaneMask(LaneMask) {}
78
  };
79
80
private:
81
  using Instructions = ilist<MachineInstr, ilist_sentinel_tracking<true>>;
82
83
  Instructions Insts;
84
  const BasicBlock *BB;
85
  int Number;
86
  MachineFunction *xParent;
87
88
  /// Keep track of the predecessor / successor basic blocks.
89
  std::vector<MachineBasicBlock *> Predecessors;
90
  std::vector<MachineBasicBlock *> Successors;
91
92
  /// Keep track of the probabilities to the successors. This vector has the
93
  /// same order as Successors, or it is empty if we don't use it (disable
94
  /// optimization).
95
  std::vector<BranchProbability> Probs;
96
  using probability_iterator = std::vector<BranchProbability>::iterator;
97
  using const_probability_iterator =
98
      std::vector<BranchProbability>::const_iterator;
99
100
  Optional<uint64_t> IrrLoopHeaderWeight;
101
102
  /// Keep track of the physical registers that are livein of the basicblock.
103
  using LiveInVector = std::vector<RegisterMaskPair>;
104
  LiveInVector LiveIns;
105
106
  /// Alignment of the basic block. Zero if the basic block does not need to be
107
  /// aligned. The alignment is specified as log2(bytes).
108
  unsigned Alignment = 0;
109
110
  /// Indicate that this basic block is entered via an exception handler.
111
  bool IsEHPad = false;
112
113
  /// Indicate that this basic block is potentially the target of an indirect
114
  /// branch.
115
  bool AddressTaken = false;
116
117
  /// Indicate that this basic block is the entry block of an EH scope, i.e.,
118
  /// the block that used to have a catchpad or cleanuppad instruction in the
119
  /// LLVM IR.
120
  bool IsEHScopeEntry = false;
121
122
  /// Indicate that this basic block is the entry block of an EH funclet.
123
  bool IsEHFuncletEntry = false;
124
125
  /// Indicate that this basic block is the entry block of a cleanup funclet.
126
  bool IsCleanupFuncletEntry = false;
127
128
  /// since getSymbol is a relatively heavy-weight operation, the symbol
129
  /// is only computed once and is cached.
130
  mutable MCSymbol *CachedMCSymbol = nullptr;
131
132
  // Intrusive list support
133
  MachineBasicBlock() = default;
134
135
  explicit MachineBasicBlock(MachineFunction &MF, const BasicBlock *BB);
136
137
  ~MachineBasicBlock();
138
139
  // MachineBasicBlocks are allocated and owned by MachineFunction.
140
  friend class MachineFunction;
141
142
public:
143
  /// Return the LLVM basic block that this instance corresponded to originally.
144
  /// Note that this may be NULL if this instance does not correspond directly
145
  /// to an LLVM basic block.
146
14.5M
  const BasicBlock *getBasicBlock() const { return BB; }
147
148
  /// Return the name of the corresponding LLVM basic block, or an empty string.
149
  StringRef getName() const;
150
151
  /// Return a formatted string to identify this block and its parent function.
152
  std::string getFullName() const;
153
154
  /// Test whether this block is potentially the target of an indirect branch.
155
3.07M
  bool hasAddressTaken() const { return AddressTaken; }
156
157
  /// Set this block to reflect that it potentially is the target of an indirect
158
  /// branch.
159
736
  void setHasAddressTaken() { AddressTaken = true; }
160
161
  /// Return the MachineFunction containing this basic block.
162
285M
  const MachineFunction *getParent() const { return xParent; }
163
443M
  MachineFunction *getParent() { return xParent; }
164
165
  using instr_iterator = Instructions::iterator;
166
  using const_instr_iterator = Instructions::const_iterator;
167
  using reverse_instr_iterator = Instructions::reverse_iterator;
168
  using const_reverse_instr_iterator = Instructions::const_reverse_iterator;
169
170
  using iterator = MachineInstrBundleIterator<MachineInstr>;
171
  using const_iterator = MachineInstrBundleIterator<const MachineInstr>;
172
  using reverse_iterator = MachineInstrBundleIterator<MachineInstr, true>;
173
  using const_reverse_iterator =
174
      MachineInstrBundleIterator<const MachineInstr, true>;
175
176
646k
  unsigned size() const { return (unsigned)Insts.size(); }
177
97.2M
  bool empty() const { return Insts.empty(); }
178
179
23.2M
  MachineInstr       &instr_front()       { return Insts.front(); }
180
19
  MachineInstr       &instr_back()        { return Insts.back();  }
181
0
  const MachineInstr &instr_front() const { return Insts.front(); }
182
0
  const MachineInstr &instr_back()  const { return Insts.back();  }
183
184
6.80M
  MachineInstr       &front()             { return Insts.front(); }
185
7.63M
  MachineInstr       &back()              { return *--end();      }
186
4
  const MachineInstr &front()       const { return Insts.front(); }
187
12.6M
  const MachineInstr &back()        const { return *--end();      }
188
189
544M
  instr_iterator                instr_begin()       { return Insts.begin();  }
190
37.2M
  const_instr_iterator          instr_begin() const { return Insts.begin();  }
191
802M
  instr_iterator                  instr_end()       { return Insts.end();    }
192
58.6M
  const_instr_iterator            instr_end() const { return Insts.end();    }
193
10.4M
  reverse_instr_iterator       instr_rbegin()       { return Insts.rbegin(); }
194
2.25M
  const_reverse_instr_iterator instr_rbegin() const { return Insts.rbegin(); }
195
13.6M
  reverse_instr_iterator       instr_rend  ()       { return Insts.rend();   }
196
2.30M
  const_reverse_instr_iterator instr_rend  () const { return Insts.rend();   }
197
198
  using instr_range = iterator_range<instr_iterator>;
199
  using const_instr_range = iterator_range<const_instr_iterator>;
200
405k
  instr_range instrs() { return instr_range(instr_begin(), instr_end()); }
201
16.1k
  const_instr_range instrs() const {
202
16.1k
    return const_instr_range(instr_begin(), instr_end());
203
16.1k
  }
204
205
452M
  iterator                begin()       { return instr_begin();  }
206
34.8M
  const_iterator          begin() const { return instr_begin();  }
207
628M
  iterator                end  ()       { return instr_end();    }
208
55.5M
  const_iterator          end  () const { return instr_end();    }
209
10.4M
  reverse_iterator rbegin() {
210
10.4M
    return reverse_iterator::getAtBundleBegin(instr_rbegin());
211
10.4M
  }
212
2.25M
  const_reverse_iterator rbegin() const {
213
2.25M
    return const_reverse_iterator::getAtBundleBegin(instr_rbegin());
214
2.25M
  }
215
13.6M
  reverse_iterator rend() { return reverse_iterator(instr_rend()); }
216
2.30M
  const_reverse_iterator rend() const {
217
2.30M
    return const_reverse_iterator(instr_rend());
218
2.30M
  }
219
220
  /// Support for MachineInstr::getNextNode().
221
101k
  static Instructions MachineBasicBlock::*getSublistAccess(MachineInstr *) {
222
101k
    return &MachineBasicBlock::Insts;
223
101k
  }
224
225
3.39M
  inline iterator_range<iterator> terminators() {
226
3.39M
    return make_range(getFirstTerminator(), end());
227
3.39M
  }
228
19.1k
  inline iterator_range<const_iterator> terminators() const {
229
19.1k
    return make_range(getFirstTerminator(), end());
230
19.1k
  }
231
232
  /// Returns a range that iterates over the phis in the basic block.
233
24.4k
  inline iterator_range<iterator> phis() {
234
24.4k
    return make_range(begin(), getFirstNonPHI());
235
24.4k
  }
236
0
  inline iterator_range<const_iterator> phis() const {
237
0
    return const_cast<MachineBasicBlock *>(this)->phis();
238
0
  }
239
240
  // Machine-CFG iterators
241
  using pred_iterator = std::vector<MachineBasicBlock *>::iterator;
242
  using const_pred_iterator = std::vector<MachineBasicBlock *>::const_iterator;
243
  using succ_iterator = std::vector<MachineBasicBlock *>::iterator;
244
  using const_succ_iterator = std::vector<MachineBasicBlock *>::const_iterator;
245
  using pred_reverse_iterator =
246
      std::vector<MachineBasicBlock *>::reverse_iterator;
247
  using const_pred_reverse_iterator =
248
      std::vector<MachineBasicBlock *>::const_reverse_iterator;
249
  using succ_reverse_iterator =
250
      std::vector<MachineBasicBlock *>::reverse_iterator;
251
  using const_succ_reverse_iterator =
252
      std::vector<MachineBasicBlock *>::const_reverse_iterator;
253
97.3M
  pred_iterator        pred_begin()       { return Predecessors.begin(); }
254
36.8M
  const_pred_iterator  pred_begin() const { return Predecessors.begin(); }
255
86.4M
  pred_iterator        pred_end()         { return Predecessors.end();   }
256
38.6M
  const_pred_iterator  pred_end()   const { return Predecessors.end();   }
257
  pred_reverse_iterator        pred_rbegin()
258
22.3M
                                          { return Predecessors.rbegin();}
259
  const_pred_reverse_iterator  pred_rbegin() const
260
0
                                          { return Predecessors.rbegin();}
261
  pred_reverse_iterator        pred_rend()
262
22.3M
                                          { return Predecessors.rend();  }
263
  const_pred_reverse_iterator  pred_rend()   const
264
0
                                          { return Predecessors.rend();  }
265
92.6M
  unsigned             pred_size()  const {
266
92.6M
    return (unsigned)Predecessors.size();
267
92.6M
  }
268
51.6M
  bool                 pred_empty() const { return Predecessors.empty(); }
269
113M
  succ_iterator        succ_begin()       { return Successors.begin();   }
270
109M
  const_succ_iterator  succ_begin() const { return Successors.begin();   }
271
178M
  succ_iterator        succ_end()         { return Successors.end();     }
272
125M
  const_succ_iterator  succ_end()   const { return Successors.end();     }
273
  succ_reverse_iterator        succ_rbegin()
274
9.24k
                                          { return Successors.rbegin();  }
275
  const_succ_reverse_iterator  succ_rbegin() const
276
0
                                          { return Successors.rbegin();  }
277
  succ_reverse_iterator        succ_rend()
278
4
                                          { return Successors.rend();    }
279
  const_succ_reverse_iterator  succ_rend()   const
280
0
                                          { return Successors.rend();    }
281
67.5M
  unsigned             succ_size()  const {
282
67.5M
    return (unsigned)Successors.size();
283
67.5M
  }
284
23.4M
  bool                 succ_empty() const { return Successors.empty();   }
285
286
46.4M
  inline iterator_range<pred_iterator> predecessors() {
287
46.4M
    return make_range(pred_begin(), pred_end());
288
46.4M
  }
289
14.7M
  inline iterator_range<const_pred_iterator> predecessors() const {
290
14.7M
    return make_range(pred_begin(), pred_end());
291
14.7M
  }
292
14.6M
  inline iterator_range<succ_iterator> successors() {
293
14.6M
    return make_range(succ_begin(), succ_end());
294
14.6M
  }
295
56.0M
  inline iterator_range<const_succ_iterator> successors() const {
296
56.0M
    return make_range(succ_begin(), succ_end());
297
56.0M
  }
298
299
  // LiveIn management methods.
300
301
  /// Adds the specified register as a live in. Note that it is an error to add
302
  /// the same register to the same set more than once unless the intention is
303
  /// to call sortUniqueLiveIns after all registers are added.
304
  void addLiveIn(MCPhysReg PhysReg,
305
17.3M
                 LaneBitmask LaneMask = LaneBitmask::getAll()) {
306
17.3M
    LiveIns.push_back(RegisterMaskPair(PhysReg, LaneMask));
307
17.3M
  }
308
559k
  void addLiveIn(const RegisterMaskPair &RegMaskPair) {
309
559k
    LiveIns.push_back(RegMaskPair);
310
559k
  }
311
312
  /// Sorts and uniques the LiveIns vector. It can be significantly faster to do
313
  /// this than repeatedly calling isLiveIn before calling addLiveIn for every
314
  /// LiveIn insertion.
315
  void sortUniqueLiveIns();
316
317
  /// Clear live in list.
318
  void clearLiveIns();
319
320
  /// Add PhysReg as live in to this block, and ensure that there is a copy of
321
  /// PhysReg to a virtual register of class RC. Return the virtual register
322
  /// that is a copy of the live in PhysReg.
323
  unsigned addLiveIn(MCPhysReg PhysReg, const TargetRegisterClass *RC);
324
325
  /// Remove the specified register from the live in set.
326
  void removeLiveIn(MCPhysReg Reg,
327
                    LaneBitmask LaneMask = LaneBitmask::getAll());
328
329
  /// Return true if the specified register is in the live in set.
330
  bool isLiveIn(MCPhysReg Reg,
331
                LaneBitmask LaneMask = LaneBitmask::getAll()) const;
332
333
  // Iteration support for live in sets.  These sets are kept in sorted
334
  // order by their register number.
335
  using livein_iterator = LiveInVector::const_iterator;
336
#ifndef NDEBUG
337
  /// Unlike livein_begin, this method does not check that the liveness
338
  /// information is accurate. Still for debug purposes it may be useful
339
  /// to have iterators that won't assert if the liveness information
340
  /// is not current.
341
  livein_iterator livein_begin_dbg() const { return LiveIns.begin(); }
342
  iterator_range<livein_iterator> liveins_dbg() const {
343
    return make_range(livein_begin_dbg(), livein_end());
344
  }
345
#endif
346
  livein_iterator livein_begin() const;
347
26.9M
  livein_iterator livein_end()   const { return LiveIns.end(); }
348
4.47M
  bool            livein_empty() const { return LiveIns.empty(); }
349
24.8M
  iterator_range<livein_iterator> liveins() const {
350
24.8M
    return make_range(livein_begin(), livein_end());
351
24.8M
  }
352
353
  /// Remove entry from the livein set and return iterator to the next.
354
  livein_iterator removeLiveIn(livein_iterator I);
355
356
  /// Get the clobber mask for the start of this basic block. Funclets use this
357
  /// to prevent register allocation across funclet transitions.
358
  const uint32_t *getBeginClobberMask(const TargetRegisterInfo *TRI) const;
359
360
  /// Get the clobber mask for the end of the basic block.
361
  /// \see getBeginClobberMask()
362
  const uint32_t *getEndClobberMask(const TargetRegisterInfo *TRI) const;
363
364
  /// Return alignment of the basic block. The alignment is specified as
365
  /// log2(bytes).
366
6.44M
  unsigned getAlignment() const { return Alignment; }
367
368
  /// Set alignment of the basic block. The alignment is specified as
369
  /// log2(bytes).
370
17.7k
  void setAlignment(unsigned Align) { Alignment = Align; }
371
372
  /// Returns true if the block is a landing pad. That is this basic block is
373
  /// entered via an exception handler.
374
52.6M
  bool isEHPad() const { return IsEHPad; }
375
376
  /// Indicates the block is a landing pad.  That is this basic block is entered
377
  /// via an exception handler.
378
39.7k
  void setIsEHPad(bool V = true) { IsEHPad = V; }
379
380
  bool hasEHPadSuccessor() const;
381
382
  /// Returns true if this is the entry block of an EH scope, i.e., the block
383
  /// that used to have a catchpad or cleanuppad instruction in the LLVM IR.
384
2.51k
  bool isEHScopeEntry() const { return IsEHScopeEntry; }
385
386
  /// Indicates if this is the entry block of an EH scope, i.e., the block that
387
  /// that used to have a catchpad or cleanuppad instruction in the LLVM IR.
388
357
  void setIsEHScopeEntry(bool V = true) { IsEHScopeEntry = V; }
389
390
  /// Returns true if this is the entry block of an EH funclet.
391
10.3M
  bool isEHFuncletEntry() const { return IsEHFuncletEntry; }
392
393
  /// Indicates if this is the entry block of an EH funclet.
394
300
  void setIsEHFuncletEntry(bool V = true) { IsEHFuncletEntry = V; }
395
396
  /// Returns true if this is the entry block of a cleanup funclet.
397
772
  bool isCleanupFuncletEntry() const { return IsCleanupFuncletEntry; }
398
399
  /// Indicates if this is the entry block of a cleanup funclet.
400
46
  void setIsCleanupFuncletEntry(bool V = true) { IsCleanupFuncletEntry = V; }
401
402
  /// Returns true if it is legal to hoist instructions into this block.
403
  bool isLegalToHoistInto() const;
404
405
  // Code Layout methods.
406
407
  /// Move 'this' block before or after the specified block.  This only moves
408
  /// the block, it does not modify the CFG or adjust potential fall-throughs at
409
  /// the end of the block.
410
  void moveBefore(MachineBasicBlock *NewAfter);
411
  void moveAfter(MachineBasicBlock *NewBefore);
412
413
  /// Update the terminator instructions in block to account for changes to the
414
  /// layout. If the block previously used a fallthrough, it may now need a
415
  /// branch, and if it previously used branching it may now be able to use a
416
  /// fallthrough.
417
  void updateTerminator();
418
419
  // Machine-CFG mutators
420
421
  /// Add Succ as a successor of this MachineBasicBlock.  The Predecessors list
422
  /// of Succ is automatically updated. PROB parameter is stored in
423
  /// Probabilities list. The default probability is set as unknown. Mixing
424
  /// known and unknown probabilities in successor list is not allowed. When all
425
  /// successors have unknown probabilities, 1 / N is returned as the
426
  /// probability for each successor, where N is the number of successors.
427
  ///
428
  /// Note that duplicate Machine CFG edges are not allowed.
429
  void addSuccessor(MachineBasicBlock *Succ,
430
                    BranchProbability Prob = BranchProbability::getUnknown());
431
432
  /// Add Succ as a successor of this MachineBasicBlock.  The Predecessors list
433
  /// of Succ is automatically updated. The probability is not provided because
434
  /// BPI is not available (e.g. -O0 is used), in which case edge probabilities
435
  /// won't be used. Using this interface can save some space.
436
  void addSuccessorWithoutProb(MachineBasicBlock *Succ);
437
438
  /// Set successor probability of a given iterator.
439
  void setSuccProbability(succ_iterator I, BranchProbability Prob);
440
441
  /// Normalize probabilities of all successors so that the sum of them becomes
442
  /// one. This is usually done when the current update on this MBB is done, and
443
  /// the sum of its successors' probabilities is not guaranteed to be one. The
444
  /// user is responsible for the correct use of this function.
445
  /// MBB::removeSuccessor() has an option to do this automatically.
446
721k
  void normalizeSuccProbs() {
447
721k
    BranchProbability::normalizeProbabilities(Probs.begin(), Probs.end());
448
721k
  }
449
450
  /// Validate successors' probabilities and check if the sum of them is
451
  /// approximate one. This only works in DEBUG mode.
452
  void validateSuccProbs() const;
453
454
  /// Remove successor from the successors list of this MachineBasicBlock. The
455
  /// Predecessors list of Succ is automatically updated.
456
  /// If NormalizeSuccProbs is true, then normalize successors' probabilities
457
  /// after the successor is removed.
458
  void removeSuccessor(MachineBasicBlock *Succ,
459
                       bool NormalizeSuccProbs = false);
460
461
  /// Remove specified successor from the successors list of this
462
  /// MachineBasicBlock. The Predecessors list of Succ is automatically updated.
463
  /// If NormalizeSuccProbs is true, then normalize successors' probabilities
464
  /// after the successor is removed.
465
  /// Return the iterator to the element after the one removed.
466
  succ_iterator removeSuccessor(succ_iterator I,
467
                                bool NormalizeSuccProbs = false);
468
469
  /// Replace successor OLD with NEW and update probability info.
470
  void replaceSuccessor(MachineBasicBlock *Old, MachineBasicBlock *New);
471
472
  /// Copy a successor (and any probability info) from original block to this
473
  /// block's. Uses an iterator into the original blocks successors.
474
  ///
475
  /// This is useful when doing a partial clone of successors. Afterward, the
476
  /// probabilities may need to be normalized.
477
  void copySuccessor(MachineBasicBlock *Orig, succ_iterator I);
478
479
  /// Split the old successor into old plus new and updates the probability
480
  /// info.
481
  void splitSuccessor(MachineBasicBlock *Old, MachineBasicBlock *New,
482
                      bool NormalizeSuccProbs = false);
483
484
  /// Transfers all the successors from MBB to this machine basic block (i.e.,
485
  /// copies all the successors FromMBB and remove all the successors from
486
  /// FromMBB).
487
  void transferSuccessors(MachineBasicBlock *FromMBB);
488
489
  /// Transfers all the successors, as in transferSuccessors, and update PHI
490
  /// operands in the successor blocks which refer to FromMBB to refer to this.
491
  void transferSuccessorsAndUpdatePHIs(MachineBasicBlock *FromMBB);
492
493
  /// Return true if any of the successors have probabilities attached to them.
494
5.99k
  bool hasSuccessorProbabilities() const { return !Probs.empty(); }
495
496
  /// Return true if the specified MBB is a predecessor of this block.
497
  bool isPredecessor(const MachineBasicBlock *MBB) const;
498
499
  /// Return true if the specified MBB is a successor of this block.
500
  bool isSuccessor(const MachineBasicBlock *MBB) const;
501
502
  /// Return true if the specified MBB will be emitted immediately after this
503
  /// block, such that if this block exits by falling through, control will
504
  /// transfer to the specified MBB. Note that MBB need not be a successor at
505
  /// all, for example if this block ends with an unconditional branch to some
506
  /// other block.
507
  bool isLayoutSuccessor(const MachineBasicBlock *MBB) const;
508
509
  /// Return the fallthrough block if the block can implicitly
510
  /// transfer control to the block after it by falling off the end of
511
  /// it.  This should return null if it can reach the block after
512
  /// it, but it uses an explicit branch to do so (e.g., a table
513
  /// jump).  Non-null return  is a conservative answer.
514
  MachineBasicBlock *getFallThrough();
515
516
  /// Return true if the block can implicitly transfer control to the
517
  /// block after it by falling off the end of it.  This should return
518
  /// false if it can reach the block after it, but it uses an
519
  /// explicit branch to do so (e.g., a table jump).  True is a
520
  /// conservative answer.
521
  bool canFallThrough();
522
523
  /// Returns a pointer to the first instruction in this block that is not a
524
  /// PHINode instruction. When adding instructions to the beginning of the
525
  /// basic block, they should be added before the returned value, not before
526
  /// the first instruction, which might be PHI.
527
  /// Returns end() is there's no non-PHI instruction.
528
  iterator getFirstNonPHI();
529
530
  /// Return the first instruction in MBB after I that is not a PHI or a label.
531
  /// This is the correct point to insert lowered copies at the beginning of a
532
  /// basic block that must be before any debugging information.
533
  iterator SkipPHIsAndLabels(iterator I);
534
535
  /// Return the first instruction in MBB after I that is not a PHI, label or
536
  /// debug.  This is the correct point to insert copies at the beginning of a
537
  /// basic block.
538
  iterator SkipPHIsLabelsAndDebug(iterator I);
539
540
  /// Returns an iterator to the first terminator instruction of this basic
541
  /// block. If a terminator does not exist, it returns end().
542
  iterator getFirstTerminator();
543
904k
  const_iterator getFirstTerminator() const {
544
904k
    return const_cast<MachineBasicBlock *>(this)->getFirstTerminator();
545
904k
  }
546
547
  /// Same getFirstTerminator but it ignores bundles and return an
548
  /// instr_iterator instead.
549
  instr_iterator getFirstInstrTerminator();
550
551
  /// Returns an iterator to the first non-debug instruction in the basic block,
552
  /// or end().
553
  iterator getFirstNonDebugInstr();
554
0
  const_iterator getFirstNonDebugInstr() const {
555
0
    return const_cast<MachineBasicBlock *>(this)->getFirstNonDebugInstr();
556
0
  }
557
558
  /// Returns an iterator to the last non-debug instruction in the basic block,
559
  /// or end().
560
  iterator getLastNonDebugInstr();
561
7.59M
  const_iterator getLastNonDebugInstr() const {
562
7.59M
    return const_cast<MachineBasicBlock *>(this)->getLastNonDebugInstr();
563
7.59M
  }
564
565
  /// Convenience function that returns true if the block ends in a return
566
  /// instruction.
567
7.09M
  bool isReturnBlock() const {
568
7.09M
    return !empty() && 
back().isReturn()7.00M
;
569
7.09M
  }
570
571
  /// Convenience function that returns true if the bock ends in a EH scope
572
  /// return instruction.
573
2.23k
  bool isEHScopeReturnBlock() const {
574
2.23k
    return !empty() && 
back().isEHScopeReturn()2.20k
;
575
2.23k
  }
576
577
  /// Split the critical edge from this block to the given successor block, and
578
  /// return the newly created block, or null if splitting is not possible.
579
  ///
580
  /// This function updates LiveVariables, MachineDominatorTree, and
581
  /// MachineLoopInfo, as applicable.
582
  MachineBasicBlock *SplitCriticalEdge(MachineBasicBlock *Succ, Pass &P);
583
584
  /// Check if the edge between this block and the given successor \p
585
  /// Succ, can be split. If this returns true a subsequent call to
586
  /// SplitCriticalEdge is guaranteed to return a valid basic block if
587
  /// no changes occurred in the meantime.
588
  bool canSplitCriticalEdge(const MachineBasicBlock *Succ) const;
589
590
0
  void pop_front() { Insts.pop_front(); }
591
0
  void pop_back() { Insts.pop_back(); }
592
2.81k
  void push_back(MachineInstr *MI) { Insts.push_back(MI); }
593
594
  /// Insert MI into the instruction list before I, possibly inside a bundle.
595
  ///
596
  /// If the insertion point is inside a bundle, MI will be added to the bundle,
597
  /// otherwise MI will not be added to any bundle. That means this function
598
  /// alone can't be used to prepend or append instructions to bundles. See
599
  /// MIBundleBuilder::insert() for a more reliable way of doing that.
600
  instr_iterator insert(instr_iterator I, MachineInstr *M);
601
602
  /// Insert a range of instructions into the instruction list before I.
603
  template<typename IT>
604
464
  void insert(iterator I, IT S, IT E) {
605
464
    assert((I == end() || I->getParent() == this) &&
606
464
           "iterator points outside of basic block");
607
464
    Insts.insert(I.getInstrIterator(), S, E);
608
464
  }
609
610
  /// Insert MI into the instruction list before I.
611
69.1M
  iterator insert(iterator I, MachineInstr *MI) {
612
69.1M
    assert((I == end() || I->getParent() == this) &&
613
69.1M
           "iterator points outside of basic block");
614
69.1M
    assert(!MI->isBundledWithPred() && !MI->isBundledWithSucc() &&
615
69.1M
           "Cannot insert instruction with bundle flags");
616
69.1M
    return Insts.insert(I.getInstrIterator(), MI);
617
69.1M
  }
618
619
  /// Insert MI into the instruction list after I.
620
481
  iterator insertAfter(iterator I, MachineInstr *MI) {
621
481
    assert((I == end() || I->getParent() == this) &&
622
481
           "iterator points outside of basic block");
623
481
    assert(!MI->isBundledWithPred() && !MI->isBundledWithSucc() &&
624
481
           "Cannot insert instruction with bundle flags");
625
481
    return Insts.insertAfter(I.getInstrIterator(), MI);
626
481
  }
627
628
  /// Remove an instruction from the instruction list and delete it.
629
  ///
630
  /// If the instruction is part of a bundle, the other instructions in the
631
  /// bundle will still be bundled after removing the single instruction.
632
  instr_iterator erase(instr_iterator I);
633
634
  /// Remove an instruction from the instruction list and delete it.
635
  ///
636
  /// If the instruction is part of a bundle, the other instructions in the
637
  /// bundle will still be bundled after removing the single instruction.
638
2.82M
  instr_iterator erase_instr(MachineInstr *I) {
639
2.82M
    return erase(instr_iterator(I));
640
2.82M
  }
641
642
  /// Remove a range of instructions from the instruction list and delete them.
643
37.9M
  iterator erase(iterator I, iterator E) {
644
37.9M
    return Insts.erase(I.getInstrIterator(), E.getInstrIterator());
645
37.9M
  }
646
647
  /// Remove an instruction or bundle from the instruction list and delete it.
648
  ///
649
  /// If I points to a bundle of instructions, they are all erased.
650
37.6M
  iterator erase(iterator I) {
651
37.6M
    return erase(I, std::next(I));
652
37.6M
  }
653
654
  /// Remove an instruction from the instruction list and delete it.
655
  ///
656
  /// If I is the head of a bundle of instructions, the whole bundle will be
657
  /// erased.
658
34.1M
  iterator erase(MachineInstr *I) {
659
34.1M
    return erase(iterator(I));
660
34.1M
  }
661
662
  /// Remove the unbundled instruction from the instruction list without
663
  /// deleting it.
664
  ///
665
  /// This function can not be used to remove bundled instructions, use
666
  /// remove_instr to remove individual instructions from a bundle.
667
636k
  MachineInstr *remove(MachineInstr *I) {
668
636k
    assert(!I->isBundled() && "Cannot remove bundled instructions");
669
636k
    return Insts.remove(instr_iterator(I));
670
636k
  }
671
672
  /// Remove the possibly bundled instruction from the instruction list
673
  /// without deleting it.
674
  ///
675
  /// If the instruction is part of a bundle, the other instructions in the
676
  /// bundle will still be bundled after removing the single instruction.
677
  MachineInstr *remove_instr(MachineInstr *I);
678
679
145
  void clear() {
680
145
    Insts.clear();
681
145
  }
682
683
  /// Take an instruction from MBB 'Other' at the position From, and insert it
684
  /// into this MBB right before 'Where'.
685
  ///
686
  /// If From points to a bundle of instructions, the whole bundle is moved.
687
1.80M
  void splice(iterator Where, MachineBasicBlock *Other, iterator From) {
688
1.80M
    // The range splice() doesn't allow noop moves, but this one does.
689
1.80M
    if (Where != From)
690
1.80M
      splice(Where, Other, From, std::next(From));
691
1.80M
  }
692
693
  /// Take a block of instructions from MBB 'Other' in the range [From, To),
694
  /// and insert them into this MBB right before 'Where'.
695
  ///
696
  /// The instruction at 'Where' must not be included in the range of
697
  /// instructions to move.
698
  void splice(iterator Where, MachineBasicBlock *Other,
699
5.76M
              iterator From, iterator To) {
700
5.76M
    Insts.splice(Where.getInstrIterator(), Other->Insts,
701
5.76M
                 From.getInstrIterator(), To.getInstrIterator());
702
5.76M
  }
703
704
  /// This method unlinks 'this' from the containing function, and returns it,
705
  /// but does not delete it.
706
  MachineBasicBlock *removeFromParent();
707
708
  /// This method unlinks 'this' from the containing function and deletes it.
709
  void eraseFromParent();
710
711
  /// Given a machine basic block that branched to 'Old', change the code and
712
  /// CFG so that it branches to 'New' instead.
713
  void ReplaceUsesOfBlockWith(MachineBasicBlock *Old, MachineBasicBlock *New);
714
715
  /// Various pieces of code can cause excess edges in the CFG to be inserted.
716
  /// If we have proven that MBB can only branch to DestA and DestB, remove any
717
  /// other MBB successors from the CFG. DestA and DestB can be null. Besides
718
  /// DestA and DestB, retain other edges leading to LandingPads (currently
719
  /// there can be only one; we don't check or require that here). Note it is
720
  /// possible that DestA and/or DestB are LandingPads.
721
  bool CorrectExtraCFGEdges(MachineBasicBlock *DestA,
722
                            MachineBasicBlock *DestB,
723
                            bool IsCond);
724
725
  /// Find the next valid DebugLoc starting at MBBI, skipping any DBG_VALUE
726
  /// and DBG_LABEL instructions.  Return UnknownLoc if there is none.
727
  DebugLoc findDebugLoc(instr_iterator MBBI);
728
482k
  DebugLoc findDebugLoc(iterator MBBI) {
729
482k
    return findDebugLoc(MBBI.getInstrIterator());
730
482k
  }
731
732
  /// Find the previous valid DebugLoc preceding MBBI, skipping and DBG_VALUE
733
  /// instructions.  Return UnknownLoc if there is none.
734
  DebugLoc findPrevDebugLoc(instr_iterator MBBI);
735
3.91k
  DebugLoc findPrevDebugLoc(iterator MBBI) {
736
3.91k
    return findPrevDebugLoc(MBBI.getInstrIterator());
737
3.91k
  }
738
739
  /// Find and return the merged DebugLoc of the branch instructions of the
740
  /// block. Return UnknownLoc if there is none.
741
  DebugLoc findBranchDebugLoc();
742
743
  /// Possible outcome of a register liveness query to computeRegisterLiveness()
744
  enum LivenessQueryResult {
745
    LQR_Live,   ///< Register is known to be (at least partially) live.
746
    LQR_Dead,   ///< Register is known to be fully dead.
747
    LQR_Unknown ///< Register liveness not decidable from local neighborhood.
748
  };
749
750
  /// Return whether (physical) register \p Reg has been defined and not
751
  /// killed as of just before \p Before.
752
  ///
753
  /// Search is localised to a neighborhood of \p Neighborhood instructions
754
  /// before (searching for defs or kills) and \p Neighborhood instructions
755
  /// after (searching just for defs) \p Before.
756
  ///
757
  /// \p Reg must be a physical register.
758
  LivenessQueryResult computeRegisterLiveness(const TargetRegisterInfo *TRI,
759
                                              unsigned Reg,
760
                                              const_iterator Before,
761
                                              unsigned Neighborhood = 10) const;
762
763
  // Debugging methods.
764
  void dump() const;
765
  void print(raw_ostream &OS, const SlotIndexes * = nullptr,
766
             bool IsStandalone = true) const;
767
  void print(raw_ostream &OS, ModuleSlotTracker &MST,
768
             const SlotIndexes * = nullptr, bool IsStandalone = true) const;
769
770
  // Printing method used by LoopInfo.
771
  void printAsOperand(raw_ostream &OS, bool PrintType = true) const;
772
773
  /// MachineBasicBlocks are uniquely numbered at the function level, unless
774
  /// they're not in a MachineFunction yet, in which case this will return -1.
775
821M
  int getNumber() const { return Number; }
776
9.81M
  void setNumber(int N) { Number = N; }
777
778
  /// Return the MCSymbol for this basic block.
779
  MCSymbol *getSymbol() const;
780
781
1.29k
  Optional<uint64_t> getIrrLoopHeaderWeight() const {
782
1.29k
    return IrrLoopHeaderWeight;
783
1.29k
  }
784
785
0
  void setIrrLoopHeaderWeight(uint64_t Weight) {
786
0
    IrrLoopHeaderWeight = Weight;
787
0
  }
788
789
private:
790
  /// Return probability iterator corresponding to the I successor iterator.
791
  probability_iterator getProbabilityIterator(succ_iterator I);
792
  const_probability_iterator
793
  getProbabilityIterator(const_succ_iterator I) const;
794
795
  friend class MachineBranchProbabilityInfo;
796
  friend class MIPrinter;
797
798
  /// Return probability of the edge from this block to MBB. This method should
799
  /// NOT be called directly, but by using getEdgeProbability method from
800
  /// MachineBranchProbabilityInfo class.
801
  BranchProbability getSuccProbability(const_succ_iterator Succ) const;
802
803
  // Methods used to maintain doubly linked list of blocks...
804
  friend struct ilist_callback_traits<MachineBasicBlock>;
805
806
  // Machine-CFG mutators
807
808
  /// Add Pred as a predecessor of this MachineBasicBlock. Don't do this
809
  /// unless you know what you're doing, because it doesn't update Pred's
810
  /// successors list. Use Pred->addSuccessor instead.
811
  void addPredecessor(MachineBasicBlock *Pred);
812
813
  /// Remove Pred as a predecessor of this MachineBasicBlock. Don't do this
814
  /// unless you know what you're doing, because it doesn't update Pred's
815
  /// successors list. Use Pred->removeSuccessor instead.
816
  void removePredecessor(MachineBasicBlock *Pred);
817
};
818
819
raw_ostream& operator<<(raw_ostream &OS, const MachineBasicBlock &MBB);
820
821
/// Prints a machine basic block reference.
822
///
823
/// The format is:
824
///   %bb.5           - a machine basic block with MBB.getNumber() == 5.
825
///
826
/// Usage: OS << printMBBReference(MBB) << '\n';
827
Printable printMBBReference(const MachineBasicBlock &MBB);
828
829
// This is useful when building IndexedMaps keyed on basic block pointers.
830
struct MBB2NumberFunctor {
831
  using argument_type = const MachineBasicBlock *;
832
90.7M
  unsigned operator()(const MachineBasicBlock *MBB) const {
833
90.7M
    return MBB->getNumber();
834
90.7M
  }
835
};
836
837
//===--------------------------------------------------------------------===//
838
// GraphTraits specializations for machine basic block graphs (machine-CFGs)
839
//===--------------------------------------------------------------------===//
840
841
// Provide specializations of GraphTraits to be able to treat a
842
// MachineFunction as a graph of MachineBasicBlocks.
843
//
844
845
template <> struct GraphTraits<MachineBasicBlock *> {
846
  using NodeRef = MachineBasicBlock *;
847
  using ChildIteratorType = MachineBasicBlock::succ_iterator;
848
849
4.60M
  static NodeRef getEntryNode(MachineBasicBlock *BB) { return BB; }
850
60.4M
  static ChildIteratorType child_begin(NodeRef N) { return N->succ_begin(); }
851
103M
  static ChildIteratorType child_end(NodeRef N) { return N->succ_end(); }
852
};
853
854
template <> struct GraphTraits<const MachineBasicBlock *> {
855
  using NodeRef = const MachineBasicBlock *;
856
  using ChildIteratorType = MachineBasicBlock::const_succ_iterator;
857
858
2.05M
  static NodeRef getEntryNode(const MachineBasicBlock *BB) { return BB; }
859
29.8M
  static ChildIteratorType child_begin(NodeRef N) { return N->succ_begin(); }
860
45.3M
  static ChildIteratorType child_end(NodeRef N) { return N->succ_end(); }
861
};
862
863
// Provide specializations of GraphTraits to be able to treat a
864
// MachineFunction as a graph of MachineBasicBlocks and to walk it
865
// in inverse order.  Inverse order for a function is considered
866
// to be when traversing the predecessor edges of a MBB
867
// instead of the successor edges.
868
//
869
template <> struct GraphTraits<Inverse<MachineBasicBlock*>> {
870
  using NodeRef = MachineBasicBlock *;
871
  using ChildIteratorType = MachineBasicBlock::pred_iterator;
872
873
  static NodeRef getEntryNode(Inverse<MachineBasicBlock *> G) {
874
    return G.Graph;
875
  }
876
877
30.9M
  static ChildIteratorType child_begin(NodeRef N) { return N->pred_begin(); }
878
30.9M
  static ChildIteratorType child_end(NodeRef N) { return N->pred_end(); }
879
};
880
881
template <> struct GraphTraits<Inverse<const MachineBasicBlock*>> {
882
  using NodeRef = const MachineBasicBlock *;
883
  using ChildIteratorType = MachineBasicBlock::const_pred_iterator;
884
885
139k
  static NodeRef getEntryNode(Inverse<const MachineBasicBlock *> G) {
886
139k
    return G.Graph;
887
139k
  }
888
889
579k
  static ChildIteratorType child_begin(NodeRef N) { return N->pred_begin(); }
890
1.42M
  static ChildIteratorType child_end(NodeRef N) { return N->pred_end(); }
891
};
892
893
/// MachineInstrSpan provides an interface to get an iteration range
894
/// containing the instruction it was initialized with, along with all
895
/// those instructions inserted prior to or following that instruction
896
/// at some point after the MachineInstrSpan is constructed.
897
class MachineInstrSpan {
898
  MachineBasicBlock &MBB;
899
  MachineBasicBlock::iterator I, B, E;
900
901
public:
902
  MachineInstrSpan(MachineBasicBlock::iterator I)
903
    : MBB(*I->getParent()),
904
      I(I),
905
      B(I == MBB.begin() ? MBB.end() : std::prev(I)),
906
556k
      E(std::next(I)) {}
907
908
346k
  MachineBasicBlock::iterator begin() {
909
346k
    return B == MBB.end() ? 
MBB.begin()58.3k
:
std::next(B)288k
;
910
346k
  }
911
306k
  MachineBasicBlock::iterator end() { return E; }
912
  bool empty() { return begin() == end(); }
913
914
  MachineBasicBlock::iterator getInitial() { return I; }
915
};
916
917
/// Increment \p It until it points to a non-debug instruction or to \p End
918
/// and return the resulting iterator. This function should only be used
919
/// MachineBasicBlock::{iterator, const_iterator, instr_iterator,
920
/// const_instr_iterator} and the respective reverse iterators.
921
template<typename IterT>
922
235M
inline IterT skipDebugInstructionsForward(IterT It, IterT End) {
923
235M
  while (It != End && 
It->isDebugInstr()235M
)
924
745
    It++;
925
235M
  return It;
926
235M
}
llvm::ilist_iterator<llvm::ilist_detail::node_options<llvm::MachineInstr, true, true, void>, false, true> llvm::skipDebugInstructionsForward<llvm::ilist_iterator<llvm::ilist_detail::node_options<llvm::MachineInstr, true, true, void>, false, true> >(llvm::ilist_iterator<llvm::ilist_detail::node_options<llvm::MachineInstr, true, true, void>, false, true>, llvm::ilist_iterator<llvm::ilist_detail::node_options<llvm::MachineInstr, true, true, void>, false, true>)
Line
Count
Source
922
212M
inline IterT skipDebugInstructionsForward(IterT It, IterT End) {
923
212M
  while (It != End && 
It->isDebugInstr()212M
)
924
0
    It++;
925
212M
  return It;
926
212M
}
llvm::MachineInstrBundleIterator<llvm::MachineInstr const, false> llvm::skipDebugInstructionsForward<llvm::MachineInstrBundleIterator<llvm::MachineInstr const, false> >(llvm::MachineInstrBundleIterator<llvm::MachineInstr const, false>, llvm::MachineInstrBundleIterator<llvm::MachineInstr const, false>)
Line
Count
Source
922
2.65M
inline IterT skipDebugInstructionsForward(IterT It, IterT End) {
923
2.65M
  while (It != End && 
It->isDebugInstr()2.45M
)
924
86
    It++;
925
2.65M
  return It;
926
2.65M
}
llvm::MachineInstrBundleIterator<llvm::MachineInstr, false> llvm::skipDebugInstructionsForward<llvm::MachineInstrBundleIterator<llvm::MachineInstr, false> >(llvm::MachineInstrBundleIterator<llvm::MachineInstr, false>, llvm::MachineInstrBundleIterator<llvm::MachineInstr, false>)
Line
Count
Source
922
20.3M
inline IterT skipDebugInstructionsForward(IterT It, IterT End) {
923
20.3M
  while (It != End && 
It->isDebugInstr()20.0M
)
924
245
    It++;
925
20.3M
  return It;
926
20.3M
}
llvm::MachineInstrBundleIterator<llvm::MachineInstr, true> llvm::skipDebugInstructionsForward<llvm::MachineInstrBundleIterator<llvm::MachineInstr, true> >(llvm::MachineInstrBundleIterator<llvm::MachineInstr, true>, llvm::MachineInstrBundleIterator<llvm::MachineInstr, true>)
Line
Count
Source
922
6.65k
inline IterT skipDebugInstructionsForward(IterT It, IterT End) {
923
6.65k
  while (It != End && It->isDebugInstr())
924
2
    It++;
925
6.65k
  return It;
926
6.65k
}
llvm::ilist_iterator<llvm::ilist_detail::node_options<llvm::MachineInstr, true, true, void>, false, false> llvm::skipDebugInstructionsForward<llvm::ilist_iterator<llvm::ilist_detail::node_options<llvm::MachineInstr, true, true, void>, false, false> >(llvm::ilist_iterator<llvm::ilist_detail::node_options<llvm::MachineInstr, true, true, void>, false, false>, llvm::ilist_iterator<llvm::ilist_detail::node_options<llvm::MachineInstr, true, true, void>, false, false>)
Line
Count
Source
922
482k
inline IterT skipDebugInstructionsForward(IterT It, IterT End) {
923
482k
  while (It != End && 
It->isDebugInstr()482k
)
924
412
    It++;
925
482k
  return It;
926
482k
}
927
928
/// Decrement \p It until it points to a non-debug instruction or to \p Begin
929
/// and return the resulting iterator. This function should only be used
930
/// MachineBasicBlock::{iterator, const_iterator, instr_iterator,
931
/// const_instr_iterator} and the respective reverse iterators.
932
template<class IterT>
933
6.64M
inline IterT skipDebugInstructionsBackward(IterT It, IterT Begin) {
934
6.64M
  while (It != Begin && 
It->isDebugInstr()6.21M
)
935
208
    It--;
936
6.64M
  return It;
937
6.64M
}
llvm::MachineInstrBundleIterator<llvm::MachineInstr, false> llvm::skipDebugInstructionsBackward<llvm::MachineInstrBundleIterator<llvm::MachineInstr, false> >(llvm::MachineInstrBundleIterator<llvm::MachineInstr, false>, llvm::MachineInstrBundleIterator<llvm::MachineInstr, false>)
Line
Count
Source
933
872k
inline IterT skipDebugInstructionsBackward(IterT It, IterT Begin) {
934
872k
  while (It != Begin && 
It->isDebugInstr()679k
)
935
16
    It--;
936
872k
  return It;
937
872k
}
llvm::ilist_iterator<llvm::ilist_detail::node_options<llvm::MachineInstr, true, true, void>, false, false> llvm::skipDebugInstructionsBackward<llvm::ilist_iterator<llvm::ilist_detail::node_options<llvm::MachineInstr, true, true, void>, false, false> >(llvm::ilist_iterator<llvm::ilist_detail::node_options<llvm::MachineInstr, true, true, void>, false, false>, llvm::ilist_iterator<llvm::ilist_detail::node_options<llvm::MachineInstr, true, true, void>, false, false>)
Line
Count
Source
933
3.66k
inline IterT skipDebugInstructionsBackward(IterT It, IterT Begin) {
934
3.66k
  while (It != Begin && 
It->isDebugInstr()3.51k
)
935
0
    It--;
936
3.66k
  return It;
937
3.66k
}
llvm::MachineInstrBundleIterator<llvm::MachineInstr const, false> llvm::skipDebugInstructionsBackward<llvm::MachineInstrBundleIterator<llvm::MachineInstr const, false> >(llvm::MachineInstrBundleIterator<llvm::MachineInstr const, false>, llvm::MachineInstrBundleIterator<llvm::MachineInstr const, false>)
Line
Count
Source
933
5.76M
inline IterT skipDebugInstructionsBackward(IterT It, IterT Begin) {
934
5.76M
  while (It != Begin && 
It->isDebugInstr()5.53M
)
935
192
    It--;
936
5.76M
  return It;
937
5.76M
}
938
939
} // end namespace llvm
940
941
#endif // LLVM_CODEGEN_MACHINEBASICBLOCK_H