LLVM  13.0.0git
MIRPrinter.cpp
Go to the documentation of this file.
1 //===- MIRPrinter.cpp - MIR serialization format printer ------------------===//
2 //
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6 //
7 //===----------------------------------------------------------------------===//
8 //
9 // This file implements the class that prints out the LLVM IR and machine
10 // functions using the MIR serialization format.
11 //
12 //===----------------------------------------------------------------------===//
13 
15 #include "llvm/ADT/DenseMap.h"
16 #include "llvm/ADT/None.h"
17 #include "llvm/ADT/STLExtras.h"
19 #include "llvm/ADT/SmallPtrSet.h"
20 #include "llvm/ADT/SmallVector.h"
21 #include "llvm/ADT/StringRef.h"
22 #include "llvm/ADT/Twine.h"
39 #include "llvm/IR/BasicBlock.h"
40 #include "llvm/IR/Constants.h"
41 #include "llvm/IR/DebugInfo.h"
42 #include "llvm/IR/DebugLoc.h"
43 #include "llvm/IR/Function.h"
44 #include "llvm/IR/GlobalValue.h"
46 #include "llvm/IR/InstrTypes.h"
47 #include "llvm/IR/Instructions.h"
48 #include "llvm/IR/Intrinsics.h"
49 #include "llvm/IR/Module.h"
51 #include "llvm/IR/Value.h"
52 #include "llvm/MC/LaneBitmask.h"
53 #include "llvm/MC/MCContext.h"
54 #include "llvm/MC/MCDwarf.h"
55 #include "llvm/MC/MCSymbol.h"
58 #include "llvm/Support/Casting.h"
61 #include "llvm/Support/Format.h"
67 #include <algorithm>
68 #include <cassert>
69 #include <cinttypes>
70 #include <cstdint>
71 #include <iterator>
72 #include <string>
73 #include <utility>
74 #include <vector>
75 
76 using namespace llvm;
77 
79  "simplify-mir", cl::Hidden,
80  cl::desc("Leave out unnecessary information when printing MIR"));
81 
82 static cl::opt<bool> PrintLocations("mir-debug-loc", cl::Hidden, cl::init(true),
83  cl::desc("Print MIR debug-locations"));
84 
85 namespace {
86 
87 /// This structure describes how to print out stack object references.
88 struct FrameIndexOperand {
89  std::string Name;
90  unsigned ID;
91  bool IsFixed;
92 
93  FrameIndexOperand(StringRef Name, unsigned ID, bool IsFixed)
94  : Name(Name.str()), ID(ID), IsFixed(IsFixed) {}
95 
96  /// Return an ordinary stack object reference.
97  static FrameIndexOperand create(StringRef Name, unsigned ID) {
98  return FrameIndexOperand(Name, ID, /*IsFixed=*/false);
99  }
100 
101  /// Return a fixed stack object reference.
102  static FrameIndexOperand createFixed(unsigned ID) {
103  return FrameIndexOperand("", ID, /*IsFixed=*/true);
104  }
105 };
106 
107 } // end anonymous namespace
108 
109 namespace llvm {
110 
111 /// This class prints out the machine functions using the MIR serialization
112 /// format.
113 class MIRPrinter {
114  raw_ostream &OS;
115  DenseMap<const uint32_t *, unsigned> RegisterMaskIds;
116  /// Maps from stack object indices to operand indices which will be used when
117  /// printing frame index machine operands.
118  DenseMap<int, FrameIndexOperand> StackObjectOperandMapping;
119 
120 public:
121  MIRPrinter(raw_ostream &OS) : OS(OS) {}
122 
123  void print(const MachineFunction &MF);
124 
125  void convert(yaml::MachineFunction &MF, const MachineRegisterInfo &RegInfo,
126  const TargetRegisterInfo *TRI);
128  const MachineFrameInfo &MFI);
132  const MachineJumpTableInfo &JTI);
134  const MachineFunction &MF, ModuleSlotTracker &MST);
136  const MachineFunction &MF,
137  ModuleSlotTracker &MST);
138 
139 private:
140  void initRegisterMaskIds(const MachineFunction &MF);
141 };
142 
143 /// This class prints out the machine instructions using the MIR serialization
144 /// format.
145 class MIPrinter {
146  raw_ostream &OS;
147  ModuleSlotTracker &MST;
148  const DenseMap<const uint32_t *, unsigned> &RegisterMaskIds;
149  const DenseMap<int, FrameIndexOperand> &StackObjectOperandMapping;
150  /// Synchronization scope names registered with LLVMContext.
152 
153  bool canPredictBranchProbabilities(const MachineBasicBlock &MBB) const;
154  bool canPredictSuccessors(const MachineBasicBlock &MBB) const;
155 
156 public:
158  const DenseMap<const uint32_t *, unsigned> &RegisterMaskIds,
159  const DenseMap<int, FrameIndexOperand> &StackObjectOperandMapping)
160  : OS(OS), MST(MST), RegisterMaskIds(RegisterMaskIds),
161  StackObjectOperandMapping(StackObjectOperandMapping) {}
162 
163  void print(const MachineBasicBlock &MBB);
164 
165  void print(const MachineInstr &MI);
167  void print(const MachineInstr &MI, unsigned OpIdx,
168  const TargetRegisterInfo *TRI, const TargetInstrInfo *TII,
169  bool ShouldPrintRegisterTies, LLT TypeToPrint,
170  bool PrintDef = true);
171 };
172 
173 } // end namespace llvm
174 
175 namespace llvm {
176 namespace yaml {
177 
178 /// This struct serializes the LLVM IR module.
179 template <> struct BlockScalarTraits<Module> {
180  static void output(const Module &Mod, void *Ctxt, raw_ostream &OS) {
181  Mod.print(OS, nullptr);
182  }
183 
184  static StringRef input(StringRef Str, void *Ctxt, Module &Mod) {
185  llvm_unreachable("LLVM Module is supposed to be parsed separately");
186  return "";
187  }
188 };
189 
190 } // end namespace yaml
191 } // end namespace llvm
192 
193 static void printRegMIR(unsigned Reg, yaml::StringValue &Dest,
194  const TargetRegisterInfo *TRI) {
195  raw_string_ostream OS(Dest.Value);
196  OS << printReg(Reg, TRI);
197 }
198 
200  initRegisterMaskIds(MF);
201 
202  yaml::MachineFunction YamlMF;
203  YamlMF.Name = MF.getName();
204  YamlMF.Alignment = MF.getAlignment();
206  YamlMF.HasWinCFI = MF.hasWinCFI();
207 
208  YamlMF.Legalized = MF.getProperties().hasProperty(
212  YamlMF.Selected = MF.getProperties().hasProperty(
214  YamlMF.FailedISel = MF.getProperties().hasProperty(
216 
217  convert(YamlMF, MF.getRegInfo(), MF.getSubtarget().getRegisterInfo());
220  convert(MST, YamlMF.FrameInfo, MF.getFrameInfo());
221  convertStackObjects(YamlMF, MF, MST);
222  convertCallSiteObjects(YamlMF, MF, MST);
223  for (auto &Sub : MF.DebugValueSubstitutions)
224  YamlMF.DebugValueSubstitutions.push_back({Sub.first.first, Sub.first.second,
225  Sub.second.first,
226  Sub.second.second});
227  if (const auto *ConstantPool = MF.getConstantPool())
228  convert(YamlMF, *ConstantPool);
229  if (const auto *JumpTableInfo = MF.getJumpTableInfo())
230  convert(MST, YamlMF.JumpTableInfo, *JumpTableInfo);
231 
232  const TargetMachine &TM = MF.getTarget();
233  YamlMF.MachineFuncInfo =
234  std::unique_ptr<yaml::MachineFunctionInfo>(TM.convertFuncInfoToYAML(MF));
235 
236  raw_string_ostream StrOS(YamlMF.Body.Value.Value);
237  bool IsNewlineNeeded = false;
238  for (const auto &MBB : MF) {
239  if (IsNewlineNeeded)
240  StrOS << "\n";
241  MIPrinter(StrOS, MST, RegisterMaskIds, StackObjectOperandMapping)
242  .print(MBB);
243  IsNewlineNeeded = true;
244  }
245  StrOS.flush();
246  yaml::Output Out(OS);
247  if (!SimplifyMIR)
248  Out.setWriteDefaultValues(true);
249  Out << YamlMF;
250 }
251 
252 static void printCustomRegMask(const uint32_t *RegMask, raw_ostream &OS,
253  const TargetRegisterInfo *TRI) {
254  assert(RegMask && "Can't print an empty register mask");
255  OS << StringRef("CustomRegMask(");
256 
257  bool IsRegInRegMaskFound = false;
258  for (int I = 0, E = TRI->getNumRegs(); I < E; I++) {
259  // Check whether the register is asserted in regmask.
260  if (RegMask[I / 32] & (1u << (I % 32))) {
261  if (IsRegInRegMaskFound)
262  OS << ',';
263  OS << printReg(I, TRI);
264  IsRegInRegMaskFound = true;
265  }
266  }
267 
268  OS << ')';
269 }
270 
271 static void printRegClassOrBank(unsigned Reg, yaml::StringValue &Dest,
272  const MachineRegisterInfo &RegInfo,
273  const TargetRegisterInfo *TRI) {
274  raw_string_ostream OS(Dest.Value);
275  OS << printRegClassOrBank(Reg, RegInfo, TRI);
276 }
277 
278 template <typename T>
279 static void
281  T &Object, ModuleSlotTracker &MST) {
282  std::array<std::string *, 3> Outputs{{&Object.DebugVar.Value,
283  &Object.DebugExpr.Value,
284  &Object.DebugLoc.Value}};
285  std::array<const Metadata *, 3> Metas{{DebugVar.Var,
286  DebugVar.Expr,
287  DebugVar.Loc}};
288  for (unsigned i = 0; i < 3; ++i) {
289  raw_string_ostream StrOS(*Outputs[i]);
290  Metas[i]->printAsOperand(StrOS, MST);
291  }
292 }
293 
295  const MachineRegisterInfo &RegInfo,
296  const TargetRegisterInfo *TRI) {
297  MF.TracksRegLiveness = RegInfo.tracksLiveness();
298 
299  // Print the virtual register definitions.
300  for (unsigned I = 0, E = RegInfo.getNumVirtRegs(); I < E; ++I) {
301  unsigned Reg = Register::index2VirtReg(I);
303  VReg.ID = I;
304  if (RegInfo.getVRegName(Reg) != "")
305  continue;
306  ::printRegClassOrBank(Reg, VReg.Class, RegInfo, TRI);
307  unsigned PreferredReg = RegInfo.getSimpleHint(Reg);
308  if (PreferredReg)
309  printRegMIR(PreferredReg, VReg.PreferredRegister, TRI);
310  MF.VirtualRegisters.push_back(VReg);
311  }
312 
313  // Print the live ins.
314  for (std::pair<unsigned, unsigned> LI : RegInfo.liveins()) {
316  printRegMIR(LI.first, LiveIn.Register, TRI);
317  if (LI.second)
318  printRegMIR(LI.second, LiveIn.VirtualRegister, TRI);
319  MF.LiveIns.push_back(LiveIn);
320  }
321 
322  // Prints the callee saved registers.
323  if (RegInfo.isUpdatedCSRsInitialized()) {
324  const MCPhysReg *CalleeSavedRegs = RegInfo.getCalleeSavedRegs();
325  std::vector<yaml::FlowStringValue> CalleeSavedRegisters;
326  for (const MCPhysReg *I = CalleeSavedRegs; *I; ++I) {
328  printRegMIR(*I, Reg, TRI);
329  CalleeSavedRegisters.push_back(Reg);
330  }
331  MF.CalleeSavedRegisters = CalleeSavedRegisters;
332  }
333 }
334 
336  yaml::MachineFrameInfo &YamlMFI,
337  const MachineFrameInfo &MFI) {
340  YamlMFI.HasStackMap = MFI.hasStackMap();
341  YamlMFI.HasPatchPoint = MFI.hasPatchPoint();
342  YamlMFI.StackSize = MFI.getStackSize();
343  YamlMFI.OffsetAdjustment = MFI.getOffsetAdjustment();
344  YamlMFI.MaxAlignment = MFI.getMaxAlign().value();
345  YamlMFI.AdjustsStack = MFI.adjustsStack();
346  YamlMFI.HasCalls = MFI.hasCalls();
348  ? MFI.getMaxCallFrameSize() : ~0u;
352  YamlMFI.HasVAStart = MFI.hasVAStart();
354  YamlMFI.HasTailCall = MFI.hasTailCall();
355  YamlMFI.LocalFrameSize = MFI.getLocalFrameSize();
356  if (MFI.getSavePoint()) {
357  raw_string_ostream StrOS(YamlMFI.SavePoint.Value);
358  StrOS << printMBBReference(*MFI.getSavePoint());
359  }
360  if (MFI.getRestorePoint()) {
361  raw_string_ostream StrOS(YamlMFI.RestorePoint.Value);
362  StrOS << printMBBReference(*MFI.getRestorePoint());
363  }
364 }
365 
367  const MachineFunction &MF,
368  ModuleSlotTracker &MST) {
369  const MachineFrameInfo &MFI = MF.getFrameInfo();
371 
372  // Process fixed stack objects.
373  assert(YMF.FixedStackObjects.empty());
374  SmallVector<int, 32> FixedStackObjectsIdx;
375  const int BeginIdx = MFI.getObjectIndexBegin();
376  if (BeginIdx < 0)
377  FixedStackObjectsIdx.reserve(-BeginIdx);
378 
379  unsigned ID = 0;
380  for (int I = BeginIdx; I < 0; ++I, ++ID) {
381  FixedStackObjectsIdx.push_back(-1); // Fill index for possible dead.
382  if (MFI.isDeadObjectIndex(I))
383  continue;
384 
386  YamlObject.ID = ID;
387  YamlObject.Type = MFI.isSpillSlotObjectIndex(I)
390  YamlObject.Offset = MFI.getObjectOffset(I);
391  YamlObject.Size = MFI.getObjectSize(I);
392  YamlObject.Alignment = MFI.getObjectAlign(I);
393  YamlObject.StackID = (TargetStackID::Value)MFI.getStackID(I);
394  YamlObject.IsImmutable = MFI.isImmutableObjectIndex(I);
395  YamlObject.IsAliased = MFI.isAliasedObjectIndex(I);
396  // Save the ID' position in FixedStackObjects storage vector.
397  FixedStackObjectsIdx[ID] = YMF.FixedStackObjects.size();
398  YMF.FixedStackObjects.push_back(YamlObject);
399  StackObjectOperandMapping.insert(
400  std::make_pair(I, FrameIndexOperand::createFixed(ID)));
401  }
402 
403  // Process ordinary stack objects.
404  assert(YMF.StackObjects.empty());
405  SmallVector<unsigned, 32> StackObjectsIdx;
406  const int EndIdx = MFI.getObjectIndexEnd();
407  if (EndIdx > 0)
408  StackObjectsIdx.reserve(EndIdx);
409  ID = 0;
410  for (int I = 0; I < EndIdx; ++I, ++ID) {
411  StackObjectsIdx.push_back(-1); // Fill index for possible dead.
412  if (MFI.isDeadObjectIndex(I))
413  continue;
414 
415  yaml::MachineStackObject YamlObject;
416  YamlObject.ID = ID;
417  if (const auto *Alloca = MFI.getObjectAllocation(I))
418  YamlObject.Name.Value = std::string(
419  Alloca->hasName() ? Alloca->getName() : "");
420  YamlObject.Type = MFI.isSpillSlotObjectIndex(I)
425  YamlObject.Offset = MFI.getObjectOffset(I);
426  YamlObject.Size = MFI.getObjectSize(I);
427  YamlObject.Alignment = MFI.getObjectAlign(I);
428  YamlObject.StackID = (TargetStackID::Value)MFI.getStackID(I);
429 
430  // Save the ID' position in StackObjects storage vector.
431  StackObjectsIdx[ID] = YMF.StackObjects.size();
432  YMF.StackObjects.push_back(YamlObject);
433  StackObjectOperandMapping.insert(std::make_pair(
434  I, FrameIndexOperand::create(YamlObject.Name.Value, ID)));
435  }
436 
437  for (const auto &CSInfo : MFI.getCalleeSavedInfo()) {
438  const int FrameIdx = CSInfo.getFrameIdx();
439  if (!CSInfo.isSpilledToReg() && MFI.isDeadObjectIndex(FrameIdx))
440  continue;
441 
443  printRegMIR(CSInfo.getReg(), Reg, TRI);
444  if (!CSInfo.isSpilledToReg()) {
445  assert(FrameIdx >= MFI.getObjectIndexBegin() &&
446  FrameIdx < MFI.getObjectIndexEnd() &&
447  "Invalid stack object index");
448  if (FrameIdx < 0) { // Negative index means fixed objects.
449  auto &Object =
451  [FixedStackObjectsIdx[FrameIdx + MFI.getNumFixedObjects()]];
452  Object.CalleeSavedRegister = Reg;
453  Object.CalleeSavedRestored = CSInfo.isRestored();
454  } else {
455  auto &Object = YMF.StackObjects[StackObjectsIdx[FrameIdx]];
456  Object.CalleeSavedRegister = Reg;
457  Object.CalleeSavedRestored = CSInfo.isRestored();
458  }
459  }
460  }
461  for (unsigned I = 0, E = MFI.getLocalFrameObjectCount(); I < E; ++I) {
462  auto LocalObject = MFI.getLocalFrameObjectMap(I);
463  assert(LocalObject.first >= 0 && "Expected a locally mapped stack object");
464  YMF.StackObjects[StackObjectsIdx[LocalObject.first]].LocalOffset =
465  LocalObject.second;
466  }
467 
468  // Print the stack object references in the frame information class after
469  // converting the stack objects.
470  if (MFI.hasStackProtectorIndex()) {
472  MIPrinter(StrOS, MST, RegisterMaskIds, StackObjectOperandMapping)
474  }
475 
476  // Print the debug variable information.
477  for (const MachineFunction::VariableDbgInfo &DebugVar :
478  MF.getVariableDbgInfo()) {
479  assert(DebugVar.Slot >= MFI.getObjectIndexBegin() &&
480  DebugVar.Slot < MFI.getObjectIndexEnd() &&
481  "Invalid stack object index");
482  if (DebugVar.Slot < 0) { // Negative index means fixed objects.
483  auto &Object =
484  YMF.FixedStackObjects[FixedStackObjectsIdx[DebugVar.Slot +
485  MFI.getNumFixedObjects()]];
486  printStackObjectDbgInfo(DebugVar, Object, MST);
487  } else {
488  auto &Object = YMF.StackObjects[StackObjectsIdx[DebugVar.Slot]];
489  printStackObjectDbgInfo(DebugVar, Object, MST);
490  }
491  }
492 }
493 
495  const MachineFunction &MF,
496  ModuleSlotTracker &MST) {
497  const auto *TRI = MF.getSubtarget().getRegisterInfo();
498  for (auto CSInfo : MF.getCallSitesInfo()) {
499  yaml::CallSiteInfo YmlCS;
501 
502  // Prepare instruction position.
503  MachineBasicBlock::const_instr_iterator CallI = CSInfo.first->getIterator();
504  CallLocation.BlockNum = CallI->getParent()->getNumber();
505  // Get call instruction offset from the beginning of block.
506  CallLocation.Offset =
507  std::distance(CallI->getParent()->instr_begin(), CallI);
508  YmlCS.CallLocation = CallLocation;
509  // Construct call arguments and theirs forwarding register info.
510  for (auto ArgReg : CSInfo.second) {
512  YmlArgReg.ArgNo = ArgReg.ArgNo;
513  printRegMIR(ArgReg.Reg, YmlArgReg.Reg, TRI);
514  YmlCS.ArgForwardingRegs.emplace_back(YmlArgReg);
515  }
516  YMF.CallSitesInfo.push_back(YmlCS);
517  }
518 
519  // Sort call info by position of call instructions.
520  llvm::sort(YMF.CallSitesInfo.begin(), YMF.CallSitesInfo.end(),
522  if (A.CallLocation.BlockNum == B.CallLocation.BlockNum)
523  return A.CallLocation.Offset < B.CallLocation.Offset;
524  return A.CallLocation.BlockNum < B.CallLocation.BlockNum;
525  });
526 }
527 
530  unsigned ID = 0;
531  for (const MachineConstantPoolEntry &Constant : ConstantPool.getConstants()) {
532  std::string Str;
533  raw_string_ostream StrOS(Str);
534  if (Constant.isMachineConstantPoolEntry()) {
535  Constant.Val.MachineCPVal->print(StrOS);
536  } else {
537  Constant.Val.ConstVal->printAsOperand(StrOS);
538  }
539 
540  yaml::MachineConstantPoolValue YamlConstant;
541  YamlConstant.ID = ID++;
542  YamlConstant.Value = StrOS.str();
543  YamlConstant.Alignment = Constant.getAlign();
544  YamlConstant.IsTargetSpecific = Constant.isMachineConstantPoolEntry();
545 
546  MF.Constants.push_back(YamlConstant);
547  }
548 }
549 
551  yaml::MachineJumpTable &YamlJTI,
552  const MachineJumpTableInfo &JTI) {
553  YamlJTI.Kind = JTI.getEntryKind();
554  unsigned ID = 0;
555  for (const auto &Table : JTI.getJumpTables()) {
556  std::string Str;
558  Entry.ID = ID++;
559  for (const auto *MBB : Table.MBBs) {
560  raw_string_ostream StrOS(Str);
561  StrOS << printMBBReference(*MBB);
562  Entry.Blocks.push_back(StrOS.str());
563  Str.clear();
564  }
565  YamlJTI.Entries.push_back(Entry);
566  }
567 }
568 
569 void MIRPrinter::initRegisterMaskIds(const MachineFunction &MF) {
570  const auto *TRI = MF.getSubtarget().getRegisterInfo();
571  unsigned I = 0;
572  for (const uint32_t *Mask : TRI->getRegMasks())
573  RegisterMaskIds.insert(std::make_pair(Mask, I++));
574 }
575 
578  bool &IsFallthrough) {
580 
581  for (const MachineInstr &MI : MBB) {
582  if (MI.isPHI())
583  continue;
584  for (const MachineOperand &MO : MI.operands()) {
585  if (!MO.isMBB())
586  continue;
587  MachineBasicBlock *Succ = MO.getMBB();
588  auto RP = Seen.insert(Succ);
589  if (RP.second)
590  Result.push_back(Succ);
591  }
592  }
594  IsFallthrough = I == MBB.end() || !I->isBarrier();
595 }
596 
597 bool
598 MIPrinter::canPredictBranchProbabilities(const MachineBasicBlock &MBB) const {
599  if (MBB.succ_size() <= 1)
600  return true;
602  return true;
603 
604  SmallVector<BranchProbability,8> Normalized(MBB.Probs.begin(),
605  MBB.Probs.end());
607  Normalized.end());
608  SmallVector<BranchProbability,8> Equal(Normalized.size());
610 
611  return std::equal(Normalized.begin(), Normalized.end(), Equal.begin());
612 }
613 
614 bool MIPrinter::canPredictSuccessors(const MachineBasicBlock &MBB) const {
616  bool GuessedFallthrough;
617  guessSuccessors(MBB, GuessedSuccs, GuessedFallthrough);
618  if (GuessedFallthrough) {
619  const MachineFunction &MF = *MBB.getParent();
620  MachineFunction::const_iterator NextI = std::next(MBB.getIterator());
621  if (NextI != MF.end()) {
622  MachineBasicBlock *Next = const_cast<MachineBasicBlock*>(&*NextI);
623  if (!is_contained(GuessedSuccs, Next))
624  GuessedSuccs.push_back(Next);
625  }
626  }
627  if (GuessedSuccs.size() != MBB.succ_size())
628  return false;
629  return std::equal(MBB.succ_begin(), MBB.succ_end(), GuessedSuccs.begin());
630 }
631 
633  assert(MBB.getNumber() >= 0 && "Invalid MBB number");
634  MBB.printName(OS,
637  &MST);
638  OS << ":\n";
639 
640  bool HasLineAttributes = false;
641  // Print the successors
642  bool canPredictProbs = canPredictBranchProbabilities(MBB);
643  // Even if the list of successors is empty, if we cannot guess it,
644  // we need to print it to tell the parser that the list is empty.
645  // This is needed, because MI model unreachable as empty blocks
646  // with an empty successor list. If the parser would see that
647  // without the successor list, it would guess the code would
648  // fallthrough.
649  if ((!MBB.succ_empty() && !SimplifyMIR) || !canPredictProbs ||
650  !canPredictSuccessors(MBB)) {
651  OS.indent(2) << "successors: ";
652  for (auto I = MBB.succ_begin(), E = MBB.succ_end(); I != E; ++I) {
653  if (I != MBB.succ_begin())
654  OS << ", ";
655  OS << printMBBReference(**I);
656  if (!SimplifyMIR || !canPredictProbs)
657  OS << '('
658  << format("0x%08" PRIx32, MBB.getSuccProbability(I).getNumerator())
659  << ')';
660  }
661  OS << "\n";
662  HasLineAttributes = true;
663  }
664 
665  // Print the live in registers.
667  if (MRI.tracksLiveness() && !MBB.livein_empty()) {
669  OS.indent(2) << "liveins: ";
670  bool First = true;
671  for (const auto &LI : MBB.liveins()) {
672  if (!First)
673  OS << ", ";
674  First = false;
675  OS << printReg(LI.PhysReg, &TRI);
676  if (!LI.LaneMask.all())
677  OS << ":0x" << PrintLaneMask(LI.LaneMask);
678  }
679  OS << "\n";
680  HasLineAttributes = true;
681  }
682 
683  if (HasLineAttributes)
684  OS << "\n";
685  bool IsInBundle = false;
686  for (auto I = MBB.instr_begin(), E = MBB.instr_end(); I != E; ++I) {
687  const MachineInstr &MI = *I;
688  if (IsInBundle && !MI.isInsideBundle()) {
689  OS.indent(2) << "}\n";
690  IsInBundle = false;
691  }
692  OS.indent(IsInBundle ? 4 : 2);
693  print(MI);
694  if (!IsInBundle && MI.getFlag(MachineInstr::BundledSucc)) {
695  OS << " {";
696  IsInBundle = true;
697  }
698  OS << "\n";
699  }
700  if (IsInBundle)
701  OS.indent(2) << "}\n";
702 }
703 
705  const auto *MF = MI.getMF();
706  const auto &MRI = MF->getRegInfo();
707  const auto &SubTarget = MF->getSubtarget();
708  const auto *TRI = SubTarget.getRegisterInfo();
709  assert(TRI && "Expected target register info");
710  const auto *TII = SubTarget.getInstrInfo();
711  assert(TII && "Expected target instruction info");
712  if (MI.isCFIInstruction())
713  assert(MI.getNumOperands() == 1 && "Expected 1 operand in CFI instruction");
714 
715  SmallBitVector PrintedTypes(8);
716  bool ShouldPrintRegisterTies = MI.hasComplexRegisterTies();
717  unsigned I = 0, E = MI.getNumOperands();
718  for (; I < E && MI.getOperand(I).isReg() && MI.getOperand(I).isDef() &&
719  !MI.getOperand(I).isImplicit();
720  ++I) {
721  if (I)
722  OS << ", ";
723  print(MI, I, TRI, TII, ShouldPrintRegisterTies,
724  MI.getTypeToPrint(I, PrintedTypes, MRI),
725  /*PrintDef=*/false);
726  }
727 
728  if (I)
729  OS << " = ";
730  if (MI.getFlag(MachineInstr::FrameSetup))
731  OS << "frame-setup ";
732  if (MI.getFlag(MachineInstr::FrameDestroy))
733  OS << "frame-destroy ";
734  if (MI.getFlag(MachineInstr::FmNoNans))
735  OS << "nnan ";
736  if (MI.getFlag(MachineInstr::FmNoInfs))
737  OS << "ninf ";
738  if (MI.getFlag(MachineInstr::FmNsz))
739  OS << "nsz ";
740  if (MI.getFlag(MachineInstr::FmArcp))
741  OS << "arcp ";
742  if (MI.getFlag(MachineInstr::FmContract))
743  OS << "contract ";
744  if (MI.getFlag(MachineInstr::FmAfn))
745  OS << "afn ";
746  if (MI.getFlag(MachineInstr::FmReassoc))
747  OS << "reassoc ";
748  if (MI.getFlag(MachineInstr::NoUWrap))
749  OS << "nuw ";
750  if (MI.getFlag(MachineInstr::NoSWrap))
751  OS << "nsw ";
752  if (MI.getFlag(MachineInstr::IsExact))
753  OS << "exact ";
754  if (MI.getFlag(MachineInstr::NoFPExcept))
755  OS << "nofpexcept ";
756  if (MI.getFlag(MachineInstr::NoMerge))
757  OS << "nomerge ";
758 
759  OS << TII->getName(MI.getOpcode());
760  if (I < E)
761  OS << ' ';
762 
763  bool NeedComma = false;
764  for (; I < E; ++I) {
765  if (NeedComma)
766  OS << ", ";
767  print(MI, I, TRI, TII, ShouldPrintRegisterTies,
768  MI.getTypeToPrint(I, PrintedTypes, MRI));
769  NeedComma = true;
770  }
771 
772  // Print any optional symbols attached to this instruction as-if they were
773  // operands.
774  if (MCSymbol *PreInstrSymbol = MI.getPreInstrSymbol()) {
775  if (NeedComma)
776  OS << ',';
777  OS << " pre-instr-symbol ";
778  MachineOperand::printSymbol(OS, *PreInstrSymbol);
779  NeedComma = true;
780  }
781  if (MCSymbol *PostInstrSymbol = MI.getPostInstrSymbol()) {
782  if (NeedComma)
783  OS << ',';
784  OS << " post-instr-symbol ";
785  MachineOperand::printSymbol(OS, *PostInstrSymbol);
786  NeedComma = true;
787  }
788  if (MDNode *HeapAllocMarker = MI.getHeapAllocMarker()) {
789  if (NeedComma)
790  OS << ',';
791  OS << " heap-alloc-marker ";
792  HeapAllocMarker->printAsOperand(OS, MST);
793  NeedComma = true;
794  }
795 
796  if (auto Num = MI.peekDebugInstrNum()) {
797  if (NeedComma)
798  OS << ',';
799  OS << " debug-instr-number " << Num;
800  NeedComma = true;
801  }
802 
803  if (PrintLocations) {
804  if (const DebugLoc &DL = MI.getDebugLoc()) {
805  if (NeedComma)
806  OS << ',';
807  OS << " debug-location ";
808  DL->printAsOperand(OS, MST);
809  }
810  }
811 
812  if (!MI.memoperands_empty()) {
813  OS << " :: ";
814  const LLVMContext &Context = MF->getFunction().getContext();
815  const MachineFrameInfo &MFI = MF->getFrameInfo();
816  bool NeedComma = false;
817  for (const auto *Op : MI.memoperands()) {
818  if (NeedComma)
819  OS << ", ";
820  Op->print(OS, MST, SSNs, Context, &MFI, TII);
821  NeedComma = true;
822  }
823  }
824 }
825 
827  auto ObjectInfo = StackObjectOperandMapping.find(FrameIndex);
828  assert(ObjectInfo != StackObjectOperandMapping.end() &&
829  "Invalid frame index");
830  const FrameIndexOperand &Operand = ObjectInfo->second;
831  MachineOperand::printStackObjectReference(OS, Operand.ID, Operand.IsFixed,
832  Operand.Name);
833 }
834 
835 static std::string formatOperandComment(std::string Comment) {
836  if (Comment.empty())
837  return Comment;
838  return std::string(" /* " + Comment + " */");
839 }
840 
841 void MIPrinter::print(const MachineInstr &MI, unsigned OpIdx,
842  const TargetRegisterInfo *TRI,
843  const TargetInstrInfo *TII,
844  bool ShouldPrintRegisterTies, LLT TypeToPrint,
845  bool PrintDef) {
846  const MachineOperand &Op = MI.getOperand(OpIdx);
847  std::string MOComment = TII->createMIROperandComment(MI, Op, OpIdx, TRI);
848 
849  switch (Op.getType()) {
851  if (MI.isOperandSubregIdx(OpIdx)) {
853  MachineOperand::printSubRegIdx(OS, Op.getImm(), TRI);
854  break;
855  }
874  unsigned TiedOperandIdx = 0;
875  if (ShouldPrintRegisterTies && Op.isReg() && Op.isTied() && !Op.isDef())
876  TiedOperandIdx = Op.getParent()->findTiedOperandIdx(OpIdx);
877  const TargetIntrinsicInfo *TII = MI.getMF()->getTarget().getIntrinsicInfo();
878  Op.print(OS, MST, TypeToPrint, OpIdx, PrintDef, /*IsStandalone=*/false,
879  ShouldPrintRegisterTies, TiedOperandIdx, TRI, TII);
880  OS << formatOperandComment(MOComment);
881  break;
882  }
884  printStackObjectReference(Op.getIndex());
885  break;
887  auto RegMaskInfo = RegisterMaskIds.find(Op.getRegMask());
888  if (RegMaskInfo != RegisterMaskIds.end())
889  OS << StringRef(TRI->getRegMaskNames()[RegMaskInfo->second]).lower();
890  else
891  printCustomRegMask(Op.getRegMask(), OS, TRI);
892  break;
893  }
894  }
895 }
896 
898  ModuleSlotTracker &MST) {
899  if (isa<GlobalValue>(V)) {
900  V.printAsOperand(OS, /*PrintType=*/false, MST);
901  return;
902  }
903  if (isa<Constant>(V)) {
904  // Machine memory operands can load/store to/from constant value pointers.
905  OS << '`';
906  V.printAsOperand(OS, /*PrintType=*/true, MST);
907  OS << '`';
908  return;
909  }
910  OS << "%ir.";
911  if (V.hasName()) {
913  return;
914  }
915  int Slot = MST.getCurrentFunction() ? MST.getLocalSlot(&V) : -1;
917 }
918 
919 void llvm::printMIR(raw_ostream &OS, const Module &M) {
920  yaml::Output Out(OS);
921  Out << const_cast<Module &>(M);
922 }
923 
925  MIRPrinter Printer(OS);
926  Printer.print(MF);
927 }
llvm::MachineFunction::hasWinCFI
bool hasWinCFI() const
Definition: MachineFunction.h:637
i
i
Definition: README.txt:29
llvm::MIRFormatter::printIRValue
static void printIRValue(raw_ostream &OS, const Value &V, ModuleSlotTracker &MST)
Helper functions to print IR value as MIR serialization format which will be useful for target specif...
Definition: MIRPrinter.cpp:897
llvm::MachineFrameInfo::isMaxCallFrameSizeComputed
bool isMaxCallFrameSizeComputed() const
Definition: MachineFrameInfo.h:650
llvm::yaml::MachineFunction::RegBankSelected
bool RegBankSelected
Definition: MIRYamlMapping.h:644
llvm::MachineBasicBlock::succ_size
unsigned succ_size() const
Definition: MachineBasicBlock.h:344
llvm::MachineOperand::MO_BlockAddress
@ MO_BlockAddress
Address of a basic block.
Definition: MachineOperand.h:63
llvm::yaml::MachineFrameInfo::OffsetAdjustment
int OffsetAdjustment
Definition: MIRYamlMapping.h:556
llvm::MachineFunctionProperties::hasProperty
bool hasProperty(Property P) const
Definition: MachineFunction.h:162
llvm::yaml::MachineConstantPoolValue::ID
UnsignedValue ID
Definition: MIRYamlMapping.h:475
llvm::yaml::CallSiteInfo::ArgForwardingRegs
std::vector< ArgRegPair > ArgForwardingRegs
Definition: MIRYamlMapping.h:409
MCDwarf.h
MI
IRTranslator LLVM IR MI
Definition: IRTranslator.cpp:100
MachineInstr.h
llvm::MachineOperand::MO_Immediate
@ MO_Immediate
Immediate operand.
Definition: MachineOperand.h:53
llvm::ModuleSlotTracker::getLocalSlot
int getLocalSlot(const Value *V)
Return the slot number of the specified local value.
Definition: AsmWriter.cpp:906
llvm::object::Equal
@ Equal
Definition: COFFModuleDefinition.cpp:38
llvm
Definition: AllocatorList.h:23
Reg
unsigned Reg
Definition: MachineSink.cpp:1566
llvm::yaml::FixedMachineStackObject::Type
ObjectType Type
Definition: MIRYamlMapping.h:311
llvm::MCSymbol
MCSymbol - Instances of this class represent a symbol name in the MC file, and MCSymbols are created ...
Definition: MCSymbol.h:41
M
We currently emits eax Perhaps this is what we really should generate is Is imull three or four cycles eax eax The current instruction priority is based on pattern complexity The former is more complex because it folds a load so the latter will not be emitted Perhaps we should use AddedComplexity to give LEA32r a higher priority We should always try to match LEA first since the LEA matching code does some estimate to determine whether the match is profitable if we care more about code then imull is better It s two bytes shorter than movl leal On a Pentium M
Definition: README.txt:252
llvm::MachineFrameInfo::hasVAStart
bool hasVAStart() const
Returns true if the function calls the llvm.va_start intrinsic.
Definition: MachineFrameInfo.h:619
llvm::SystemZISD::TM
@ TM
Definition: SystemZISelLowering.h:65
TargetFrameLowering.h
llvm::MachineFunction::getVariableDbgInfo
VariableDbgInfoMapTy & getVariableDbgInfo()
Definition: MachineFunction.h:1089
llvm::MachineFrameInfo::getNumFixedObjects
unsigned getNumFixedObjects() const
Return the number of fixed objects.
Definition: MachineFrameInfo.h:394
llvm::MachineRegisterInfo::getVRegName
StringRef getVRegName(Register Reg) const
Definition: MachineRegisterInfo.h:428
llvm::yaml::MachineStackObject::Offset
int64_t Offset
Definition: MIRYamlMapping.h:246
AtomicOrdering.h
llvm::MachineOperand::MO_ShuffleMask
@ MO_ShuffleMask
Other IR Constant for ISel (shuffle masks)
Definition: MachineOperand.h:71
llvm::MachineRegisterInfo
MachineRegisterInfo - Keep track of information for virtual and physical registers,...
Definition: MachineRegisterInfo.h:52
llvm::MachineOperand::MO_RegisterLiveOut
@ MO_RegisterLiveOut
Mask of live-out registers.
Definition: MachineOperand.h:65
llvm::yaml::MachineJumpTable::Entry
Definition: MIRYamlMapping.h:497
llvm::yaml::MachineFrameInfo::StackSize
uint64_t StackSize
Definition: MIRYamlMapping.h:555
StringRef.h
llvm::BranchProbability::getNumerator
uint32_t getNumerator() const
Definition: BranchProbability.h:65
llvm::yaml::MachineFunction::JumpTableInfo
MachineJumpTable JumpTableInfo
Definition: MIRYamlMapping.h:662
llvm::raw_string_ostream
A raw_ostream that writes to an std::string.
Definition: raw_ostream.h:614
llvm::MachineOperand::printStackObjectReference
static void printStackObjectReference(raw_ostream &OS, unsigned FrameIndex, bool IsFixed, StringRef Name)
Print a stack object reference.
Definition: MachineOperand.cpp:581
llvm::MachineOperand::printIRSlotNumber
static void printIRSlotNumber(raw_ostream &OS, int Slot)
Print an IRSlotNumber.
Definition: MachineOperand.cpp:604
llvm::TargetRegisterInfo::getRegMaskNames
virtual ArrayRef< const char * > getRegMaskNames() const =0
llvm::yaml::MachineFrameInfo::RestorePoint
StringValue RestorePoint
Definition: MIRYamlMapping.h:570
llvm::SmallVector
This is a 'vector' (really, a variable-sized array), optimized for the case when the array is small.
Definition: SmallVector.h:1168
llvm::printLLVMNameWithoutPrefix
void printLLVMNameWithoutPrefix(raw_ostream &OS, StringRef Name)
Print out a name of an LLVM value without any prefixes.
Definition: AsmWriter.cpp:414
llvm::yaml::VirtualRegisterDefinition::PreferredRegister
StringValue PreferredRegister
Definition: MIRYamlMapping.h:191
llvm::MachineFunction::end
iterator end()
Definition: MachineFunction.h:739
llvm::printMBBReference
Printable printMBBReference(const MachineBasicBlock &MBB)
Prints a machine basic block reference.
Definition: MachineBasicBlock.cpp:118
llvm::MachineFrameInfo::getCVBytesOfCalleeSavedRegisters
unsigned getCVBytesOfCalleeSavedRegisters() const
Returns how many bytes of callee-saved registers the target pushed in the prologue.
Definition: MachineFrameInfo.h:657
llvm::yaml::MachineFunction::StackObjects
std::vector< MachineStackObject > StackObjects
Definition: MIRYamlMapping.h:657
llvm::ModuleSlotTracker::getCurrentFunction
const Function * getCurrentFunction() const
Definition: ModuleSlotTracker.h:61
llvm::Value::hasName
bool hasName() const
Definition: Value.h:262
ErrorHandling.h
llvm::MachineFunction::exposesReturnsTwice
bool exposesReturnsTwice() const
exposesReturnsTwice - Returns true if the function calls setjmp or any other similar functions with a...
Definition: MachineFunction.h:617
llvm::MCRegisterInfo::getNumRegs
unsigned getNumRegs() const
Return the number of registers this target has (useful for sizing arrays holding per register informa...
Definition: MCRegisterInfo.h:491
llvm::yaml::MachineFunction::TracksRegLiveness
bool TracksRegLiveness
Definition: MIRYamlMapping.h:648
llvm::MachineRegisterInfo::getTargetRegisterInfo
const TargetRegisterInfo * getTargetRegisterInfo() const
Definition: MachineRegisterInfo.h:153
llvm::yaml::FixedMachineStackObject::IsImmutable
bool IsImmutable
Definition: MIRYamlMapping.h:316
llvm::yaml::FixedMachineStackObject::DefaultType
@ DefaultType
Definition: MIRYamlMapping.h:309
llvm::yaml::MachineStackObject
Serializable representation of stack object from the MachineFrameInfo class.
Definition: MIRYamlMapping.h:240
llvm::MachineFrameInfo::getOffsetAdjustment
int getOffsetAdjustment() const
Return the correction for frame offsets.
Definition: MachineFrameInfo.h:572
llvm::MIRPrinter::convert
void convert(yaml::MachineFunction &MF, const MachineRegisterInfo &RegInfo, const TargetRegisterInfo *TRI)
Definition: MIRPrinter.cpp:294
MachineBasicBlock.h
llvm::ConstantPool
Definition: ConstantPools.h:43
llvm::yaml::MachineFunctionLiveIn::Register
StringValue Register
Definition: MIRYamlMapping.h:213
llvm::TargetSubtargetInfo::getRegisterInfo
virtual const TargetRegisterInfo * getRegisterInfo() const
getRegisterInfo - If register information is available, return it.
Definition: TargetSubtargetInfo.h:124
llvm::cl::Hidden
@ Hidden
Definition: CommandLine.h:140
llvm::MIRPrinter::convertStackObjects
void convertStackObjects(yaml::MachineFunction &YMF, const MachineFunction &MF, ModuleSlotTracker &MST)
Definition: MIRPrinter.cpp:366
llvm::TargetRegisterInfo
TargetRegisterInfo base class - We assume that the target defines a static array of TargetRegisterDes...
Definition: TargetRegisterInfo.h:231
llvm::Function::getContext
LLVMContext & getContext() const
getContext - Return a reference to the LLVMContext associated with this function.
Definition: Function.cpp:316
MachineJumpTableInfo.h
DenseMap.h
Module.h
llvm::MachineBasicBlock::liveins
iterator_range< livein_iterator > liveins() const
Definition: MachineBasicBlock.h:412
llvm::yaml::CallSiteInfo::MachineInstrLoc::Offset
unsigned Offset
Definition: MIRYamlMapping.h:401
llvm::yaml::MachineFunction::Alignment
MaybeAlign Alignment
Definition: MIRYamlMapping.h:640
TargetInstrInfo.h
llvm::MachineInstr::FmAfn
@ FmAfn
Definition: MachineInstr.h:98
llvm::MachineOperand::MO_CFIIndex
@ MO_CFIIndex
MCCFIInstruction index.
Definition: MachineOperand.h:68
llvm::MachineRegisterInfo::getNumVirtRegs
unsigned getNumVirtRegs() const
getNumVirtRegs - Return the number of virtual registers created.
Definition: MachineRegisterInfo.h:757
llvm::SmallPtrSet
SmallPtrSet - This class implements a set which is optimized for holding SmallSize or less elements.
Definition: SmallPtrSet.h:449
llvm::yaml::FixedMachineStackObject::SpillSlot
@ SpillSlot
Definition: MIRYamlMapping.h:309
printRegMIR
static void printRegMIR(unsigned Reg, yaml::StringValue &Dest, const TargetRegisterInfo *TRI)
Definition: MIRPrinter.cpp:193
llvm::Register::index2VirtReg
static Register index2VirtReg(unsigned Index)
Convert a 0-based index to a virtual register number.
Definition: Register.h:84
llvm::ModuleSlotTracker::incorporateFunction
void incorporateFunction(const Function &F)
Incorporate the given function.
Definition: AsmWriter.cpp:892
STLExtras.h
llvm::MachineFrameInfo::getObjectIndexEnd
int getObjectIndexEnd() const
Return one past the maximum frame object index.
Definition: MachineFrameInfo.h:391
llvm::yaml::CallSiteInfo
Serializable representation of CallSiteInfo.
Definition: MIRYamlMapping.h:386
Format.h
llvm::BitmaskEnumDetail::Mask
std::underlying_type_t< E > Mask()
Get a bitmask with 1s in all places up to the high-order bit of E's largest value.
Definition: BitmaskEnum.h:80
llvm::ModuleSlotTracker
Manage lifetime of a slot tracker for printing IR.
Definition: ModuleSlotTracker.h:29
TRI
unsigned const TargetRegisterInfo * TRI
Definition: MachineSink.cpp:1567
llvm::yaml::MachineFrameInfo::CVBytesOfCalleeSavedRegisters
unsigned CVBytesOfCalleeSavedRegisters
Definition: MIRYamlMapping.h:563
llvm::yaml::MachineFunction::Name
StringRef Name
Definition: MIRYamlMapping.h:639
llvm::MachineFrameInfo::getMaxCallFrameSize
unsigned getMaxCallFrameSize() const
Return the maximum size of a call frame that must be allocated for an outgoing function call.
Definition: MachineFrameInfo.h:643
llvm::yaml::VirtualRegisterDefinition
Definition: MIRYamlMapping.h:188
llvm::yaml::MachineJumpTable
Definition: MIRYamlMapping.h:496
llvm::yaml::MachineStackObject::StackID
TargetStackID::Value StackID
Definition: MIRYamlMapping.h:249
llvm::yaml::FlowStringValue
Definition: MIRYamlMapping.h:63
PrintLocations
static cl::opt< bool > PrintLocations("mir-debug-loc", cl::Hidden, cl::init(true), cl::desc("Print MIR debug-locations"))
llvm::MachineOperand::MO_Register
@ MO_Register
Register operand.
Definition: MachineOperand.h:52
llvm::yaml::MachineStackObject::VariableSized
@ VariableSized
Definition: MIRYamlMapping.h:241
MachineRegisterInfo.h
llvm::MachineInstr::FrameDestroy
@ FrameDestroy
Definition: MachineInstr.h:84
llvm::lltok::equal
@ equal
Definition: LLToken.h:25
llvm::MachineOperand::printSymbol
static void printSymbol(raw_ostream &OS, MCSymbol &Sym)
Print a MCSymbol as an operand.
Definition: MachineOperand.cpp:577
llvm::TargetIntrinsicInfo
TargetIntrinsicInfo - Interface to description of machine instruction set.
Definition: TargetIntrinsicInfo.h:29
llvm::MachineRegisterInfo::tracksLiveness
bool tracksLiveness() const
tracksLiveness - Returns true when tracking register liveness accurately.
Definition: MachineRegisterInfo.h:197
llvm::MachineJumpTableInfo::getEntryKind
JTEntryKind getEntryKind() const
Definition: MachineJumpTableInfo.h:84
llvm::yaml::MachineStackObject::Alignment
MaybeAlign Alignment
Definition: MIRYamlMapping.h:248
Context
LLVMContext & Context
Definition: NVVMIntrRange.cpp:66
llvm::MachineBasicBlock::printName
void printName(raw_ostream &os, unsigned printNameFlags=PrintNameIr, ModuleSlotTracker *moduleSlotTracker=nullptr) const
Print the basic block's name as:
Definition: MachineBasicBlock.cpp:475
SimplifyMIR
static cl::opt< bool > SimplifyMIR("simplify-mir", cl::Hidden, cl::desc("Leave out unnecessary information when printing MIR"))
llvm::SmallBitVector
This is a 'bitvector' (really, a variable-sized bit array), optimized for the case when the array is ...
Definition: SmallBitVector.h:34
llvm::MachineOperand::printSubRegIdx
static void printSubRegIdx(raw_ostream &OS, uint64_t Index, const TargetRegisterInfo *TRI)
Print a subreg index operand.
Definition: MachineOperand.cpp:516
CommandLine.h
Printer
print alias Alias Set Printer
Definition: AliasSetTracker.cpp:762
llvm::yaml::MachineFrameInfo::AdjustsStack
bool AdjustsStack
Definition: MIRYamlMapping.h:558
llvm::MIRPrinter
This class prints out the machine functions using the MIR serialization format.
Definition: MIRPrinter.cpp:113
llvm::MachineFunction::getRegInfo
MachineRegisterInfo & getRegInfo()
getRegInfo - Return information about the registers currently in use.
Definition: MachineFunction.h:565
llvm::yaml::CallSiteInfo::ArgRegPair::ArgNo
uint16_t ArgNo
Definition: MIRYamlMapping.h:391
MIRYamlMapping.h
llvm::TargetInstrInfo
TargetInstrInfo - Interface to description of machine instruction set.
Definition: TargetInstrInfo.h:97
GlobalValue.h
llvm::MachineFunctionProperties::Property::Selected
@ Selected
TargetMachine.h
llvm::yaml::FixedMachineStackObject::Alignment
MaybeAlign Alignment
Definition: MIRYamlMapping.h:314
Constants.h
llvm::yaml::MachineStackObject::DefaultType
@ DefaultType
Definition: MIRYamlMapping.h:241
llvm::MIRPrinter::print
void print(const MachineFunction &MF)
Definition: MIRPrinter.cpp:199
llvm::MachineOperand::MO_GlobalAddress
@ MO_GlobalAddress
Address of a global value.
Definition: MachineOperand.h:62
llvm::AArch64::RP
@ RP
Definition: AArch64ISelLowering.h:466
llvm::MachineFrameInfo::isReturnAddressTaken
bool isReturnAddressTaken() const
This method may be called any time after instruction selection is complete to determine if there is a...
Definition: MachineFrameInfo.h:372
E
static GCRegistry::Add< CoreCLRGC > E("coreclr", "CoreCLR-compatible GC")
llvm::MachineBasicBlock::succ_end
succ_iterator succ_end()
Definition: MachineBasicBlock.h:334
Intrinsics.h
llvm::MIPrinter::MIPrinter
MIPrinter(raw_ostream &OS, ModuleSlotTracker &MST, const DenseMap< const uint32_t *, unsigned > &RegisterMaskIds, const DenseMap< int, FrameIndexOperand > &StackObjectOperandMapping)
Definition: MIRPrinter.cpp:157
llvm::MachineRegisterInfo::isUpdatedCSRsInitialized
bool isUpdatedCSRsInitialized() const
Returns true if the updated CSR list was initialized and false otherwise.
Definition: MachineRegisterInfo.h:230
llvm::yaml::CallSiteInfo::CallLocation
MachineInstrLoc CallLocation
Definition: MIRYamlMapping.h:408
Twine.h
llvm::yaml::MachineFunction::MachineFuncInfo
std::unique_ptr< MachineFunctionInfo > MachineFuncInfo
Constant pool.
Definition: MIRYamlMapping.h:659
InstrTypes.h
MCContext.h
llvm::MachineOperand::MO_FrameIndex
@ MO_FrameIndex
Abstract Stack Frame Index.
Definition: MachineOperand.h:57
llvm::guessSuccessors
void guessSuccessors(const MachineBasicBlock &MBB, SmallVectorImpl< MachineBasicBlock * > &Result, bool &IsFallthrough)
Determine a possible list of successors of a basic block based on the basic block machine operand bei...
Definition: MIRPrinter.cpp:576
MCSymbol.h
llvm::yaml::BlockScalarTraits< Module >::input
static StringRef input(StringRef Str, void *Ctxt, Module &Mod)
Definition: MIRPrinter.cpp:184
llvm::MachineFunction::getProperties
const MachineFunctionProperties & getProperties() const
Get the function properties.
Definition: MachineFunction.h:646
llvm::MachineInstr::FmNoInfs
@ FmNoInfs
Definition: MachineInstr.h:90
PseudoSourceValue.h
TII
const HexagonInstrInfo * TII
Definition: HexagonCopyToCombine.cpp:129
B
static GCRegistry::Add< OcamlGC > B("ocaml", "ocaml 3.10-compatible GC")
First
into llvm powi allowing the code generator to produce balanced multiplication trees First
Definition: README.txt:54
llvm::MachineOperand
MachineOperand class - Representation of each machine instruction operand.
Definition: MachineOperand.h:49
llvm::MIPrinter::printStackObjectReference
void printStackObjectReference(int FrameIndex)
Definition: MIRPrinter.cpp:826
llvm::MachineInstr::FrameSetup
@ FrameSetup
Definition: MachineInstr.h:82
llvm::yaml::FixedMachineStackObject::StackID
TargetStackID::Value StackID
Definition: MIRYamlMapping.h:315
IRPrintingPasses.h
llvm::MachineFrameInfo::getRestorePoint
MachineBasicBlock * getRestorePoint() const
Definition: MachineFrameInfo.h:815
llvm::MachineFrameInfo::getStackID
uint8_t getStackID(int ObjectIdx) const
Definition: MachineFrameInfo.h:720
llvm::raw_ostream
This class implements an extremely fast bulk output stream that can only output to a stream.
Definition: raw_ostream.h:50
llvm::PrintLaneMask
Printable PrintLaneMask(LaneBitmask LaneMask)
Create Printable object to print LaneBitmasks on a raw_ostream.
Definition: LaneBitmask.h:93
llvm::MachineFrameInfo::isAliasedObjectIndex
bool isAliasedObjectIndex(int ObjectIdx) const
Returns true if the specified index corresponds to an object that might be pointed to by an LLVM IR v...
Definition: MachineFrameInfo.h:683
llvm::yaml::MachineFunction::CalleeSavedRegisters
Optional< std::vector< FlowStringValue > > CalleeSavedRegisters
Definition: MIRYamlMapping.h:652
llvm::yaml::MachineFrameInfo::HasVAStart
bool HasVAStart
Definition: MIRYamlMapping.h:565
llvm::raw_ostream::flush
void flush()
Definition: raw_ostream.h:183
llvm::yaml::CallSiteInfo::ArgRegPair::Reg
StringValue Reg
Definition: MIRYamlMapping.h:390
printStackObjectDbgInfo
static void printStackObjectDbgInfo(const MachineFunction::VariableDbgInfo &DebugVar, T &Object, ModuleSlotTracker &MST)
Definition: MIRPrinter.cpp:280
llvm::MachineFrameInfo::getStackSize
uint64_t getStackSize() const
Return the number of bytes that must be allocated to hold all of the fixed size frame objects.
Definition: MachineFrameInfo.h:563
DebugLoc.h
llvm::MachineFrameInfo::hasMustTailInVarArgFunc
bool hasMustTailInVarArgFunc() const
Returns true if the function is variadic and contains a musttail call.
Definition: MachineFrameInfo.h:623
SmallPtrSet.h
llvm::yaml::MachineFunction::FrameInfo
MachineFrameInfo FrameInfo
Definition: MIRYamlMapping.h:655
llvm::MachineFrameInfo::getObjectOffset
int64_t getObjectOffset(int ObjectIdx) const
Return the assigned stack offset of the specified object from the incoming stack pointer.
Definition: MachineFrameInfo.h:504
llvm::yaml::MachineFrameInfo::HasCalls
bool HasCalls
Definition: MIRYamlMapping.h:559
llvm::yaml::MachineConstantPoolValue::Value
StringValue Value
Definition: MIRYamlMapping.h:476
llvm::MachineInstr::NoSWrap
@ NoSWrap
Definition: MachineInstr.h:104
llvm::printMIR
void printMIR(raw_ostream &OS, const Module &M)
Print LLVM IR using the MIR serialization format to the given output stream.
Definition: MIRPrinter.cpp:919
llvm::MachineFrameInfo::getObjectIndexBegin
int getObjectIndexBegin() const
Return the minimum frame object index.
Definition: MachineFrameInfo.h:388
llvm::MachineInstr::FmNsz
@ FmNsz
Definition: MachineInstr.h:92
llvm::MachineInstr::NoFPExcept
@ NoFPExcept
Definition: MachineInstr.h:108
BranchProbability.h
llvm::MachineBasicBlock
Definition: MachineBasicBlock.h:95
llvm::MachineFrameInfo::isDeadObjectIndex
bool isDeadObjectIndex(int ObjectIdx) const
Returns true if the specified index corresponds to a dead object.
Definition: MachineFrameInfo.h:734
LowLevelTypeImpl.h
llvm::MachineFunction::VariableDbgInfo::Expr
const DIExpression * Expr
Definition: MachineFunction.h:382
llvm::OutputFileType::Object
@ Object
llvm::yaml::FixedMachineStackObject
Serializable representation of the fixed stack object from the MachineFrameInfo class.
Definition: MIRYamlMapping.h:308
llvm::yaml::MachineFrameInfo::StackProtector
StringValue StackProtector
Definition: MIRYamlMapping.h:560
llvm::MachineFunction::getSubtarget
const TargetSubtargetInfo & getSubtarget() const
getSubtarget - Return the subtarget for which this machine code is being compiled.
Definition: MachineFunction.h:555
llvm::MachineFrameInfo::getLocalFrameObjectMap
std::pair< int, int64_t > getLocalFrameObjectMap(int i) const
Get the local offset mapping for a for an object.
Definition: MachineFrameInfo.h:406
BasicBlock.h
llvm::cl::opt< bool >
llvm::MachineBasicBlock::hasSuccessorProbabilities
bool hasSuccessorProbabilities() const
Return true if any of the successors have probabilities attached to them.
Definition: MachineBasicBlock.h:615
llvm::MachineOperand::MO_Metadata
@ MO_Metadata
Metadata reference (for debug info)
Definition: MachineOperand.h:66
llvm::MachineJumpTableInfo::getJumpTables
const std::vector< MachineJumpTableEntry > & getJumpTables() const
Definition: MachineJumpTableInfo.h:99
llvm::Constant
This is an important base class in LLVM.
Definition: Constant.h:41
llvm::MachineBasicBlock::printAsOperand
void printAsOperand(raw_ostream &OS, bool PrintType=true) const
Definition: MachineBasicBlock.cpp:548
llvm::yaml::FixedMachineStackObject::ID
UnsignedValue ID
Definition: MIRYamlMapping.h:310
llvm::yaml::MachineFunction::Selected
bool Selected
Definition: MIRYamlMapping.h:645
llvm::MachineFrameInfo::getLocalFrameSize
int64_t getLocalFrameSize() const
Get the size of the local object blob.
Definition: MachineFrameInfo.h:419
llvm::MachineInstr
Representation of each machine instruction.
Definition: MachineInstr.h:64
llvm::yaml::MachineConstantPoolValue::IsTargetSpecific
bool IsTargetSpecific
Definition: MIRYamlMapping.h:478
llvm::MachineFrameInfo::getObjectSize
int64_t getObjectSize(int ObjectIdx) const
Return the size of the specified object.
Definition: MachineFrameInfo.h:451
llvm::yaml::MachineFrameInfo::LocalFrameSize
unsigned LocalFrameSize
Definition: MIRYamlMapping.h:568
llvm::GlobalValue::getParent
Module * getParent()
Get the module that this global value is contained inside of...
Definition: GlobalValue.h:572
llvm::MachineFrameInfo::hasStackProtectorIndex
bool hasStackProtectorIndex() const
Definition: MachineFrameInfo.h:356
llvm::MachineInstr::FmReassoc
@ FmReassoc
Definition: MachineInstr.h:100
llvm::LLVMContext
This is an important class for using LLVM in a threaded context.
Definition: LLVMContext.h:68
llvm::DenseMap< const uint32_t *, unsigned >
llvm::MachineRegisterInfo::getCalleeSavedRegs
const MCPhysReg * getCalleeSavedRegs() const
Returns list of callee saved registers.
Definition: MachineRegisterInfo.cpp:620
llvm::MachineConstantPool
The MachineConstantPool class keeps track of constants referenced by a function which must be spilled...
Definition: MachineConstantPool.h:117
DebugInfo.h
llvm::MachineOperand::MO_Predicate
@ MO_Predicate
Generic predicate for ISel.
Definition: MachineOperand.h:70
MIRPrinter.h
I
#define I(x, y, z)
Definition: MD5.cpp:59
llvm::MachineFunction::getCallSitesInfo
const CallSiteInfoMap & getCallSitesInfo() const
Definition: MachineFunction.h:1104
llvm::MachineFrameInfo::getObjectAlign
Align getObjectAlign(int ObjectIdx) const
Return the alignment of the specified stack object.
Definition: MachineFrameInfo.h:471
llvm::MachineOperand::MO_MCSymbol
@ MO_MCSymbol
MCSymbol reference (for debug/eh info)
Definition: MachineOperand.h:67
llvm::yaml::FixedMachineStackObject::Size
uint64_t Size
Definition: MIRYamlMapping.h:313
llvm::cl::init
initializer< Ty > init(const Ty &Val)
Definition: CommandLine.h:440
MachineConstantPool.h
llvm::StringRef::lower
LLVM_NODISCARD std::string lower() const
Definition: StringRef.cpp:108
llvm::is_contained
bool is_contained(R &&Range, const E &Element)
Wrapper function around std::find to detect if an element exists in a container.
Definition: STLExtras.h:1570
llvm::MachineRegisterInfo::liveins
ArrayRef< std::pair< MCRegister, Register > > liveins() const
Definition: MachineRegisterInfo.h:941
llvm::Value::print
void print(raw_ostream &O, bool IsForDebug=false) const
Implement operator<< on Value.
Definition: AsmWriter.cpp:4614
llvm::MachineFunctionProperties::Property::RegBankSelected
@ RegBankSelected
llvm::yaml::MachineFunctionLiveIn::VirtualRegister
StringValue VirtualRegister
Definition: MIRYamlMapping.h:214
llvm::yaml::MachineFunction
Definition: MIRYamlMapping.h:638
llvm::DenseMapBase::find
iterator find(const_arg_type_t< KeyT > Val)
Definition: DenseMap.h:150
llvm::MachineFunction::getName
StringRef getName() const
getName - Return the name of the corresponding LLVM function.
Definition: MachineFunction.cpp:522
llvm::yaml::MachineFunction::FixedStackObjects
std::vector< FixedMachineStackObject > FixedStackObjects
Definition: MIRYamlMapping.h:656
llvm::MIPrinter
This class prints out the machine instructions using the MIR serialization format.
Definition: MIRPrinter.cpp:145
llvm::MachineFunction::getConstantPool
MachineConstantPool * getConstantPool()
getConstantPool - Return the constant pool object for the current function.
Definition: MachineFunction.h:587
printCustomRegMask
static void printCustomRegMask(const uint32_t *RegMask, raw_ostream &OS, const TargetRegisterInfo *TRI)
Definition: MIRPrinter.cpp:252
assert
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
llvm::TargetMachine
Primary interface to the complete machine description for the target machine.
Definition: TargetMachine.h:77
llvm::MachineBasicBlock::succ_begin
succ_iterator succ_begin()
Definition: MachineBasicBlock.h:332
llvm::MachineFunction::getFrameInfo
MachineFrameInfo & getFrameInfo()
getFrameInfo - Return the frame info object for the current function.
Definition: MachineFunction.h:571
llvm::MachineBasicBlock::getParent
const MachineFunction * getParent() const
Return the MachineFunction containing this basic block.
Definition: MachineBasicBlock.h:225
llvm::MachineOperand::MO_TargetIndex
@ MO_TargetIndex
Target-dependent index+offset operand.
Definition: MachineOperand.h:59
llvm::MachineOperand::MO_FPImmediate
@ MO_FPImmediate
Floating-point immediate operand.
Definition: MachineOperand.h:55
llvm::MachineFunction::DebugValueSubstitutions
std::map< DebugInstrOperandPair, DebugInstrOperandPair > DebugValueSubstitutions
Substitution map: from one <inst,operand> pair to another.
Definition: MachineFunction.h:455
llvm::Module
A Module instance is used to store all the information related to an LLVM module.
Definition: Module.h:67
llvm::MDNode
Metadata node.
Definition: Metadata.h:897
llvm::MachineBasicBlock::instr_begin
instr_iterator instr_begin()
Definition: MachineBasicBlock.h:252
llvm::yaml::StringValue
A wrapper around std::string which contains a source range that's being set during parsing.
Definition: MIRYamlMapping.h:34
isReg
static bool isReg(const MCInst &MI, unsigned OpNo)
Definition: MipsInstPrinter.cpp:31
llvm::Value::printAsOperand
void printAsOperand(raw_ostream &O, bool PrintType=true, const Module *M=nullptr) const
Print the name of this Value out to the specified raw_ostream.
Definition: AsmWriter.cpp:4691
llvm::yaml::MachineStackObject::SpillSlot
@ SpillSlot
Definition: MIRYamlMapping.h:241
llvm::MachineBasicBlock::instr_end
instr_iterator instr_end()
Definition: MachineBasicBlock.h:254
llvm::MachineFunction
Definition: MachineFunction.h:227
llvm::yaml::MachineFrameInfo::HasOpaqueSPAdjustment
bool HasOpaqueSPAdjustment
Definition: MIRYamlMapping.h:564
llvm::yaml::VirtualRegisterDefinition::Class
StringValue Class
Definition: MIRYamlMapping.h:190
YAMLTraits.h
llvm::MachineInstr::IsExact
@ IsExact
Definition: MachineInstr.h:106
llvm::MachineBasicBlock::succ_empty
bool succ_empty() const
Definition: MachineBasicBlock.h:347
llvm::MachineOperand::MO_JumpTableIndex
@ MO_JumpTableIndex
Address of indexed Jump Table for switch.
Definition: MachineOperand.h:60
llvm::MachineBasicBlock::PrintNameIr
@ PrintNameIr
Add IR name where available.
Definition: MachineBasicBlock.h:953
llvm::MachineFrameInfo::getCalleeSavedInfo
const std::vector< CalleeSavedInfo > & getCalleeSavedInfo() const
Returns a reference to call saved info vector for the current function.
Definition: MachineFrameInfo.h:796
llvm::MachineOperand::MO_CImmediate
@ MO_CImmediate
Immediate >64bit operand.
Definition: MachineOperand.h:54
llvm::printRegClassOrBank
Printable printRegClassOrBank(Register Reg, const MachineRegisterInfo &RegInfo, const TargetRegisterInfo *TRI)
Create Printable object to print register classes or register banks on a raw_ostream.
Definition: TargetRegisterInfo.cpp:174
llvm::yaml::MachineJumpTable::Entries
std::vector< Entry > Entries
Definition: MIRYamlMapping.h:507
llvm::yaml::MachineFrameInfo::MaxCallFrameSize
unsigned MaxCallFrameSize
~0u means: not computed yet.
Definition: MIRYamlMapping.h:562
llvm::yaml::MachineFunction::Legalized
bool Legalized
Definition: MIRYamlMapping.h:643
None.h
llvm::MachineFrameInfo::hasPatchPoint
bool hasPatchPoint() const
This method may be called any time after instruction selection is complete to determine if there is a...
Definition: MachineFrameInfo.h:384
llvm::MachineBasicBlock::getNumber
int getNumber() const
MachineBasicBlocks are uniquely numbered at the function level, unless they're not in a MachineFuncti...
Definition: MachineBasicBlock.h:965
llvm::yaml::BlockScalarTraits< Module >::output
static void output(const Module &Mod, void *Ctxt, raw_ostream &OS)
Definition: MIRPrinter.cpp:180
llvm::MachineBasicBlock::PrintNameAttributes
@ PrintNameAttributes
Print attributes.
Definition: MachineBasicBlock.h:954
llvm::StringRef
StringRef - Represent a constant reference to a string, i.e.
Definition: StringRef.h:57
llvm::yaml::MachineJumpTable::Kind
MachineJumpTableInfo::JTEntryKind Kind
Definition: MIRYamlMapping.h:506
llvm::MachineFunction::VariableDbgInfo::Loc
const DILocation * Loc
Definition: MachineFunction.h:385
llvm::MachineBasicBlock::getLastNonDebugInstr
iterator getLastNonDebugInstr(bool SkipPseudoOp=false)
Returns an iterator to the last non-debug instruction in the basic block, or end().
Definition: MachineBasicBlock.cpp:264
llvm::yaml::MachineStackObject::Type
ObjectType Type
Definition: MIRYamlMapping.h:245
llvm_unreachable
#define llvm_unreachable(msg)
Marks that the current location is not supposed to be reachable.
Definition: ErrorHandling.h:136
llvm::yaml::MachineFunction::FailedISel
bool FailedISel
Definition: MIRYamlMapping.h:646
uint32_t
llvm::ModRefInfo::Mod
@ Mod
The access may modify the value stored in memory.
llvm::MachineOperand::MO_MachineBasicBlock
@ MO_MachineBasicBlock
MachineBasicBlock reference.
Definition: MachineOperand.h:56
llvm::MachineInstr::NoMerge
@ NoMerge
Definition: MachineInstr.h:110
llvm::ilist_node_impl::getIterator
self_iterator getIterator()
Definition: ilist_node.h:81
TargetSubtargetInfo.h
DL
MachineBasicBlock MachineBasicBlock::iterator DebugLoc DL
Definition: AArch64SLSHardening.cpp:76
llvm::MachineOperand::MO_IntrinsicID
@ MO_IntrinsicID
Intrinsic ID for ISel.
Definition: MachineOperand.h:69
llvm::format
format_object< Ts... > format(const char *Fmt, const Ts &... Vals)
These are helper functions used to produce formatted output.
Definition: Format.h:124
llvm::yaml::MachineFrameInfo::HasStackMap
bool HasStackMap
Definition: MIRYamlMapping.h:553
llvm::MIPrinter::print
void print(const MachineBasicBlock &MBB)
Definition: MIRPrinter.cpp:632
LLVM_FALLTHROUGH
#define LLVM_FALLTHROUGH
LLVM_FALLTHROUGH - Mark fallthrough cases in switch statements.
Definition: Compiler.h:281
llvm::Value::getName
StringRef getName() const
Return a constant reference to the value's name.
Definition: Value.cpp:298
llvm::DenseMapBase::insert
std::pair< iterator, bool > insert(const std::pair< KeyT, ValueT > &KV)
Definition: DenseMap.h:207
llvm::MachineFrameInfo::getLocalFrameObjectCount
int64_t getLocalFrameObjectCount() const
Return the number of objects allocated into the local object block.
Definition: MachineFrameInfo.h:413
MRI
unsigned const MachineRegisterInfo * MRI
Definition: AArch64AdvSIMDScalarPass.cpp:105
llvm::MachineFrameInfo::getMaxAlign
Align getMaxAlign() const
Return the alignment in bytes that this function must be aligned to, which is greater than the defaul...
Definition: MachineFrameInfo.h:585
llvm::yaml::MachineFrameInfo
Serializable representation of MachineFrameInfo.
Definition: MIRYamlMapping.h:550
llvm::MachineFrameInfo::isFrameAddressTaken
bool isFrameAddressTaken() const
This method may be called any time after instruction selection is complete to determine if there is a...
Definition: MachineFrameInfo.h:366
llvm::yaml::MachineFrameInfo::IsFrameAddressTaken
bool IsFrameAddressTaken
Definition: MIRYamlMapping.h:551
llvm::MachineFrameInfo::hasCalls
bool hasCalls() const
Return true if the current function has any function calls.
Definition: MachineFrameInfo.h:602
llvm::yaml::MachineFunction::DebugValueSubstitutions
std::vector< DebugValueSubstitution > DebugValueSubstitutions
Definition: MIRYamlMapping.h:661
llvm::ISD::FrameIndex
@ FrameIndex
Definition: ISDOpcodes.h:73
MBB
MachineBasicBlock & MBB
Definition: AArch64SLSHardening.cpp:74
llvm::yaml::MachineFunction::VirtualRegisters
std::vector< VirtualRegisterDefinition > VirtualRegisters
Definition: MIRYamlMapping.h:650
llvm::yaml::MachineFunction::ExposesReturnsTwice
bool ExposesReturnsTwice
Definition: MIRYamlMapping.h:641
llvm::MachineFunctionProperties::Property::FailedISel
@ FailedISel
llvm::MachineOperand::printTargetFlags
static void printTargetFlags(raw_ostream &OS, const MachineOperand &Op)
Print operand target flags.
Definition: MachineOperand.cpp:525
llvm::MachineFrameInfo::getSavePoint
MachineBasicBlock * getSavePoint() const
Definition: MachineFrameInfo.h:813
formatOperandComment
static std::string formatOperandComment(std::string Comment)
Definition: MIRPrinter.cpp:835
llvm::MachineRegisterInfo::getSimpleHint
Register getSimpleHint(Register VReg) const
getSimpleHint - same as getRegAllocationHint except it will only return a target independent hint.
Definition: MachineRegisterInfo.h:805
llvm::yaml::MachineFrameInfo::IsReturnAddressTaken
bool IsReturnAddressTaken
Definition: MIRYamlMapping.h:552
llvm::MachineConstantPoolEntry
This class is a data container for one entry in a MachineConstantPool.
Definition: MachineConstantPool.h:67
llvm::GraphProgram::Name
Name
Definition: GraphWriter.h:52
llvm::yaml::FixedMachineStackObject::IsAliased
bool IsAliased
Definition: MIRYamlMapping.h:317
llvm::MachineFunction::getFunction
Function & getFunction()
Return the LLVM function that this machine code represents.
Definition: MachineFunction.h:521
uint16_t
llvm::MachineFunction::getTarget
const LLVMTargetMachine & getTarget() const
getTarget - Return the target machine this machine code is compiled with
Definition: MachineFunction.h:551
llvm::MIRPrinter::MIRPrinter
MIRPrinter(raw_ostream &OS)
Definition: MIRPrinter.cpp:121
llvm::DenseMapBase::end
iterator end()
Definition: DenseMap.h:83
llvm::AMDGPU::SendMsg::Op
Op
Definition: SIDefines.h:314
llvm::MachineFrameInfo::isVariableSizedObjectIndex
bool isVariableSizedObjectIndex(int ObjectIdx) const
Returns true if the specified index corresponds to a variable sized object.
Definition: MachineFrameInfo.h:742
llvm::ilist_iterator
Iterator for intrusive lists based on ilist_node.
Definition: ilist_iterator.h:57
MachineFrameInfo.h
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::yaml::StringValue::Value
std::string Value
Definition: MIRYamlMapping.h:35
llvm::MachineOperand::MO_ExternalSymbol
@ MO_ExternalSymbol
Name of external global symbol.
Definition: MachineOperand.h:61
llvm::yaml::MachineStackObject::ID
UnsignedValue ID
Definition: MIRYamlMapping.h:242
Casting.h
llvm::yaml::FixedMachineStackObject::Offset
int64_t Offset
Definition: MIRYamlMapping.h:312
Function.h
llvm::sort
void sort(IteratorTy Start, IteratorTy End)
Definition: STLExtras.h:1446
llvm::TargetStackID::Value
Value
Definition: TargetFrameLowering.h:27
llvm::yaml::MachineStackObject::Size
uint64_t Size
Definition: MIRYamlMapping.h:247
llvm::MachineInstr::FmNoNans
@ FmNoNans
Definition: MachineInstr.h:88
llvm::MachineInstr::FmContract
@ FmContract
Definition: MachineInstr.h:96
llvm::MachineFrameInfo::isSpillSlotObjectIndex
bool isSpillSlotObjectIndex(int ObjectIdx) const
Returns true if the specified index corresponds to a spill slot.
Definition: MachineFrameInfo.h:707
llvm::MachineBasicBlock::livein_empty
bool livein_empty() const
Definition: MachineBasicBlock.h:411
llvm::yaml::MachineConstantPoolValue::Alignment
MaybeAlign Alignment
Definition: MIRYamlMapping.h:477
llvm::yaml::MachineFunction::LiveIns
std::vector< MachineFunctionLiveIn > LiveIns
Definition: MIRYamlMapping.h:651
llvm::yaml::MachineFrameInfo::SavePoint
StringValue SavePoint
Definition: MIRYamlMapping.h:569
llvm::MachineFrameInfo::isImmutableObjectIndex
bool isImmutableObjectIndex(int ObjectIdx) const
Returns true if the specified index corresponds to an immutable object.
Definition: MachineFrameInfo.h:690
llvm::yaml::MachineFunction::HasWinCFI
bool HasWinCFI
Definition: MIRYamlMapping.h:649
llvm::MachineFrameInfo
The MachineFrameInfo class represents an abstract stack frame until prolog/epilog code is inserted.
Definition: MachineFrameInfo.h:107
llvm::yaml::CallSiteInfo::MachineInstrLoc::BlockNum
unsigned BlockNum
Definition: MIRYamlMapping.h:400
Instructions.h
llvm::yaml::MachineFrameInfo::HasTailCall
bool HasTailCall
Definition: MIRYamlMapping.h:567
llvm::yaml::MachineFunction::Body
BlockStringValue Body
Definition: MIRYamlMapping.h:663
llvm::yaml::VirtualRegisterDefinition::ID
UnsignedValue ID
Definition: MIRYamlMapping.h:189
llvm::BranchProbability::normalizeProbabilities
static void normalizeProbabilities(ProbabilityIter Begin, ProbabilityIter End)
Definition: BranchProbability.h:205
SmallVector.h
llvm::yaml::MachineFunctionLiveIn
Definition: MIRYamlMapping.h:212
llvm::yaml::MachineFrameInfo::MaxAlignment
unsigned MaxAlignment
Definition: MIRYamlMapping.h:557
llvm::yaml::MachineFrameInfo::HasMustTailInVarArgFunc
bool HasMustTailInVarArgFunc
Definition: MIRYamlMapping.h:566
llvm::MachineInstr::NoUWrap
@ NoUWrap
Definition: MachineInstr.h:102
llvm::raw_ostream::indent
raw_ostream & indent(unsigned NumSpaces)
indent - Insert 'NumSpaces' spaces.
Definition: raw_ostream.cpp:497
RegisterBank.h
TargetIntrinsicInfo.h
SmallBitVector.h
llvm::MachineInstr::BundledSucc
@ BundledSucc
Definition: MachineInstr.h:87
LaneBitmask.h
llvm::yaml::MachineConstantPoolValue
Definition: MIRYamlMapping.h:474
llvm::MachineInstr::FmArcp
@ FmArcp
Definition: MachineInstr.h:94
ModuleSlotTracker.h
MachineMemOperand.h
llvm::SmallVectorImpl
This class consists of common code factored out of the SmallVector class to reduce code duplication b...
Definition: APFloat.h:43
MachineOperand.h
llvm::yaml::MachineFrameInfo::HasPatchPoint
bool HasPatchPoint
Definition: MIRYamlMapping.h:554
llvm::MachineFrameInfo::hasOpaqueSPAdjustment
bool hasOpaqueSPAdjustment() const
Returns true if the function contains opaque dynamic stack adjustments.
Definition: MachineFrameInfo.h:606
llvm::yaml::CallSiteInfo::MachineInstrLoc
Identifies call instruction location in machine function.
Definition: MIRYamlMapping.h:399
llvm::MachineFunction::VariableDbgInfo::Var
const DILocalVariable * Var
Definition: MachineFunction.h:381
llvm::MachineFrameInfo::getStackProtectorIndex
int getStackProtectorIndex() const
Return the index for the stack protector object.
Definition: MachineFrameInfo.h:354
llvm::MachineFrameInfo::hasStackMap
bool hasStackMap() const
This method may be called any time after instruction selection is complete to determine if there is a...
Definition: MachineFrameInfo.h:378
llvm::MachineFunction::getJumpTableInfo
const MachineJumpTableInfo * getJumpTableInfo() const
getJumpTableInfo - Return the jump table info object for the current function.
Definition: MachineFunction.h:578
llvm::DebugLoc
A debug info location.
Definition: DebugLoc.h:33
llvm::MachineFrameInfo::adjustsStack
bool adjustsStack() const
Return true if this function adjusts the stack – e.g., when calling another function.
Definition: MachineFrameInfo.h:598
llvm::MachineOperand::MO_RegisterMask
@ MO_RegisterMask
Mask of preserved registers.
Definition: MachineOperand.h:64
llvm::MachineFrameInfo::hasTailCall
bool hasTailCall() const
Returns true if the function contains a tail call.
Definition: MachineFrameInfo.h:627
llvm::cl::desc
Definition: CommandLine.h:411
llvm::MachineJumpTableInfo
Definition: MachineJumpTableInfo.h:42
raw_ostream.h
llvm::MachineFunction::VariableDbgInfo
Definition: MachineFunction.h:380
llvm::yaml::MachineFunction::CallSitesInfo
std::vector< CallSiteInfo > CallSitesInfo
Definition: MIRYamlMapping.h:660
MachineFunction.h
llvm::printReg
Printable printReg(Register Reg, const TargetRegisterInfo *TRI=nullptr, unsigned SubIdx=0, const MachineRegisterInfo *MRI=nullptr)
Prints virtual and physical registers with or without a TRI instance.
Definition: TargetRegisterInfo.cpp:110
llvm::SmallVectorImpl::reserve
void reserve(size_type N)
Definition: SmallVector.h:624
llvm::MachineInstrBundleIterator< const MachineInstr >
Value.h
llvm::MachineFunction::getAlignment
Align getAlignment() const
getAlignment - Return the alignment of the function.
Definition: MachineFunction.h:603
llvm::raw_string_ostream::str
std::string & str()
Flushes the stream contents to the target string and returns the string's reference.
Definition: raw_ostream.h:632
llvm::Value
LLVM Value Representation.
Definition: Value.h:75
TargetRegisterInfo.h
llvm::MachineBasicBlock::end
iterator end()
Definition: MachineBasicBlock.h:270
llvm::yaml::BlockStringValue::Value
StringValue Value
Definition: MIRYamlMapping.h:81
llvm::MIRPrinter::convertCallSiteObjects
void convertCallSiteObjects(yaml::MachineFunction &YMF, const MachineFunction &MF, ModuleSlotTracker &MST)
Definition: MIRPrinter.cpp:494
llvm::TargetRegisterInfo::getRegMasks
virtual ArrayRef< const uint32_t * > getRegMasks() const =0
Return all the call-preserved register masks defined for this target.
llvm::yaml::MachineFunction::Constants
std::vector< MachineConstantPoolValue > Constants
Definition: MIRYamlMapping.h:658
llvm::yaml::CallSiteInfo::ArgRegPair
Definition: MIRYamlMapping.h:389
llvm::SmallPtrSetImpl::insert
std::pair< iterator, bool > insert(PtrType Ptr)
Inserts Ptr if and only if there is no element in the container equal to Ptr.
Definition: SmallPtrSet.h:364
llvm::Intrinsic::ID
unsigned ID
Definition: TargetTransformInfo.h:38
llvm::MachineFunctionProperties::Property::Legalized
@ Legalized
llvm::MachineOperand::MO_ConstantPoolIndex
@ MO_ConstantPoolIndex
Address of indexed Constant in Constant Pool.
Definition: MachineOperand.h:58
llvm::MachineFrameInfo::getObjectAllocation
const AllocaInst * getObjectAllocation(int ObjectIdx) const
Return the underlying Alloca of the specified stack object if it exists.
Definition: MachineFrameInfo.h:496
llvm::LLT
Definition: LowLevelTypeImpl.h:40
llvm::yaml::MachineStackObject::Name
StringValue Name
Definition: MIRYamlMapping.h:243