LLVM  13.0.0git
MIRYamlMapping.h
Go to the documentation of this file.
1 //===- MIRYamlMapping.h - Describe mapping between MIR and YAML--*- C++ -*-===//
2 //
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6 //
7 //===----------------------------------------------------------------------===//
8 //
9 // This file implements the mapping between various MIR data structures and
10 // their corresponding YAML representation.
11 //
12 //===----------------------------------------------------------------------===//
13 
14 #ifndef LLVM_CODEGEN_MIRYAMLMAPPING_H
15 #define LLVM_CODEGEN_MIRYAMLMAPPING_H
16 
17 #include "llvm/ADT/Optional.h"
18 #include "llvm/ADT/StringRef.h"
21 #include "llvm/Support/SMLoc.h"
24 #include <algorithm>
25 #include <cstdint>
26 #include <string>
27 #include <vector>
28 
29 namespace llvm {
30 namespace yaml {
31 
32 /// A wrapper around std::string which contains a source range that's being
33 /// set during parsing.
34 struct StringValue {
35  std::string Value;
37 
38  StringValue() = default;
39  StringValue(std::string Value) : Value(std::move(Value)) {}
40  StringValue(const char Val[]) : Value(Val) {}
41 
42  bool operator==(const StringValue &Other) const {
43  return Value == Other.Value;
44  }
45 };
46 
47 template <> struct ScalarTraits<StringValue> {
48  static void output(const StringValue &S, void *, raw_ostream &OS) {
49  OS << S.Value;
50  }
51 
52  static StringRef input(StringRef Scalar, void *Ctx, StringValue &S) {
53  S.Value = Scalar.str();
54  if (const auto *Node =
55  reinterpret_cast<yaml::Input *>(Ctx)->getCurrentNode())
56  S.SourceRange = Node->getSourceRange();
57  return "";
58  }
59 
60  static QuotingType mustQuote(StringRef S) { return needsQuotes(S); }
61 };
62 
64  FlowStringValue() = default;
66 };
67 
68 template <> struct ScalarTraits<FlowStringValue> {
69  static void output(const FlowStringValue &S, void *, raw_ostream &OS) {
70  return ScalarTraits<StringValue>::output(S, nullptr, OS);
71  }
72 
73  static StringRef input(StringRef Scalar, void *Ctx, FlowStringValue &S) {
74  return ScalarTraits<StringValue>::input(Scalar, Ctx, S);
75  }
76 
77  static QuotingType mustQuote(StringRef S) { return needsQuotes(S); }
78 };
79 
82 
83  bool operator==(const BlockStringValue &Other) const {
84  return Value == Other.Value;
85  }
86 };
87 
88 template <> struct BlockScalarTraits<BlockStringValue> {
89  static void output(const BlockStringValue &S, void *Ctx, raw_ostream &OS) {
90  return ScalarTraits<StringValue>::output(S.Value, Ctx, OS);
91  }
92 
93  static StringRef input(StringRef Scalar, void *Ctx, BlockStringValue &S) {
94  return ScalarTraits<StringValue>::input(Scalar, Ctx, S.Value);
95  }
96 };
97 
98 /// A wrapper around unsigned which contains a source range that's being set
99 /// during parsing.
101  unsigned Value = 0;
103 
104  UnsignedValue() = default;
105  UnsignedValue(unsigned Value) : Value(Value) {}
106 
107  bool operator==(const UnsignedValue &Other) const {
108  return Value == Other.Value;
109  }
110 };
111 
112 template <> struct ScalarTraits<UnsignedValue> {
113  static void output(const UnsignedValue &Value, void *Ctx, raw_ostream &OS) {
114  return ScalarTraits<unsigned>::output(Value.Value, Ctx, OS);
115  }
116 
117  static StringRef input(StringRef Scalar, void *Ctx, UnsignedValue &Value) {
118  if (const auto *Node =
119  reinterpret_cast<yaml::Input *>(Ctx)->getCurrentNode())
120  Value.SourceRange = Node->getSourceRange();
121  return ScalarTraits<unsigned>::input(Scalar, Ctx, Value.Value);
122  }
123 
124  static QuotingType mustQuote(StringRef Scalar) {
125  return ScalarTraits<unsigned>::mustQuote(Scalar);
126  }
127 };
128 
129 template <> struct ScalarEnumerationTraits<MachineJumpTableInfo::JTEntryKind> {
130  static void enumeration(yaml::IO &IO,
132  IO.enumCase(EntryKind, "block-address",
134  IO.enumCase(EntryKind, "gp-rel64-block-address",
136  IO.enumCase(EntryKind, "gp-rel32-block-address",
138  IO.enumCase(EntryKind, "label-difference32",
140  IO.enumCase(EntryKind, "inline", MachineJumpTableInfo::EK_Inline);
141  IO.enumCase(EntryKind, "custom32", MachineJumpTableInfo::EK_Custom32);
142  }
143 };
144 
145 template <> struct ScalarTraits<MaybeAlign> {
146  static void output(const MaybeAlign &Alignment, void *,
147  llvm::raw_ostream &out) {
148  out << uint64_t(Alignment ? Alignment->value() : 0U);
149  }
150  static StringRef input(StringRef Scalar, void *, MaybeAlign &Alignment) {
151  unsigned long long n;
152  if (getAsUnsignedInteger(Scalar, 10, n))
153  return "invalid number";
154  if (n > 0 && !isPowerOf2_64(n))
155  return "must be 0 or a power of two";
156  Alignment = MaybeAlign(n);
157  return StringRef();
158  }
159  static QuotingType mustQuote(StringRef) { return QuotingType::None; }
160 };
161 
162 template <> struct ScalarTraits<Align> {
163  static void output(const Align &Alignment, void *, llvm::raw_ostream &OS) {
164  OS << Alignment.value();
165  }
166  static StringRef input(StringRef Scalar, void *, Align &Alignment) {
167  unsigned long long N;
168  if (getAsUnsignedInteger(Scalar, 10, N))
169  return "invalid number";
170  if (!isPowerOf2_64(N))
171  return "must be a power of two";
172  Alignment = Align(N);
173  return StringRef();
174  }
175  static QuotingType mustQuote(StringRef) { return QuotingType::None; }
176 };
177 
178 } // end namespace yaml
179 } // end namespace llvm
180 
184 
185 namespace llvm {
186 namespace yaml {
187 
192 
193  // TODO: Serialize the target specific register hints.
194 
195  bool operator==(const VirtualRegisterDefinition &Other) const {
196  return ID == Other.ID && Class == Other.Class &&
197  PreferredRegister == Other.PreferredRegister;
198  }
199 };
200 
203  YamlIO.mapRequired("id", Reg.ID);
204  YamlIO.mapRequired("class", Reg.Class);
205  YamlIO.mapOptional("preferred-register", Reg.PreferredRegister,
206  StringValue()); // Don't print out when it's empty.
207  }
208 
209  static const bool flow = true;
210 };
211 
215 
216  bool operator==(const MachineFunctionLiveIn &Other) const {
217  return Register == Other.Register &&
218  VirtualRegister == Other.VirtualRegister;
219  }
220 };
221 
223  static void mapping(IO &YamlIO, MachineFunctionLiveIn &LiveIn) {
224  YamlIO.mapRequired("reg", LiveIn.Register);
225  YamlIO.mapOptional(
226  "virtual-reg", LiveIn.VirtualRegister,
227  StringValue()); // Don't print the virtual register when it's empty.
228  }
229 
230  static const bool flow = true;
231 };
232 
233 /// Serializable representation of stack object from the MachineFrameInfo class.
234 ///
235 /// The flags 'isImmutable' and 'isAliased' aren't serialized, as they are
236 /// determined by the object's type and frame information flags.
237 /// Dead stack objects aren't serialized.
238 ///
239 /// The 'isPreallocated' flag is determined by the local offset.
244  // TODO: Serialize unnamed LLVM alloca reference.
246  int64_t Offset = 0;
247  uint64_t Size = 0;
251  bool CalleeSavedRestored = true;
256 
257  bool operator==(const MachineStackObject &Other) const {
258  return ID == Other.ID && Name == Other.Name && Type == Other.Type &&
259  Offset == Other.Offset && Size == Other.Size &&
260  Alignment == Other.Alignment &&
261  StackID == Other.StackID &&
262  CalleeSavedRegister == Other.CalleeSavedRegister &&
263  CalleeSavedRestored == Other.CalleeSavedRestored &&
264  LocalOffset == Other.LocalOffset && DebugVar == Other.DebugVar &&
265  DebugExpr == Other.DebugExpr && DebugLoc == Other.DebugLoc;
266  }
267 };
268 
269 template <> struct ScalarEnumerationTraits<MachineStackObject::ObjectType> {
270  static void enumeration(yaml::IO &IO, MachineStackObject::ObjectType &Type) {
271  IO.enumCase(Type, "default", MachineStackObject::DefaultType);
272  IO.enumCase(Type, "spill-slot", MachineStackObject::SpillSlot);
273  IO.enumCase(Type, "variable-sized", MachineStackObject::VariableSized);
274  }
275 };
276 
277 template <> struct MappingTraits<MachineStackObject> {
278  static void mapping(yaml::IO &YamlIO, MachineStackObject &Object) {
279  YamlIO.mapRequired("id", Object.ID);
280  YamlIO.mapOptional("name", Object.Name,
281  StringValue()); // Don't print out an empty name.
282  YamlIO.mapOptional(
283  "type", Object.Type,
284  MachineStackObject::DefaultType); // Don't print the default type.
285  YamlIO.mapOptional("offset", Object.Offset, (int64_t)0);
287  YamlIO.mapRequired("size", Object.Size);
288  YamlIO.mapOptional("alignment", Object.Alignment, None);
289  YamlIO.mapOptional("stack-id", Object.StackID, TargetStackID::Default);
290  YamlIO.mapOptional("callee-saved-register", Object.CalleeSavedRegister,
291  StringValue()); // Don't print it out when it's empty.
292  YamlIO.mapOptional("callee-saved-restored", Object.CalleeSavedRestored,
293  true);
294  YamlIO.mapOptional("local-offset", Object.LocalOffset, Optional<int64_t>());
295  YamlIO.mapOptional("debug-info-variable", Object.DebugVar,
296  StringValue()); // Don't print it out when it's empty.
297  YamlIO.mapOptional("debug-info-expression", Object.DebugExpr,
298  StringValue()); // Don't print it out when it's empty.
299  YamlIO.mapOptional("debug-info-location", Object.DebugLoc,
300  StringValue()); // Don't print it out when it's empty.
301  }
302 
303  static const bool flow = true;
304 };
305 
306 /// Serializable representation of the fixed stack object from the
307 /// MachineFrameInfo class.
312  int64_t Offset = 0;
313  uint64_t Size = 0;
316  bool IsImmutable = false;
317  bool IsAliased = false;
319  bool CalleeSavedRestored = true;
323 
324  bool operator==(const FixedMachineStackObject &Other) const {
325  return ID == Other.ID && Type == Other.Type && Offset == Other.Offset &&
326  Size == Other.Size && Alignment == Other.Alignment &&
327  StackID == Other.StackID &&
328  IsImmutable == Other.IsImmutable && IsAliased == Other.IsAliased &&
329  CalleeSavedRegister == Other.CalleeSavedRegister &&
330  CalleeSavedRestored == Other.CalleeSavedRestored &&
331  DebugVar == Other.DebugVar && DebugExpr == Other.DebugExpr
332  && DebugLoc == Other.DebugLoc;
333  }
334 };
335 
336 template <>
337 struct ScalarEnumerationTraits<FixedMachineStackObject::ObjectType> {
338  static void enumeration(yaml::IO &IO,
340  IO.enumCase(Type, "default", FixedMachineStackObject::DefaultType);
341  IO.enumCase(Type, "spill-slot", FixedMachineStackObject::SpillSlot);
342  }
343 };
344 
345 template <>
346 struct ScalarEnumerationTraits<TargetStackID::Value> {
347  static void enumeration(yaml::IO &IO, TargetStackID::Value &ID) {
348  IO.enumCase(ID, "default", TargetStackID::Default);
349  IO.enumCase(ID, "sgpr-spill", TargetStackID::SGPRSpill);
350  IO.enumCase(ID, "scalable-vector", TargetStackID::ScalableVector);
351  IO.enumCase(ID, "noalloc", TargetStackID::NoAlloc);
352  }
353 };
354 
356  static void mapping(yaml::IO &YamlIO, FixedMachineStackObject &Object) {
357  YamlIO.mapRequired("id", Object.ID);
358  YamlIO.mapOptional(
359  "type", Object.Type,
360  FixedMachineStackObject::DefaultType); // Don't print the default type.
361  YamlIO.mapOptional("offset", Object.Offset, (int64_t)0);
362  YamlIO.mapOptional("size", Object.Size, (uint64_t)0);
363  YamlIO.mapOptional("alignment", Object.Alignment, None);
364  YamlIO.mapOptional("stack-id", Object.StackID, TargetStackID::Default);
366  YamlIO.mapOptional("isImmutable", Object.IsImmutable, false);
367  YamlIO.mapOptional("isAliased", Object.IsAliased, false);
368  }
369  YamlIO.mapOptional("callee-saved-register", Object.CalleeSavedRegister,
370  StringValue()); // Don't print it out when it's empty.
371  YamlIO.mapOptional("callee-saved-restored", Object.CalleeSavedRestored,
372  true);
373  YamlIO.mapOptional("debug-info-variable", Object.DebugVar,
374  StringValue()); // Don't print it out when it's empty.
375  YamlIO.mapOptional("debug-info-expression", Object.DebugExpr,
376  StringValue()); // Don't print it out when it's empty.
377  YamlIO.mapOptional("debug-info-location", Object.DebugLoc,
378  StringValue()); // Don't print it out when it's empty.
379  }
380 
381  static const bool flow = true;
382 };
383 
384 /// A serializaable representation of a reference to a stack object or fixed
385 /// stack object.
386 struct FrameIndex {
387  // The frame index as printed. This is always a positive number, even for
388  // fixed objects. To obtain the real index,
389  // MachineFrameInfo::getObjectIndexBegin has to be added.
390  int FI;
391  bool IsFixed;
393 
395  FrameIndex(int FI, const llvm::MachineFrameInfo &MFI);
396 
397  Expected<int> getFI(const llvm::MachineFrameInfo &MFI) const;
398 };
399 
400 template <> struct ScalarTraits<FrameIndex> {
401  static void output(const FrameIndex &FI, void *, raw_ostream &OS) {
403  }
404 
405  static StringRef input(StringRef Scalar, void *Ctx, FrameIndex &FI) {
406  FI.IsFixed = false;
407  StringRef Num;
408  if (Scalar.startswith("%stack.")) {
409  Num = Scalar.substr(7);
410  } else if (Scalar.startswith("%fixed-stack.")) {
411  Num = Scalar.substr(13);
412  FI.IsFixed = true;
413  } else {
414  return "Invalid frame index, needs to start with %stack. or "
415  "%fixed-stack.";
416  }
417  if (Num.consumeInteger(10, FI.FI))
418  return "Invalid frame index, not a valid number";
419 
420  if (const auto *Node =
421  reinterpret_cast<yaml::Input *>(Ctx)->getCurrentNode())
423  return StringRef();
424  }
425 
426  static QuotingType mustQuote(StringRef S) { return needsQuotes(S); }
427 };
428 
429 /// Serializable representation of CallSiteInfo.
430 struct CallSiteInfo {
431  // Representation of call argument and register which is used to
432  // transfer it.
433  struct ArgRegPair {
436 
437  bool operator==(const ArgRegPair &Other) const {
438  return Reg == Other.Reg && ArgNo == Other.ArgNo;
439  }
440  };
441 
442  /// Identifies call instruction location in machine function.
444  unsigned BlockNum;
445  unsigned Offset;
446 
447  bool operator==(const MachineInstrLoc &Other) const {
448  return BlockNum == Other.BlockNum && Offset == Other.Offset;
449  }
450  };
451 
453  std::vector<ArgRegPair> ArgForwardingRegs;
454 
455  bool operator==(const CallSiteInfo &Other) const {
456  return CallLocation.BlockNum == Other.CallLocation.BlockNum &&
457  CallLocation.Offset == Other.CallLocation.Offset;
458  }
459 };
460 
461 template <> struct MappingTraits<CallSiteInfo::ArgRegPair> {
462  static void mapping(IO &YamlIO, CallSiteInfo::ArgRegPair &ArgReg) {
463  YamlIO.mapRequired("arg", ArgReg.ArgNo);
464  YamlIO.mapRequired("reg", ArgReg.Reg);
465  }
466 
467  static const bool flow = true;
468 };
469 }
470 }
471 
473 
474 namespace llvm {
475 namespace yaml {
476 
477 template <> struct MappingTraits<CallSiteInfo> {
478  static void mapping(IO &YamlIO, CallSiteInfo &CSInfo) {
479  YamlIO.mapRequired("bb", CSInfo.CallLocation.BlockNum);
480  YamlIO.mapRequired("offset", CSInfo.CallLocation.Offset);
481  YamlIO.mapOptional("fwdArgRegs", CSInfo.ArgForwardingRegs,
482  std::vector<CallSiteInfo::ArgRegPair>());
483  }
484 
485  static const bool flow = true;
486 };
487 
488 /// Serializable representation of debug value substitutions.
490  unsigned SrcInst;
491  unsigned SrcOp;
492  unsigned DstInst;
493  unsigned DstOp;
494 
495  bool operator==(const DebugValueSubstitution &Other) const {
496  return std::tie(SrcInst, SrcOp, DstInst, DstOp) ==
497  std::tie(Other.SrcInst, Other.SrcOp, Other.DstInst, Other.DstOp);
498  }
499 };
500 
502  static void mapping(IO &YamlIO, DebugValueSubstitution &Sub) {
503  YamlIO.mapRequired("srcinst", Sub.SrcInst);
504  YamlIO.mapRequired("srcop", Sub.SrcOp);
505  YamlIO.mapRequired("dstinst", Sub.DstInst);
506  YamlIO.mapRequired("dstop", Sub.DstOp);
507  }
508 
509  static const bool flow = true;
510 };
511 } // namespace yaml
512 } // namespace llvm
513 
515 
516 namespace llvm {
517 namespace yaml {
522  bool IsTargetSpecific = false;
523 
524  bool operator==(const MachineConstantPoolValue &Other) const {
525  return ID == Other.ID && Value == Other.Value &&
526  Alignment == Other.Alignment &&
527  IsTargetSpecific == Other.IsTargetSpecific;
528  }
529 };
530 
533  YamlIO.mapRequired("id", Constant.ID);
534  YamlIO.mapOptional("value", Constant.Value, StringValue());
535  YamlIO.mapOptional("alignment", Constant.Alignment, None);
536  YamlIO.mapOptional("isTargetSpecific", Constant.IsTargetSpecific, false);
537  }
538 };
539 
541  struct Entry {
543  std::vector<FlowStringValue> Blocks;
544 
545  bool operator==(const Entry &Other) const {
546  return ID == Other.ID && Blocks == Other.Blocks;
547  }
548  };
549 
551  std::vector<Entry> Entries;
552 
553  bool operator==(const MachineJumpTable &Other) const {
554  return Kind == Other.Kind && Entries == Other.Entries;
555  }
556 };
557 
558 template <> struct MappingTraits<MachineJumpTable::Entry> {
559  static void mapping(IO &YamlIO, MachineJumpTable::Entry &Entry) {
560  YamlIO.mapRequired("id", Entry.ID);
561  YamlIO.mapOptional("blocks", Entry.Blocks, std::vector<FlowStringValue>());
562  }
563 };
564 
565 } // end namespace yaml
566 } // end namespace llvm
567 
575 
576 namespace llvm {
577 namespace yaml {
578 
579 template <> struct MappingTraits<MachineJumpTable> {
580  static void mapping(IO &YamlIO, MachineJumpTable &JT) {
581  YamlIO.mapRequired("kind", JT.Kind);
582  YamlIO.mapOptional("entries", JT.Entries,
583  std::vector<MachineJumpTable::Entry>());
584  }
585 };
586 
587 /// Serializable representation of MachineFrameInfo.
588 ///
589 /// Doesn't serialize attributes like 'StackAlignment', 'IsStackRealignable' and
590 /// 'RealignOption' as they are determined by the target and LLVM function
591 /// attributes.
592 /// It also doesn't serialize attributes like 'NumFixedObject' and
593 /// 'HasVarSizedObjects' as they are determined by the frame objects themselves.
595  bool IsFrameAddressTaken = false;
596  bool IsReturnAddressTaken = false;
597  bool HasStackMap = false;
598  bool HasPatchPoint = false;
599  uint64_t StackSize = 0;
601  unsigned MaxAlignment = 0;
602  bool AdjustsStack = false;
603  bool HasCalls = false;
605  // TODO: Serialize FunctionContextIdx
606  unsigned MaxCallFrameSize = ~0u; ///< ~0u means: not computed yet.
608  bool HasOpaqueSPAdjustment = false;
609  bool HasVAStart = false;
611  bool HasTailCall = false;
612  unsigned LocalFrameSize = 0;
615 
616  bool operator==(const MachineFrameInfo &Other) const {
617  return IsFrameAddressTaken == Other.IsFrameAddressTaken &&
618  IsReturnAddressTaken == Other.IsReturnAddressTaken &&
619  HasStackMap == Other.HasStackMap &&
620  HasPatchPoint == Other.HasPatchPoint &&
621  StackSize == Other.StackSize &&
622  OffsetAdjustment == Other.OffsetAdjustment &&
623  MaxAlignment == Other.MaxAlignment &&
624  AdjustsStack == Other.AdjustsStack && HasCalls == Other.HasCalls &&
625  StackProtector == Other.StackProtector &&
626  MaxCallFrameSize == Other.MaxCallFrameSize &&
628  Other.CVBytesOfCalleeSavedRegisters &&
629  HasOpaqueSPAdjustment == Other.HasOpaqueSPAdjustment &&
630  HasVAStart == Other.HasVAStart &&
631  HasMustTailInVarArgFunc == Other.HasMustTailInVarArgFunc &&
632  HasTailCall == Other.HasTailCall &&
633  LocalFrameSize == Other.LocalFrameSize &&
634  SavePoint == Other.SavePoint && RestorePoint == Other.RestorePoint;
635  }
636 };
637 
638 template <> struct MappingTraits<MachineFrameInfo> {
639  static void mapping(IO &YamlIO, MachineFrameInfo &MFI) {
640  YamlIO.mapOptional("isFrameAddressTaken", MFI.IsFrameAddressTaken, false);
641  YamlIO.mapOptional("isReturnAddressTaken", MFI.IsReturnAddressTaken, false);
642  YamlIO.mapOptional("hasStackMap", MFI.HasStackMap, false);
643  YamlIO.mapOptional("hasPatchPoint", MFI.HasPatchPoint, false);
644  YamlIO.mapOptional("stackSize", MFI.StackSize, (uint64_t)0);
645  YamlIO.mapOptional("offsetAdjustment", MFI.OffsetAdjustment, (int)0);
646  YamlIO.mapOptional("maxAlignment", MFI.MaxAlignment, (unsigned)0);
647  YamlIO.mapOptional("adjustsStack", MFI.AdjustsStack, false);
648  YamlIO.mapOptional("hasCalls", MFI.HasCalls, false);
649  YamlIO.mapOptional("stackProtector", MFI.StackProtector,
650  StringValue()); // Don't print it out when it's empty.
651  YamlIO.mapOptional("maxCallFrameSize", MFI.MaxCallFrameSize, (unsigned)~0);
652  YamlIO.mapOptional("cvBytesOfCalleeSavedRegisters",
654  YamlIO.mapOptional("hasOpaqueSPAdjustment", MFI.HasOpaqueSPAdjustment,
655  false);
656  YamlIO.mapOptional("hasVAStart", MFI.HasVAStart, false);
657  YamlIO.mapOptional("hasMustTailInVarArgFunc", MFI.HasMustTailInVarArgFunc,
658  false);
659  YamlIO.mapOptional("hasTailCall", MFI.HasTailCall, false);
660  YamlIO.mapOptional("localFrameSize", MFI.LocalFrameSize, (unsigned)0);
661  YamlIO.mapOptional("savePoint", MFI.SavePoint,
662  StringValue()); // Don't print it out when it's empty.
663  YamlIO.mapOptional("restorePoint", MFI.RestorePoint,
664  StringValue()); // Don't print it out when it's empty.
665  }
666 };
667 
668 /// Targets should override this in a way that mirrors the implementation of
669 /// llvm::MachineFunctionInfo.
671  virtual ~MachineFunctionInfo() {}
672  virtual void mappingImpl(IO &YamlIO) {}
673 };
674 
675 template <> struct MappingTraits<std::unique_ptr<MachineFunctionInfo>> {
676  static void mapping(IO &YamlIO, std::unique_ptr<MachineFunctionInfo> &MFI) {
677  if (MFI)
678  MFI->mappingImpl(YamlIO);
679  }
680 };
681 
685  bool ExposesReturnsTwice = false;
686  // GISel MachineFunctionProperties.
687  bool Legalized = false;
688  bool RegBankSelected = false;
689  bool Selected = false;
690  bool FailedISel = false;
691  // Register information
692  bool TracksRegLiveness = false;
693  bool HasWinCFI = false;
694  std::vector<VirtualRegisterDefinition> VirtualRegisters;
695  std::vector<MachineFunctionLiveIn> LiveIns;
697  // TODO: Serialize the various register masks.
698  // Frame information
700  std::vector<FixedMachineStackObject> FixedStackObjects;
701  std::vector<MachineStackObject> StackObjects;
702  std::vector<MachineConstantPoolValue> Constants; /// Constant pool.
703  std::unique_ptr<MachineFunctionInfo> MachineFuncInfo;
704  std::vector<CallSiteInfo> CallSitesInfo;
705  std::vector<DebugValueSubstitution> DebugValueSubstitutions;
708 };
709 
710 template <> struct MappingTraits<MachineFunction> {
711  static void mapping(IO &YamlIO, MachineFunction &MF) {
712  YamlIO.mapRequired("name", MF.Name);
713  YamlIO.mapOptional("alignment", MF.Alignment, None);
714  YamlIO.mapOptional("exposesReturnsTwice", MF.ExposesReturnsTwice, false);
715  YamlIO.mapOptional("legalized", MF.Legalized, false);
716  YamlIO.mapOptional("regBankSelected", MF.RegBankSelected, false);
717  YamlIO.mapOptional("selected", MF.Selected, false);
718  YamlIO.mapOptional("failedISel", MF.FailedISel, false);
719  YamlIO.mapOptional("tracksRegLiveness", MF.TracksRegLiveness, false);
720  YamlIO.mapOptional("hasWinCFI", MF.HasWinCFI, false);
721  YamlIO.mapOptional("registers", MF.VirtualRegisters,
722  std::vector<VirtualRegisterDefinition>());
723  YamlIO.mapOptional("liveins", MF.LiveIns,
724  std::vector<MachineFunctionLiveIn>());
725  YamlIO.mapOptional("calleeSavedRegisters", MF.CalleeSavedRegisters,
726  Optional<std::vector<FlowStringValue>>());
727  YamlIO.mapOptional("frameInfo", MF.FrameInfo, MachineFrameInfo());
728  YamlIO.mapOptional("fixedStack", MF.FixedStackObjects,
729  std::vector<FixedMachineStackObject>());
730  YamlIO.mapOptional("stack", MF.StackObjects,
731  std::vector<MachineStackObject>());
732  YamlIO.mapOptional("callSites", MF.CallSitesInfo,
733  std::vector<CallSiteInfo>());
734  YamlIO.mapOptional("debugValueSubstitutions", MF.DebugValueSubstitutions,
735  std::vector<DebugValueSubstitution>());
736  YamlIO.mapOptional("constants", MF.Constants,
737  std::vector<MachineConstantPoolValue>());
738  YamlIO.mapOptional("machineFunctionInfo", MF.MachineFuncInfo);
739  if (!YamlIO.outputting() || !MF.JumpTableInfo.Entries.empty())
740  YamlIO.mapOptional("jumpTable", MF.JumpTableInfo, MachineJumpTable());
741  YamlIO.mapOptional("body", MF.Body, BlockStringValue());
742  }
743 };
744 
745 } // end namespace yaml
746 } // end namespace llvm
747 
748 #endif // LLVM_CODEGEN_MIRYAMLMAPPING_H
llvm::yaml::FixedMachineStackObject::DebugExpr
StringValue DebugExpr
Definition: MIRYamlMapping.h:321
llvm::yaml::ScalarTraits< StringValue >::output
static void output(const StringValue &S, void *, raw_ostream &OS)
Definition: MIRYamlMapping.h:48
llvm::yaml::MachineFunction::RegBankSelected
bool RegBankSelected
Definition: MIRYamlMapping.h:688
llvm::yaml::FlowStringValue::FlowStringValue
FlowStringValue(std::string Value)
Definition: MIRYamlMapping.h:65
llvm::yaml::MachineFrameInfo::OffsetAdjustment
int OffsetAdjustment
Definition: MIRYamlMapping.h:600
llvm::yaml::MachineConstantPoolValue::ID
UnsignedValue ID
Definition: MIRYamlMapping.h:519
llvm::yaml::CallSiteInfo::ArgForwardingRegs
std::vector< ArgRegPair > ArgForwardingRegs
Definition: MIRYamlMapping.h:453
llvm
Definition: AllocatorList.h:23
Reg
unsigned Reg
Definition: MachineSink.cpp:1566
llvm::yaml::BlockScalarTraits< BlockStringValue >::output
static void output(const BlockStringValue &S, void *Ctx, raw_ostream &OS)
Definition: MIRYamlMapping.h:89
TargetFrameLowering.h
Optional.h
llvm::yaml::Node::getSourceRange
SMRange getSourceRange() const
Definition: YAMLParser.h:165
llvm::yaml::MappingTraits< CallSiteInfo::ArgRegPair >::mapping
static void mapping(IO &YamlIO, CallSiteInfo::ArgRegPair &ArgReg)
Definition: MIRYamlMapping.h:462
llvm::yaml::DebugValueSubstitution::SrcOp
unsigned SrcOp
Definition: MIRYamlMapping.h:491
llvm::yaml::MachineStackObject::Offset
int64_t Offset
Definition: MIRYamlMapping.h:246
llvm::yaml::ScalarTraits< StringValue >::mustQuote
static QuotingType mustQuote(StringRef S)
Definition: MIRYamlMapping.h:60
llvm::HexagonISD::JT
@ JT
Definition: HexagonISelLowering.h:52
llvm::yaml::MachineJumpTable::Entry
Definition: MIRYamlMapping.h:541
llvm::yaml::MachineFrameInfo::StackSize
uint64_t StackSize
Definition: MIRYamlMapping.h:599
StringRef.h
llvm::yaml::MachineFunctionInfo
Targets should override this in a way that mirrors the implementation of llvm::MachineFunctionInfo.
Definition: MIRYamlMapping.h:670
llvm::yaml::MappingTraits< MachineFrameInfo >::mapping
static void mapping(IO &YamlIO, MachineFrameInfo &MFI)
Definition: MIRYamlMapping.h:639
llvm::yaml::MachineFunction::JumpTableInfo
MachineJumpTable JumpTableInfo
Definition: MIRYamlMapping.h:706
llvm::yaml::Node
Abstract base class for all Nodes.
Definition: YAMLParser.h:119
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::yaml::MachineJumpTable::Entry::ID
UnsignedValue ID
Definition: MIRYamlMapping.h:542
llvm::yaml::StringValue::SourceRange
SMRange SourceRange
Definition: MIRYamlMapping.h:36
llvm::yaml::MachineFrameInfo::RestorePoint
StringValue RestorePoint
Definition: MIRYamlMapping.h:614
output
Current output
Definition: README.txt:1350
llvm::yaml::VirtualRegisterDefinition::PreferredRegister
StringValue PreferredRegister
Definition: MIRYamlMapping.h:191
llvm::yaml::MachineFunction::StackObjects
std::vector< MachineStackObject > StackObjects
Definition: MIRYamlMapping.h:701
llvm::yaml::MachineFunction::TracksRegLiveness
bool TracksRegLiveness
Definition: MIRYamlMapping.h:692
llvm::yaml::ScalarTraits< Align >::mustQuote
static QuotingType mustQuote(StringRef)
Definition: MIRYamlMapping.h:175
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_YAML_IS_SEQUENCE_VECTOR
#define LLVM_YAML_IS_SEQUENCE_VECTOR(type)
llvm::yaml::MachineFunctionLiveIn::Register
StringValue Register
Definition: MIRYamlMapping.h:213
llvm::yaml::MachineStackObject::DebugExpr
StringValue DebugExpr
Definition: MIRYamlMapping.h:254
llvm::yaml::ScalarTraits< FrameIndex >::output
static void output(const FrameIndex &FI, void *, raw_ostream &OS)
Definition: MIRYamlMapping.h:401
llvm::yaml::FixedMachineStackObject::CalleeSavedRegister
StringValue CalleeSavedRegister
Definition: MIRYamlMapping.h:318
MachineJumpTableInfo.h
llvm::Type
The instances of the Type class are immutable: once they are created, they are never changed.
Definition: Type.h:46
llvm::yaml::MappingTraits< MachineJumpTable >::mapping
static void mapping(IO &YamlIO, MachineJumpTable &JT)
Definition: MIRYamlMapping.h:580
llvm::yaml::CallSiteInfo::MachineInstrLoc::Offset
unsigned Offset
Definition: MIRYamlMapping.h:445
llvm::yaml::MachineFunction::Alignment
MaybeAlign Alignment
Definition: MIRYamlMapping.h:684
llvm::yaml::MachineFunctionInfo::mappingImpl
virtual void mappingImpl(IO &YamlIO)
Definition: MIRYamlMapping.h:672
llvm::yaml::MachineJumpTable::Entry::operator==
bool operator==(const Entry &Other) const
Definition: MIRYamlMapping.h:545
llvm::MachineJumpTableInfo::EK_BlockAddress
@ EK_BlockAddress
EK_BlockAddress - Each entry is a plain address of block, e.g.
Definition: MachineJumpTableInfo.h:49
YamlIO
IO & YamlIO
Definition: ELFYAML.cpp:1167
llvm::yaml::CallSiteInfo::MachineInstrLoc::operator==
bool operator==(const MachineInstrLoc &Other) const
Definition: MIRYamlMapping.h:447
llvm::Optional< int64_t >
llvm::yaml::FixedMachineStackObject::SpillSlot
@ SpillSlot
Definition: MIRYamlMapping.h:309
llvm::yaml::FrameIndex::IsFixed
bool IsFixed
Definition: MIRYamlMapping.h:391
llvm::yaml::ScalarTraits< FlowStringValue >::input
static StringRef input(StringRef Scalar, void *Ctx, FlowStringValue &S)
Definition: MIRYamlMapping.h:73
llvm::Expected
Tagged union holding either a T or a Error.
Definition: APFloat.h:42
llvm::yaml::MappingTraits
Definition: ModuleSummaryIndex.h:50
llvm::yaml::DebugValueSubstitution::DstInst
unsigned DstInst
Definition: MIRYamlMapping.h:492
llvm::yaml::CallSiteInfo
Serializable representation of CallSiteInfo.
Definition: MIRYamlMapping.h:430
llvm::yaml::MachineConstantPoolValue::operator==
bool operator==(const MachineConstantPoolValue &Other) const
Definition: MIRYamlMapping.h:524
llvm::yaml::MachineFunctionLiveIn::operator==
bool operator==(const MachineFunctionLiveIn &Other) const
Definition: MIRYamlMapping.h:216
llvm::MachineJumpTableInfo::EK_Custom32
@ EK_Custom32
EK_Custom32 - Each entry is a 32-bit value that is custom lowered by the TargetLowering::LowerCustomJ...
Definition: MachineJumpTableInfo.h:76
llvm::yaml::DebugValueSubstitution
Serializable representation of debug value substitutions.
Definition: MIRYamlMapping.h:489
llvm::yaml::MachineFrameInfo::CVBytesOfCalleeSavedRegisters
unsigned CVBytesOfCalleeSavedRegisters
Definition: MIRYamlMapping.h:607
llvm::yaml::MappingTraits< std::unique_ptr< MachineFunctionInfo > >::mapping
static void mapping(IO &YamlIO, std::unique_ptr< MachineFunctionInfo > &MFI)
Definition: MIRYamlMapping.h:676
llvm::yaml::MappingTraits< DebugValueSubstitution >::mapping
static void mapping(IO &YamlIO, DebugValueSubstitution &Sub)
Definition: MIRYamlMapping.h:502
llvm::yaml::MachineFunction::Name
StringRef Name
Definition: MIRYamlMapping.h:683
llvm::yaml::VirtualRegisterDefinition
Definition: MIRYamlMapping.h:188
llvm::yaml::MachineJumpTable
Definition: MIRYamlMapping.h:540
llvm::yaml::MachineStackObject::StackID
TargetStackID::Value StackID
Definition: MIRYamlMapping.h:249
llvm::yaml::FlowStringValue
Definition: MIRYamlMapping.h:63
llvm::yaml::MachineStackObject::VariableSized
@ VariableSized
Definition: MIRYamlMapping.h:241
llvm::yaml::ScalarTraits< MaybeAlign >::output
static void output(const MaybeAlign &Alignment, void *, llvm::raw_ostream &out)
Definition: MIRYamlMapping.h:146
llvm::yaml::ScalarTraits< FrameIndex >::input
static StringRef input(StringRef Scalar, void *Ctx, FrameIndex &FI)
Definition: MIRYamlMapping.h:405
llvm::yaml::ScalarTraits< FlowStringValue >::mustQuote
static QuotingType mustQuote(StringRef S)
Definition: MIRYamlMapping.h:77
llvm::yaml::MachineStackObject::Alignment
MaybeAlign Alignment
Definition: MIRYamlMapping.h:248
llvm::yaml::MachineFrameInfo::AdjustsStack
bool AdjustsStack
Definition: MIRYamlMapping.h:602
llvm::yaml::ScalarTraits< FlowStringValue >::output
static void output(const FlowStringValue &S, void *, raw_ostream &OS)
Definition: MIRYamlMapping.h:69
llvm::yaml::MachineStackObject::CalleeSavedRegister
StringValue CalleeSavedRegister
Definition: MIRYamlMapping.h:250
llvm::yaml::CallSiteInfo::ArgRegPair::ArgNo
uint16_t ArgNo
Definition: MIRYamlMapping.h:435
llvm::yaml::FixedMachineStackObject::ObjectType
ObjectType
Definition: MIRYamlMapping.h:309
llvm::yaml::CallSiteInfo::operator==
bool operator==(const CallSiteInfo &Other) const
Definition: MIRYamlMapping.h:455
llvm::yaml::FixedMachineStackObject::Alignment
MaybeAlign Alignment
Definition: MIRYamlMapping.h:314
llvm::yaml::MachineStackObject::DefaultType
@ DefaultType
Definition: MIRYamlMapping.h:241
llvm::yaml::CallSiteInfo::CallLocation
MachineInstrLoc CallLocation
Definition: MIRYamlMapping.h:452
llvm::yaml::MachineFunction::MachineFuncInfo
std::unique_ptr< MachineFunctionInfo > MachineFuncInfo
Constant pool.
Definition: MIRYamlMapping.h:703
llvm::getAsUnsignedInteger
bool getAsUnsignedInteger(StringRef Str, unsigned Radix, unsigned long long &Result)
Helper functions for StringRef::getAsInteger.
Definition: StringRef.cpp:488
llvm::StackProtector
Definition: StackProtector.h:37
llvm::yaml::VirtualRegisterDefinition::operator==
bool operator==(const VirtualRegisterDefinition &Other) const
Definition: MIRYamlMapping.h:195
llvm::yaml::BlockScalarTraits< BlockStringValue >::input
static StringRef input(StringRef Scalar, void *Ctx, BlockStringValue &S)
Definition: MIRYamlMapping.h:93
llvm::MaybeAlign
This struct is a compact representation of a valid (power of two) or undefined (0) alignment.
Definition: Alignment.h:109
llvm::yaml::UnsignedValue::operator==
bool operator==(const UnsignedValue &Other) const
Definition: MIRYamlMapping.h:107
llvm::yaml::FixedMachineStackObject::StackID
TargetStackID::Value StackID
Definition: MIRYamlMapping.h:315
SMLoc.h
llvm::yaml::FixedMachineStackObject::operator==
bool operator==(const FixedMachineStackObject &Other) const
Definition: MIRYamlMapping.h:324
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::yaml::MachineFunction::CalleeSavedRegisters
Optional< std::vector< FlowStringValue > > CalleeSavedRegisters
Definition: MIRYamlMapping.h:696
llvm::yaml::MachineFrameInfo::HasVAStart
bool HasVAStart
Definition: MIRYamlMapping.h:609
llvm::yaml::CallSiteInfo::ArgRegPair::Reg
StringValue Reg
Definition: MIRYamlMapping.h:434
llvm::yaml::MachineFunction::FrameInfo
MachineFrameInfo FrameInfo
Definition: MIRYamlMapping.h:699
llvm::yaml::UnsignedValue::UnsignedValue
UnsignedValue()=default
llvm::yaml::MachineFrameInfo::HasCalls
bool HasCalls
Definition: MIRYamlMapping.h:603
llvm::yaml::MachineConstantPoolValue::Value
StringValue Value
Definition: MIRYamlMapping.h:520
Align
uint64_t Align
Definition: ELFObjHandler.cpp:83
input
The initial backend is deliberately restricted to z10 We should add support for later architectures at some point If an asm ties an i32 r result to an i64 input
Definition: README.txt:10
llvm::Align
This struct is a compact representation of a valid (non-zero power of two) alignment.
Definition: Alignment.h:39
llvm::yaml::DebugValueSubstitution::DstOp
unsigned DstOp
Definition: MIRYamlMapping.h:493
llvm::None
const NoneType None
Definition: None.h:23
llvm::yaml::StringValue::StringValue
StringValue(std::string Value)
Definition: MIRYamlMapping.h:39
llvm::MachineJumpTableInfo::EK_LabelDifference32
@ EK_LabelDifference32
EK_LabelDifference32 - Each entry is the address of the block minus the address of the jump table.
Definition: MachineJumpTableInfo.h:68
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:604
llvm::Value::Value
Value(Type *Ty, unsigned scid)
Definition: Value.cpp:58
llvm::yaml::FixedMachineStackObject::CalleeSavedRestored
bool CalleeSavedRestored
Definition: MIRYamlMapping.h:319
llvm::yaml::FlowStringValue::FlowStringValue
FlowStringValue()=default
llvm::MachineJumpTableInfo::EK_GPRel64BlockAddress
@ EK_GPRel64BlockAddress
EK_GPRel64BlockAddress - Each entry is an address of block, encoded with a relocation as gp-relative,...
Definition: MachineJumpTableInfo.h:54
llvm::Constant
This is an important base class in LLVM.
Definition: Constant.h:41
llvm::yaml::FixedMachineStackObject::ID
UnsignedValue ID
Definition: MIRYamlMapping.h:310
llvm::yaml::MachineFunction::Selected
bool Selected
Definition: MIRYamlMapping.h:689
llvm::yaml::DebugValueSubstitution::SrcInst
unsigned SrcInst
Definition: MIRYamlMapping.h:490
llvm::yaml::ScalarTraits< MaybeAlign >::input
static StringRef input(StringRef Scalar, void *, MaybeAlign &Alignment)
Definition: MIRYamlMapping.h:150
llvm::yaml::CallSiteInfo::ArgRegPair::operator==
bool operator==(const ArgRegPair &Other) const
Definition: MIRYamlMapping.h:437
llvm::yaml::MachineConstantPoolValue::IsTargetSpecific
bool IsTargetSpecific
Definition: MIRYamlMapping.h:522
llvm::yaml::MachineFrameInfo::LocalFrameSize
unsigned LocalFrameSize
Definition: MIRYamlMapping.h:612
LLVM_YAML_IS_FLOW_SEQUENCE_VECTOR
#define LLVM_YAML_IS_FLOW_SEQUENCE_VECTOR(type)
llvm::yaml::MappingTraits< MachineJumpTable::Entry >::mapping
static void mapping(IO &YamlIO, MachineJumpTable::Entry &Entry)
Definition: MIRYamlMapping.h:559
llvm::yaml::MappingTraits< MachineConstantPoolValue >::mapping
static void mapping(IO &YamlIO, MachineConstantPoolValue &Constant)
Definition: MIRYamlMapping.h:532
llvm::yaml::MappingTraits< FixedMachineStackObject >::mapping
static void mapping(yaml::IO &YamlIO, FixedMachineStackObject &Object)
Definition: MIRYamlMapping.h:356
llvm::yaml::MachineJumpTable::Entry::Blocks
std::vector< FlowStringValue > Blocks
Definition: MIRYamlMapping.h:543
llvm::yaml::FixedMachineStackObject::Size
uint64_t Size
Definition: MIRYamlMapping.h:313
llvm::TargetStackID::ScalableVector
@ ScalableVector
Definition: TargetFrameLowering.h:30
llvm::yaml::MachineFrameInfo::operator==
bool operator==(const MachineFrameInfo &Other) const
Definition: MIRYamlMapping.h:616
llvm::MachineJumpTableInfo::JTEntryKind
JTEntryKind
JTEntryKind - This enum indicates how each entry of the jump table is represented and emitted.
Definition: MachineJumpTableInfo.h:46
llvm::yaml::FixedMachineStackObject::DebugLoc
StringValue DebugLoc
Definition: MIRYamlMapping.h:322
llvm::yaml::MachineFunctionLiveIn::VirtualRegister
StringValue VirtualRegister
Definition: MIRYamlMapping.h:214
llvm::yaml::MachineFunction
Definition: MIRYamlMapping.h:682
llvm::yaml::MappingTraits< MachineStackObject >::mapping
static void mapping(yaml::IO &YamlIO, MachineStackObject &Object)
Definition: MIRYamlMapping.h:278
llvm::yaml::MachineFunction::FixedStackObjects
std::vector< FixedMachineStackObject > FixedStackObjects
Definition: MIRYamlMapping.h:700
llvm::move
OutputIt move(R &&Range, OutputIt Out)
Provide wrappers to std::move which take ranges instead of having to pass begin/end explicitly.
Definition: STLExtras.h:1540
llvm::yaml::MachineStackObject::LocalOffset
Optional< int64_t > LocalOffset
Definition: MIRYamlMapping.h:252
llvm::yaml::FrameIndex::FrameIndex
FrameIndex()
Definition: MIRYamlMapping.h:394
llvm::yaml::FixedMachineStackObject::DebugVar
StringValue DebugVar
Definition: MIRYamlMapping.h:320
llvm::yaml::ScalarTraits< UnsignedValue >::mustQuote
static QuotingType mustQuote(StringRef Scalar)
Definition: MIRYamlMapping.h:124
llvm::yaml::MachineJumpTable::operator==
bool operator==(const MachineJumpTable &Other) const
Definition: MIRYamlMapping.h:553
llvm::yaml::ScalarEnumerationTraits< FixedMachineStackObject::ObjectType >::enumeration
static void enumeration(yaml::IO &IO, FixedMachineStackObject::ObjectType &Type)
Definition: MIRYamlMapping.h:338
llvm::yaml::StringValue
A wrapper around std::string which contains a source range that's being set during parsing.
Definition: MIRYamlMapping.h:34
llvm::yaml::MachineStackObject::SpillSlot
@ SpillSlot
Definition: MIRYamlMapping.h:241
llvm::yaml::ScalarTraits< Align >::output
static void output(const Align &Alignment, void *, llvm::raw_ostream &OS)
Definition: MIRYamlMapping.h:163
llvm::yaml::MachineFrameInfo::HasOpaqueSPAdjustment
bool HasOpaqueSPAdjustment
Definition: MIRYamlMapping.h:608
llvm::yaml::VirtualRegisterDefinition::Class
StringValue Class
Definition: MIRYamlMapping.h:190
llvm::yaml::ScalarEnumerationTraits< MachineJumpTableInfo::JTEntryKind >::enumeration
static void enumeration(yaml::IO &IO, MachineJumpTableInfo::JTEntryKind &EntryKind)
Definition: MIRYamlMapping.h:130
YAMLTraits.h
llvm::yaml::MachineJumpTable::Entries
std::vector< Entry > Entries
Definition: MIRYamlMapping.h:551
llvm::yaml::MachineFrameInfo::MaxCallFrameSize
unsigned MaxCallFrameSize
~0u means: not computed yet.
Definition: MIRYamlMapping.h:606
llvm::yaml::MachineFunction::Legalized
bool Legalized
Definition: MIRYamlMapping.h:687
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:550
llvm::TargetStackID::NoAlloc
@ NoAlloc
Definition: TargetFrameLowering.h:31
llvm::yaml::MachineFunction::FailedISel
bool FailedISel
Definition: MIRYamlMapping.h:690
llvm::yaml::FrameIndex::FI
int FI
Definition: MIRYamlMapping.h:390
S
add sub stmia L5 ldr r0 bl L_printf $stub Instead of a and a wouldn t it be better to do three moves *Return an aggregate type is even return S
Definition: README.txt:210
llvm::yaml::MachineFrameInfo::HasStackMap
bool HasStackMap
Definition: MIRYamlMapping.h:597
llvm::StringRef::consumeInteger
std::enable_if_t< std::numeric_limits< T >::is_signed, bool > consumeInteger(unsigned Radix, T &Result)
Parse the current string as an integer of the specified radix.
Definition: StringRef.h:545
llvm::yaml::BlockStringValue::operator==
bool operator==(const BlockStringValue &Other) const
Definition: MIRYamlMapping.h:83
llvm::Register
Wrapper class representing virtual and physical registers.
Definition: Register.h:19
llvm::yaml::ScalarTraits< UnsignedValue >::output
static void output(const UnsignedValue &Value, void *Ctx, raw_ostream &OS)
Definition: MIRYamlMapping.h:113
llvm::yaml::MachineFrameInfo
Serializable representation of MachineFrameInfo.
Definition: MIRYamlMapping.h:594
llvm::yaml::StringValue::StringValue
StringValue(const char Val[])
Definition: MIRYamlMapping.h:40
llvm::yaml::UnsignedValue::SourceRange
SMRange SourceRange
Definition: MIRYamlMapping.h:102
llvm::yaml::MachineFrameInfo::IsFrameAddressTaken
bool IsFrameAddressTaken
Definition: MIRYamlMapping.h:595
llvm::yaml::MappingTraits< MachineFunction >::mapping
static void mapping(IO &YamlIO, MachineFunction &MF)
Definition: MIRYamlMapping.h:711
llvm::yaml::MachineFunction::DebugValueSubstitutions
std::vector< DebugValueSubstitution > DebugValueSubstitutions
Definition: MIRYamlMapping.h:705
llvm::yaml::MachineStackObject::DebugVar
StringValue DebugVar
Definition: MIRYamlMapping.h:253
llvm::yaml::MachineFunction::VirtualRegisters
std::vector< VirtualRegisterDefinition > VirtualRegisters
Definition: MIRYamlMapping.h:694
llvm::yaml::MachineFunction::ExposesReturnsTwice
bool ExposesReturnsTwice
Definition: MIRYamlMapping.h:685
llvm::yaml::ScalarTraits< MaybeAlign >::mustQuote
static QuotingType mustQuote(StringRef)
Definition: MIRYamlMapping.h:159
llvm::yaml::MachineFrameInfo::IsReturnAddressTaken
bool IsReturnAddressTaken
Definition: MIRYamlMapping.h:596
std
Definition: BitVector.h:838
llvm::yaml::FixedMachineStackObject::IsAliased
bool IsAliased
Definition: MIRYamlMapping.h:317
uint16_t
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::UnsignedValue::UnsignedValue
UnsignedValue(unsigned Value)
Definition: MIRYamlMapping.h:105
llvm::yaml::StringValue::Value
std::string Value
Definition: MIRYamlMapping.h:35
llvm::yaml::UnsignedValue
A wrapper around unsigned which contains a source range that's being set during parsing.
Definition: MIRYamlMapping.h:100
llvm::MachineJumpTableInfo::EK_Inline
@ EK_Inline
EK_Inline - Jump table entries are emitted inline at their point of use.
Definition: MachineJumpTableInfo.h:72
llvm::yaml::MachineStackObject::ID
UnsignedValue ID
Definition: MIRYamlMapping.h:242
llvm::yaml::FixedMachineStackObject::Offset
int64_t Offset
Definition: MIRYamlMapping.h:312
llvm::yaml::ScalarTraits< StringValue >::input
static StringRef input(StringRef Scalar, void *Ctx, StringValue &S)
Definition: MIRYamlMapping.h:52
llvm::TargetStackID::Value
Value
Definition: TargetFrameLowering.h:27
llvm::yaml::MachineStackObject::Size
uint64_t Size
Definition: MIRYamlMapping.h:247
llvm::yaml::FrameIndex
A serializaable representation of a reference to a stack object or fixed stack object.
Definition: MIRYamlMapping.h:386
llvm::TargetStackID::Default
@ Default
Definition: TargetFrameLowering.h:28
llvm::TargetStackID::SGPRSpill
@ SGPRSpill
Definition: TargetFrameLowering.h:29
llvm::yaml::ScalarTraits< Align >::input
static StringRef input(StringRef Scalar, void *, Align &Alignment)
Definition: MIRYamlMapping.h:166
llvm::yaml::MachineStackObject::DebugLoc
StringValue DebugLoc
Definition: MIRYamlMapping.h:255
llvm::yaml::MachineConstantPoolValue::Alignment
MaybeAlign Alignment
Definition: MIRYamlMapping.h:521
llvm::yaml::MachineFunction::LiveIns
std::vector< MachineFunctionLiveIn > LiveIns
Definition: MIRYamlMapping.h:695
llvm::yaml::MachineStackObject::operator==
bool operator==(const MachineStackObject &Other) const
Definition: MIRYamlMapping.h:257
llvm::yaml::MachineFrameInfo::SavePoint
StringValue SavePoint
Definition: MIRYamlMapping.h:613
llvm::yaml::MachineStackObject::CalleeSavedRestored
bool CalleeSavedRestored
Definition: MIRYamlMapping.h:251
llvm::yaml::DebugValueSubstitution::operator==
bool operator==(const DebugValueSubstitution &Other) const
Definition: MIRYamlMapping.h:495
llvm::yaml::MachineFunction::HasWinCFI
bool HasWinCFI
Definition: MIRYamlMapping.h:693
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:444
llvm::yaml::StringValue::StringValue
StringValue()=default
llvm::yaml::MachineFrameInfo::HasTailCall
bool HasTailCall
Definition: MIRYamlMapping.h:611
llvm::yaml::MachineFunction::Body
BlockStringValue Body
Definition: MIRYamlMapping.h:707
llvm::yaml::MachineFunctionInfo::~MachineFunctionInfo
virtual ~MachineFunctionInfo()
Definition: MIRYamlMapping.h:671
llvm::yaml::VirtualRegisterDefinition::ID
UnsignedValue ID
Definition: MIRYamlMapping.h:189
llvm::yaml::MachineFunctionLiveIn
Definition: MIRYamlMapping.h:212
llvm::yaml::MachineFrameInfo::MaxAlignment
unsigned MaxAlignment
Definition: MIRYamlMapping.h:601
llvm::yaml::MachineFrameInfo::HasMustTailInVarArgFunc
bool HasMustTailInVarArgFunc
Definition: MIRYamlMapping.h:610
llvm::SMRange
Represents a range in source code.
Definition: SMLoc.h:48
N
#define N
llvm::DstOp
Definition: MachineIRBuilder.h:58
llvm::yaml::MachineConstantPoolValue
Definition: MIRYamlMapping.h:518
llvm::yaml::BlockStringValue
Definition: MIRYamlMapping.h:80
llvm::MachineJumpTableInfo::EK_GPRel32BlockAddress
@ EK_GPRel32BlockAddress
EK_GPRel32BlockAddress - Each entry is an address of block, encoded with a relocation as gp-relative,...
Definition: MachineJumpTableInfo.h:59
llvm::yaml::MachineFrameInfo::HasPatchPoint
bool HasPatchPoint
Definition: MIRYamlMapping.h:598
llvm::yaml::CallSiteInfo::MachineInstrLoc
Identifies call instruction location in machine function.
Definition: MIRYamlMapping.h:443
llvm::yaml::FrameIndex::SourceRange
SMRange SourceRange
Definition: MIRYamlMapping.h:392
llvm::yaml::FrameIndex::getFI
Expected< int > getFI(const llvm::MachineFrameInfo &MFI) const
Definition: MIRYamlMapping.cpp:30
llvm::DebugLoc
A debug info location.
Definition: DebugLoc.h:33
llvm::MachineJumpTableInfo
Definition: MachineJumpTableInfo.h:42
llvm::yaml::ScalarEnumerationTraits< TargetStackID::Value >::enumeration
static void enumeration(yaml::IO &IO, TargetStackID::Value &ID)
Definition: MIRYamlMapping.h:347
raw_ostream.h
llvm::yaml::MachineFunction::CallSitesInfo
std::vector< CallSiteInfo > CallSitesInfo
Definition: MIRYamlMapping.h:704
n
The same transformation can work with an even modulo with the addition of a and shrink the compare RHS by the same amount Unless the target supports that transformation probably isn t worthwhile The transformation can also easily be made to work with non zero equality for n
Definition: README.txt:685
llvm::isPowerOf2_64
constexpr bool isPowerOf2_64(uint64_t Value)
Return true if the argument is a power of two > 0 (64 bit edition.)
Definition: MathExtras.h:496
llvm::yaml::ScalarTraits< UnsignedValue >::input
static StringRef input(StringRef Scalar, void *Ctx, UnsignedValue &Value)
Definition: MIRYamlMapping.h:117
llvm::Value
LLVM Value Representation.
Definition: Value.h:75
llvm::yaml::ScalarEnumerationTraits< MachineStackObject::ObjectType >::enumeration
static void enumeration(yaml::IO &IO, MachineStackObject::ObjectType &Type)
Definition: MIRYamlMapping.h:270
llvm::yaml::MappingTraits< MachineFunctionLiveIn >::mapping
static void mapping(IO &YamlIO, MachineFunctionLiveIn &LiveIn)
Definition: MIRYamlMapping.h:223
llvm::yaml::BlockStringValue::Value
StringValue Value
Definition: MIRYamlMapping.h:81
llvm::SrcOp
Definition: MachineIRBuilder.h:119
llvm::yaml::MachineStackObject::ObjectType
ObjectType
Definition: MIRYamlMapping.h:241
llvm::yaml::MappingTraits< VirtualRegisterDefinition >::mapping
static void mapping(IO &YamlIO, VirtualRegisterDefinition &Reg)
Definition: MIRYamlMapping.h:202
llvm::yaml::MachineFunction::Constants
std::vector< MachineConstantPoolValue > Constants
Definition: MIRYamlMapping.h:702
llvm::yaml::ScalarTraits< FrameIndex >::mustQuote
static QuotingType mustQuote(StringRef S)
Definition: MIRYamlMapping.h:426
Other
Optional< std::vector< StOtherPiece > > Other
Definition: ELFYAML.cpp:1168
llvm::yaml::MappingTraits< CallSiteInfo >::mapping
static void mapping(IO &YamlIO, CallSiteInfo &CSInfo)
Definition: MIRYamlMapping.h:478
llvm::yaml::CallSiteInfo::ArgRegPair
Definition: MIRYamlMapping.h:433
llvm::Intrinsic::ID
unsigned ID
Definition: TargetTransformInfo.h:38
llvm::yaml::StringValue::operator==
bool operator==(const StringValue &Other) const
Definition: MIRYamlMapping.h:42
llvm::yaml::MachineStackObject::Name
StringValue Name
Definition: MIRYamlMapping.h:243