LLVM  14.0.0git
PPCBranchSelector.cpp
Go to the documentation of this file.
1 //===-- PPCBranchSelector.cpp - Emit long conditional branches ------------===//
2 //
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6 //
7 //===----------------------------------------------------------------------===//
8 //
9 // This file contains a pass that scans a machine function to determine which
10 // conditional branches need more than 16 bits of displacement to reach their
11 // target basic block. It does this in two passes; a calculation of basic block
12 // positions pass, and a branch pseudo op to machine branch opcode pass. This
13 // pass should be run last, just before the assembly printer.
14 //
15 //===----------------------------------------------------------------------===//
16 
18 #include "PPC.h"
19 #include "PPCInstrBuilder.h"
20 #include "PPCInstrInfo.h"
21 #include "PPCSubtarget.h"
22 #include "llvm/ADT/Statistic.h"
28 #include <algorithm>
29 using namespace llvm;
30 
31 #define DEBUG_TYPE "ppc-branch-select"
32 
33 STATISTIC(NumExpanded, "Number of branches expanded to long format");
34 STATISTIC(NumPrefixed, "Number of prefixed instructions");
35 STATISTIC(NumPrefixedAligned,
36  "Number of prefixed instructions that have been aligned");
37 
38 namespace {
39  struct PPCBSel : public MachineFunctionPass {
40  static char ID;
41  PPCBSel() : MachineFunctionPass(ID) {
43  }
44 
45  // The sizes of the basic blocks in the function (the first
46  // element of the pair); the second element of the pair is the amount of the
47  // size that is due to potential padding.
48  std::vector<std::pair<unsigned, unsigned>> BlockSizes;
49 
50  // The first block number which has imprecise instruction address.
51  int FirstImpreciseBlock = -1;
52 
53  unsigned GetAlignmentAdjustment(MachineBasicBlock &MBB, unsigned Offset);
54  unsigned ComputeBlockSizes(MachineFunction &Fn);
55  void modifyAdjustment(MachineFunction &Fn);
56  int computeBranchSize(MachineFunction &Fn,
57  const MachineBasicBlock *Src,
58  const MachineBasicBlock *Dest,
59  unsigned BrOffset);
60 
61  bool runOnMachineFunction(MachineFunction &Fn) override;
62 
63  MachineFunctionProperties getRequiredProperties() const override {
66  }
67 
68  StringRef getPassName() const override { return "PowerPC Branch Selector"; }
69  };
70  char PPCBSel::ID = 0;
71 }
72 
73 INITIALIZE_PASS(PPCBSel, "ppc-branch-select", "PowerPC Branch Selector",
74  false, false)
75 
76 /// createPPCBranchSelectionPass - returns an instance of the Branch Selection
77 /// Pass
78 ///
80  return new PPCBSel();
81 }
82 
83 /// In order to make MBB aligned, we need to add an adjustment value to the
84 /// original Offset.
85 unsigned PPCBSel::GetAlignmentAdjustment(MachineBasicBlock &MBB,
86  unsigned Offset) {
87  const Align Alignment = MBB.getAlignment();
88  if (Alignment == Align(1))
89  return 0;
90 
91  const Align ParentAlign = MBB.getParent()->getAlignment();
92 
93  if (Alignment <= ParentAlign)
94  return offsetToAlignment(Offset, Alignment);
95 
96  // The alignment of this MBB is larger than the function's alignment, so we
97  // can't tell whether or not it will insert nops. Assume that it will.
98  if (FirstImpreciseBlock < 0)
99  FirstImpreciseBlock = MBB.getNumber();
100  return Alignment.value() + offsetToAlignment(Offset, Alignment);
101 }
102 
103 /// We need to be careful about the offset of the first block in the function
104 /// because it might not have the function's alignment. This happens because,
105 /// under the ELFv2 ABI, for functions which require a TOC pointer, we add a
106 /// two-instruction sequence to the start of the function.
107 /// Note: This needs to be synchronized with the check in
108 /// PPCLinuxAsmPrinter::EmitFunctionBodyStart.
109 static inline unsigned GetInitialOffset(MachineFunction &Fn) {
110  unsigned InitialOffset = 0;
111  if (Fn.getSubtarget<PPCSubtarget>().isELFv2ABI() &&
112  !Fn.getRegInfo().use_empty(PPC::X2))
113  InitialOffset = 8;
114  return InitialOffset;
115 }
116 
117 /// Measure each MBB and compute a size for the entire function.
118 unsigned PPCBSel::ComputeBlockSizes(MachineFunction &Fn) {
119  const PPCInstrInfo *TII =
120  static_cast<const PPCInstrInfo *>(Fn.getSubtarget().getInstrInfo());
121  unsigned FuncSize = GetInitialOffset(Fn);
122 
123  for (MachineFunction::iterator MFI = Fn.begin(), E = Fn.end(); MFI != E;
124  ++MFI) {
125  MachineBasicBlock *MBB = &*MFI;
126 
127  // The end of the previous block may have extra nops if this block has an
128  // alignment requirement.
129  if (MBB->getNumber() > 0) {
130  unsigned AlignExtra = GetAlignmentAdjustment(*MBB, FuncSize);
131 
132  auto &BS = BlockSizes[MBB->getNumber()-1];
133  BS.first += AlignExtra;
134  BS.second = AlignExtra;
135 
136  FuncSize += AlignExtra;
137  }
138 
139  unsigned BlockSize = 0;
140  unsigned UnalignedBytesRemaining = 0;
141  for (MachineInstr &MI : *MBB) {
142  unsigned MINumBytes = TII->getInstSizeInBytes(MI);
143  if (MI.isInlineAsm() && (FirstImpreciseBlock < 0))
144  FirstImpreciseBlock = MBB->getNumber();
145  if (TII->isPrefixed(MI.getOpcode())) {
146  NumPrefixed++;
147 
148  // All 8 byte instructions may require alignment. Each 8 byte
149  // instruction may be aligned by another 4 bytes.
150  // This means that an 8 byte instruction may require 12 bytes
151  // (8 for the instruction itself and 4 for the alignment nop).
152  // This will happen if an 8 byte instruction can be aligned to 64 bytes
153  // by only adding a 4 byte nop.
154  // We don't know the alignment at this point in the code so we have to
155  // adopt a more pessimistic approach. If an instruction may need
156  // alignment we assume that it does need alignment and add 4 bytes to
157  // it. As a result we may end up with more long branches than before
158  // but we are in the safe position where if we need a long branch we
159  // have one.
160  // The if statement checks to make sure that two 8 byte instructions
161  // are at least 64 bytes away from each other. It is not possible for
162  // two instructions that both need alignment to be within 64 bytes of
163  // each other.
164  if (!UnalignedBytesRemaining) {
165  BlockSize += 4;
166  UnalignedBytesRemaining = 60;
167  NumPrefixedAligned++;
168  }
169  }
170  UnalignedBytesRemaining -= std::min(UnalignedBytesRemaining, MINumBytes);
171  BlockSize += MINumBytes;
172  }
173 
174  BlockSizes[MBB->getNumber()].first = BlockSize;
175  FuncSize += BlockSize;
176  }
177 
178  return FuncSize;
179 }
180 
181 /// Modify the basic block align adjustment.
182 void PPCBSel::modifyAdjustment(MachineFunction &Fn) {
183  unsigned Offset = GetInitialOffset(Fn);
184  for (MachineFunction::iterator MFI = Fn.begin(), E = Fn.end(); MFI != E;
185  ++MFI) {
186  MachineBasicBlock *MBB = &*MFI;
187 
188  if (MBB->getNumber() > 0) {
189  auto &BS = BlockSizes[MBB->getNumber()-1];
190  BS.first -= BS.second;
191  Offset -= BS.second;
192 
193  unsigned AlignExtra = GetAlignmentAdjustment(*MBB, Offset);
194 
195  BS.first += AlignExtra;
196  BS.second = AlignExtra;
197 
198  Offset += AlignExtra;
199  }
200 
201  Offset += BlockSizes[MBB->getNumber()].first;
202  }
203 }
204 
205 /// Determine the offset from the branch in Src block to the Dest block.
206 /// BrOffset is the offset of the branch instruction inside Src block.
207 int PPCBSel::computeBranchSize(MachineFunction &Fn,
208  const MachineBasicBlock *Src,
209  const MachineBasicBlock *Dest,
210  unsigned BrOffset) {
211  int BranchSize;
212  Align MaxAlign = Align(4);
213  bool NeedExtraAdjustment = false;
214  if (Dest->getNumber() <= Src->getNumber()) {
215  // If this is a backwards branch, the delta is the offset from the
216  // start of this block to this branch, plus the sizes of all blocks
217  // from this block to the dest.
218  BranchSize = BrOffset;
219  MaxAlign = std::max(MaxAlign, Src->getAlignment());
220 
221  int DestBlock = Dest->getNumber();
222  BranchSize += BlockSizes[DestBlock].first;
223  for (unsigned i = DestBlock+1, e = Src->getNumber(); i < e; ++i) {
224  BranchSize += BlockSizes[i].first;
225  MaxAlign = std::max(MaxAlign, Fn.getBlockNumbered(i)->getAlignment());
226  }
227 
228  NeedExtraAdjustment = (FirstImpreciseBlock >= 0) &&
229  (DestBlock >= FirstImpreciseBlock);
230  } else {
231  // Otherwise, add the size of the blocks between this block and the
232  // dest to the number of bytes left in this block.
233  unsigned StartBlock = Src->getNumber();
234  BranchSize = BlockSizes[StartBlock].first - BrOffset;
235 
236  MaxAlign = std::max(MaxAlign, Dest->getAlignment());
237  for (unsigned i = StartBlock+1, e = Dest->getNumber(); i != e; ++i) {
238  BranchSize += BlockSizes[i].first;
239  MaxAlign = std::max(MaxAlign, Fn.getBlockNumbered(i)->getAlignment());
240  }
241 
242  NeedExtraAdjustment = (FirstImpreciseBlock >= 0) &&
243  (Src->getNumber() >= FirstImpreciseBlock);
244  }
245 
246  // We tend to over estimate code size due to large alignment and
247  // inline assembly. Usually it causes larger computed branch offset.
248  // But sometimes it may also causes smaller computed branch offset
249  // than actual branch offset. If the offset is close to the limit of
250  // encoding, it may cause problem at run time.
251  // Following is a simplified example.
252  //
253  // actual estimated
254  // address address
255  // ...
256  // bne Far 100 10c
257  // .p2align 4
258  // Near: 110 110
259  // ...
260  // Far: 8108 8108
261  //
262  // Actual offset: 0x8108 - 0x100 = 0x8008
263  // Computed offset: 0x8108 - 0x10c = 0x7ffc
264  //
265  // This example also shows when we can get the largest gap between
266  // estimated offset and actual offset. If there is an aligned block
267  // ABB between branch and target, assume its alignment is <align>
268  // bits. Now consider the accumulated function size FSIZE till the end
269  // of previous block PBB. If the estimated FSIZE is multiple of
270  // 2^<align>, we don't need any padding for the estimated address of
271  // ABB. If actual FSIZE at the end of PBB is 4 bytes more than
272  // multiple of 2^<align>, then we need (2^<align> - 4) bytes of
273  // padding. It also means the actual branch offset is (2^<align> - 4)
274  // larger than computed offset. Other actual FSIZE needs less padding
275  // bytes, so causes smaller gap between actual and computed offset.
276  //
277  // On the other hand, if the inline asm or large alignment occurs
278  // between the branch block and destination block, the estimated address
279  // can be <delta> larger than actual address. If padding bytes are
280  // needed for a later aligned block, the actual number of padding bytes
281  // is at most <delta> more than estimated padding bytes. So the actual
282  // aligned block address is less than or equal to the estimated aligned
283  // block address. So the actual branch offset is less than or equal to
284  // computed branch offset.
285  //
286  // The computed offset is at most ((1 << alignment) - 4) bytes smaller
287  // than actual offset. So we add this number to the offset for safety.
288  if (NeedExtraAdjustment)
289  BranchSize += MaxAlign.value() - 4;
290 
291  return BranchSize;
292 }
293 
294 bool PPCBSel::runOnMachineFunction(MachineFunction &Fn) {
295  const PPCInstrInfo *TII =
296  static_cast<const PPCInstrInfo *>(Fn.getSubtarget().getInstrInfo());
297  // Give the blocks of the function a dense, in-order, numbering.
298  Fn.RenumberBlocks();
299  BlockSizes.resize(Fn.getNumBlockIDs());
300  FirstImpreciseBlock = -1;
301 
302  // Measure each MBB and compute a size for the entire function.
303  unsigned FuncSize = ComputeBlockSizes(Fn);
304 
305  // If the entire function is smaller than the displacement of a branch field,
306  // we know we don't need to shrink any branches in this function. This is a
307  // common case.
308  if (FuncSize < (1 << 15)) {
309  BlockSizes.clear();
310  return false;
311  }
312 
313  // For each conditional branch, if the offset to its destination is larger
314  // than the offset field allows, transform it into a long branch sequence
315  // like this:
316  // short branch:
317  // bCC MBB
318  // long branch:
319  // b!CC $PC+8
320  // b MBB
321  //
322  bool MadeChange = true;
323  bool EverMadeChange = false;
324  while (MadeChange) {
325  // Iteratively expand branches until we reach a fixed point.
326  MadeChange = false;
327 
328  for (MachineFunction::iterator MFI = Fn.begin(), E = Fn.end(); MFI != E;
329  ++MFI) {
330  MachineBasicBlock &MBB = *MFI;
331  unsigned MBBStartOffset = 0;
333  I != E; ++I) {
334  MachineBasicBlock *Dest = nullptr;
335  if (I->getOpcode() == PPC::BCC && !I->getOperand(2).isImm())
336  Dest = I->getOperand(2).getMBB();
337  else if ((I->getOpcode() == PPC::BC || I->getOpcode() == PPC::BCn) &&
338  !I->getOperand(1).isImm())
339  Dest = I->getOperand(1).getMBB();
340  else if ((I->getOpcode() == PPC::BDNZ8 || I->getOpcode() == PPC::BDNZ ||
341  I->getOpcode() == PPC::BDZ8 || I->getOpcode() == PPC::BDZ) &&
342  !I->getOperand(0).isImm())
343  Dest = I->getOperand(0).getMBB();
344 
345  if (!Dest) {
346  MBBStartOffset += TII->getInstSizeInBytes(*I);
347  continue;
348  }
349 
350  // Determine the offset from the current branch to the destination
351  // block.
352  int BranchSize = computeBranchSize(Fn, &MBB, Dest, MBBStartOffset);
353 
354  // If this branch is in range, ignore it.
355  if (isInt<16>(BranchSize)) {
356  MBBStartOffset += 4;
357  continue;
358  }
359 
360  // Otherwise, we have to expand it to a long branch.
361  MachineInstr &OldBranch = *I;
362  DebugLoc dl = OldBranch.getDebugLoc();
363 
364  if (I->getOpcode() == PPC::BCC) {
365  // The BCC operands are:
366  // 0. PPC branch predicate
367  // 1. CR register
368  // 2. Target MBB
369  PPC::Predicate Pred = (PPC::Predicate)I->getOperand(0).getImm();
370  Register CRReg = I->getOperand(1).getReg();
371 
372  // Jump over the uncond branch inst (i.e. $PC+8) on opposite condition.
373  BuildMI(MBB, I, dl, TII->get(PPC::BCC))
374  .addImm(PPC::InvertPredicate(Pred)).addReg(CRReg).addImm(2);
375  } else if (I->getOpcode() == PPC::BC) {
376  Register CRBit = I->getOperand(0).getReg();
377  BuildMI(MBB, I, dl, TII->get(PPC::BCn)).addReg(CRBit).addImm(2);
378  } else if (I->getOpcode() == PPC::BCn) {
379  Register CRBit = I->getOperand(0).getReg();
380  BuildMI(MBB, I, dl, TII->get(PPC::BC)).addReg(CRBit).addImm(2);
381  } else if (I->getOpcode() == PPC::BDNZ) {
382  BuildMI(MBB, I, dl, TII->get(PPC::BDZ)).addImm(2);
383  } else if (I->getOpcode() == PPC::BDNZ8) {
384  BuildMI(MBB, I, dl, TII->get(PPC::BDZ8)).addImm(2);
385  } else if (I->getOpcode() == PPC::BDZ) {
386  BuildMI(MBB, I, dl, TII->get(PPC::BDNZ)).addImm(2);
387  } else if (I->getOpcode() == PPC::BDZ8) {
388  BuildMI(MBB, I, dl, TII->get(PPC::BDNZ8)).addImm(2);
389  } else {
390  llvm_unreachable("Unhandled branch type!");
391  }
392 
393  // Uncond branch to the real destination.
394  I = BuildMI(MBB, I, dl, TII->get(PPC::B)).addMBB(Dest);
395 
396  // Remove the old branch from the function.
397  OldBranch.eraseFromParent();
398 
399  // Remember that this instruction is 8-bytes, increase the size of the
400  // block by 4, remember to iterate.
401  BlockSizes[MBB.getNumber()].first += 4;
402  MBBStartOffset += 8;
403  ++NumExpanded;
404  MadeChange = true;
405  }
406  }
407 
408  if (MadeChange) {
409  // If we're going to iterate again, make sure we've updated our
410  // padding-based contributions to the block sizes.
411  modifyAdjustment(Fn);
412  }
413 
414  EverMadeChange |= MadeChange;
415  }
416 
417  BlockSizes.clear();
418  return EverMadeChange;
419 }
i
i
Definition: README.txt:29
MI
IRTranslator LLVM IR MI
Definition: IRTranslator.cpp:103
MathExtras.h
llvm::MachineInstrBuilder::addImm
const MachineInstrBuilder & addImm(int64_t Val) const
Add a new immediate operand.
Definition: MachineInstrBuilder.h:131
llvm
---------------------— PointerInfo ------------------------------------—
Definition: AllocatorList.h:23
BlockSize
static const int BlockSize
Definition: TarWriter.cpp:33
llvm::PPCISD::BDNZ
@ BDNZ
CHAIN = BDNZ CHAIN, DESTBB - These are used to create counter-based loops.
Definition: PPCISelLowering.h:288
llvm::TargetSubtargetInfo::getInstrInfo
virtual const TargetInstrInfo * getInstrInfo() const
Definition: TargetSubtargetInfo.h:92
PPCInstrBuilder.h
Statistic.h
llvm::MachineFunction::end
iterator end()
Definition: MachineFunction.h:810
llvm::MachineFunctionPass
MachineFunctionPass - This class adapts the FunctionPass interface to allow convenient creation of pa...
Definition: MachineFunctionPass.h:30
llvm::PPCInstrInfo
Definition: PPCInstrInfo.h:191
llvm::MachineFunction::getNumBlockIDs
unsigned getNumBlockIDs() const
getNumBlockIDs - Return the number of MBB ID's allocated.
Definition: MachineFunction.h:753
llvm::PPC::InvertPredicate
Predicate InvertPredicate(Predicate Opcode)
Invert the specified predicate. != -> ==, < -> >=.
llvm::MachineFunctionProperties
Properties which a MachineFunction may have at a given point in time.
Definition: MachineFunction.h:111
Offset
uint64_t Offset
Definition: ELFObjHandler.cpp:81
GetInitialOffset
static unsigned GetInitialOffset(MachineFunction &Fn)
We need to be careful about the offset of the first block in the function because it might not have t...
Definition: PPCBranchSelector.cpp:109
llvm::PPCISD::BDZ
@ BDZ
Definition: PPCISelLowering.h:289
MachineRegisterInfo.h
PPCSubtarget.h
llvm::MachineFunction::getRegInfo
MachineRegisterInfo & getRegInfo()
getRegInfo - Return information about the registers currently in use.
Definition: MachineFunction.h:636
TargetMachine.h
llvm::PassRegistry::getPassRegistry
static PassRegistry * getPassRegistry()
getPassRegistry - Access the global registry object, which is automatically initialized at applicatio...
Definition: PassRegistry.cpp:31
llvm::MachineInstrBuilder::addMBB
const MachineInstrBuilder & addMBB(MachineBasicBlock *MBB, unsigned TargetFlags=0) const
Definition: MachineInstrBuilder.h:146
llvm::PPCSubtarget
Definition: PPCSubtarget.h:71
E
static GCRegistry::Add< CoreCLRGC > E("coreclr", "CoreCLR-compatible GC")
TII
const HexagonInstrInfo * TII
Definition: HexagonCopyToCombine.cpp:129
B
static GCRegistry::Add< OcamlGC > B("ocaml", "ocaml 3.10-compatible GC")
llvm::MachineFunctionProperties::set
MachineFunctionProperties & set(Property P)
Definition: MachineFunction.h:169
llvm::STATISTIC
STATISTIC(NumFunctions, "Total number of functions")
llvm::initializePPCBSelPass
void initializePPCBSelPass(PassRegistry &)
PPC.h
llvm::MachineFunction::begin
iterator begin()
Definition: MachineFunction.h:808
Align
uint64_t Align
Definition: ELFObjHandler.cpp:83
llvm::Align
This struct is a compact representation of a valid (non-zero power of two) alignment.
Definition: Alignment.h:39
llvm::MachineRegisterInfo::use_empty
bool use_empty(Register RegNo) const
use_empty - Return true if there are no instructions using the specified register.
Definition: MachineRegisterInfo.h:506
llvm::MachineBasicBlock
Definition: MachineBasicBlock.h:95
llvm::MachineFunctionProperties::Property::NoVRegs
@ NoVRegs
llvm::MachineFunction::getSubtarget
const TargetSubtargetInfo & getSubtarget() const
getSubtarget - Return the subtarget for which this machine code is being compiled.
Definition: MachineFunction.h:626
llvm::MachineInstr::getDebugLoc
const DebugLoc & getDebugLoc() const
Returns the debug location id of this MachineInstr.
Definition: MachineInstr.h:418
llvm::PPC::Predicate
Predicate
Predicate - These are "(BI << 5) | BO" for various predicates.
Definition: PPCPredicates.h:26
llvm::MachineInstr
Representation of each machine instruction.
Definition: MachineInstr.h:64
llvm::numbers::e
constexpr double e
Definition: MathExtras.h:57
PPCInstrInfo.h
I
#define I(x, y, z)
Definition: MD5.cpp:59
llvm::MachineBasicBlock::getAlignment
Align getAlignment() const
Return alignment of the basic block.
Definition: MachineBasicBlock.h:519
MachineFunctionPass.h
llvm::MachineBasicBlock::getParent
const MachineFunction * getParent() const
Return the MachineFunction containing this basic block.
Definition: MachineBasicBlock.h:225
llvm::MachineInstrBuilder::addReg
const MachineInstrBuilder & addReg(Register RegNo, unsigned flags=0, unsigned SubReg=0) const
Add a new virtual register operand.
Definition: MachineInstrBuilder.h:97
llvm::MachineFunction
Definition: MachineFunction.h:230
llvm::createPPCBranchSelectionPass
FunctionPass * createPPCBranchSelectionPass()
llvm::MachineBasicBlock::getNumber
int getNumber() const
MachineBasicBlocks are uniquely numbered at the function level, unless they're not in a MachineFuncti...
Definition: MachineBasicBlock.h:1056
llvm::min
Expected< ExpressionValue > min(const ExpressionValue &Lhs, const ExpressionValue &Rhs)
Definition: FileCheck.cpp:357
llvm::StringRef
StringRef - Represent a constant reference to a string, i.e.
Definition: StringRef.h:58
llvm_unreachable
#define llvm_unreachable(msg)
Marks that the current location is not supposed to be reachable.
Definition: ErrorHandling.h:136
TargetSubtargetInfo.h
llvm::Register
Wrapper class representing virtual and physical registers.
Definition: Register.h:19
MBB
MachineBasicBlock & MBB
Definition: AArch64SLSHardening.cpp:74
llvm::isInt< 16 >
constexpr bool isInt< 16 >(int64_t x)
Definition: MathExtras.h:370
llvm::MachineFunction::getBlockNumbered
MachineBasicBlock * getBlockNumbered(unsigned N) const
getBlockNumbered - MachineBasicBlocks are automatically numbered when they are inserted into the mach...
Definition: MachineFunction.h:743
llvm::ilist_iterator
Iterator for intrusive lists based on ilist_node.
Definition: ilist_iterator.h:57
llvm::Align::value
uint64_t value() const
This is a hole in the type system and should not be abused.
Definition: Alignment.h:85
llvm::MachineBasicBlock::begin
iterator begin()
Definition: MachineBasicBlock.h:268
llvm::BuildMI
MachineInstrBuilder BuildMI(MachineFunction &MF, const DebugLoc &DL, const MCInstrDesc &MCID)
Builder interface. Specify how to create the initial instruction itself.
Definition: MachineInstrBuilder.h:328
llvm::max
Align max(MaybeAlign Lhs, Align Rhs)
Definition: Alignment.h:340
llvm::FunctionPass
FunctionPass class - This class is used to implement most global optimizations.
Definition: Pass.h:298
INITIALIZE_PASS
INITIALIZE_PASS(PPCBSel, "ppc-branch-select", "PowerPC Branch Selector", false, false) FunctionPass *llvm
createPPCBranchSelectionPass - returns an instance of the Branch Selection Pass
Definition: PPCBranchSelector.cpp:73
llvm::DebugLoc
A debug info location.
Definition: DebugLoc.h:33
PPCPredicates.h
llvm::MachineInstr::eraseFromParent
void eraseFromParent()
Unlink 'this' from the containing basic block and delete it.
Definition: MachineInstr.cpp:677
llvm::MachineInstrBundleIterator< MachineInstr >
llvm::MachineFunction::getAlignment
Align getAlignment() const
getAlignment - Return the alignment of the function.
Definition: MachineFunction.h:674
llvm::offsetToAlignment
uint64_t offsetToAlignment(uint64_t Value, Align Alignment)
Returns the offset to the next integer (mod 2**64) that is greater than or equal to Value and is a mu...
Definition: Alignment.h:196
llvm::MachineBasicBlock::end
iterator end()
Definition: MachineBasicBlock.h:270
llvm::MachineFunction::RenumberBlocks
void RenumberBlocks(MachineBasicBlock *MBBFrom=nullptr)
RenumberBlocks - This discards all of the MachineBasicBlock numbers and recomputes them.
Definition: MachineFunction.cpp:294
llvm::Intrinsic::ID
unsigned ID
Definition: TargetTransformInfo.h:37
llvm::PPCSubtarget::isELFv2ABI
bool isELFv2ABI() const
Definition: PPCSubtarget.cpp:242