LLVM  13.0.0git
ModuleSummaryIndex.h
Go to the documentation of this file.
1 //===- llvm/ModuleSummaryIndex.h - Module Summary Index ---------*- 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 /// @file
10 /// ModuleSummaryIndex.h This file contains the declarations the classes that
11 /// hold the module index and summary for function importing.
12 //
13 //===----------------------------------------------------------------------===//
14 
15 #ifndef LLVM_IR_MODULESUMMARYINDEX_H
16 #define LLVM_IR_MODULESUMMARYINDEX_H
17 
18 #include "llvm/ADT/ArrayRef.h"
19 #include "llvm/ADT/DenseMap.h"
20 #include "llvm/ADT/STLExtras.h"
21 #include "llvm/ADT/SmallString.h"
22 #include "llvm/ADT/StringExtras.h"
23 #include "llvm/ADT/StringMap.h"
24 #include "llvm/ADT/StringRef.h"
25 #include "llvm/ADT/TinyPtrVector.h"
26 #include "llvm/IR/ConstantRange.h"
27 #include "llvm/IR/GlobalValue.h"
28 #include "llvm/IR/Module.h"
29 #include "llvm/Support/Allocator.h"
34 #include <algorithm>
35 #include <array>
36 #include <cassert>
37 #include <cstddef>
38 #include <cstdint>
39 #include <map>
40 #include <memory>
41 #include <set>
42 #include <string>
43 #include <utility>
44 #include <vector>
45 
46 namespace llvm {
47 
48 namespace yaml {
49 
50 template <typename T> struct MappingTraits;
51 
52 } // end namespace yaml
53 
54 /// Class to accumulate and hold information about a callee.
55 struct CalleeInfo {
56  enum class HotnessType : uint8_t {
57  Unknown = 0,
58  Cold = 1,
59  None = 2,
60  Hot = 3,
61  Critical = 4
62  };
63 
64  // The size of the bit-field might need to be adjusted if more values are
65  // added to HotnessType enum.
67 
68  /// The value stored in RelBlockFreq has to be interpreted as the digits of
69  /// a scaled number with a scale of \p -ScaleShift.
71  static constexpr int32_t ScaleShift = 8;
72  static constexpr uint64_t MaxRelBlockFreq = (1 << 29) - 1;
73 
75  : Hotness(static_cast<uint32_t>(HotnessType::Unknown)), RelBlockFreq(0) {}
76  explicit CalleeInfo(HotnessType Hotness, uint64_t RelBF)
77  : Hotness(static_cast<uint32_t>(Hotness)), RelBlockFreq(RelBF) {}
78 
79  void updateHotness(const HotnessType OtherHotness) {
80  Hotness = std::max(Hotness, static_cast<uint32_t>(OtherHotness));
81  }
82 
84 
85  /// Update \p RelBlockFreq from \p BlockFreq and \p EntryFreq
86  ///
87  /// BlockFreq is divided by EntryFreq and added to RelBlockFreq. To represent
88  /// fractional values, the result is represented as a fixed point number with
89  /// scale of -ScaleShift.
90  void updateRelBlockFreq(uint64_t BlockFreq, uint64_t EntryFreq) {
91  if (EntryFreq == 0)
92  return;
94  Scaled64 Temp(BlockFreq, ScaleShift);
95  Temp /= Scaled64::get(EntryFreq);
96 
97  uint64_t Sum =
98  SaturatingAdd<uint64_t>(Temp.toInt<uint64_t>(), RelBlockFreq);
99  Sum = std::min(Sum, uint64_t(MaxRelBlockFreq));
100  RelBlockFreq = static_cast<uint32_t>(Sum);
101  }
102 };
103 
104 inline const char *getHotnessName(CalleeInfo::HotnessType HT) {
105  switch (HT) {
107  return "unknown";
109  return "cold";
111  return "none";
113  return "hot";
115  return "critical";
116  }
117  llvm_unreachable("invalid hotness");
118 }
119 
120 class GlobalValueSummary;
121 
122 using GlobalValueSummaryList = std::vector<std::unique_ptr<GlobalValueSummary>>;
123 
124 struct alignas(8) GlobalValueSummaryInfo {
125  union NameOrGV {
126  NameOrGV(bool HaveGVs) {
127  if (HaveGVs)
128  GV = nullptr;
129  else
130  Name = "";
131  }
132 
133  /// The GlobalValue corresponding to this summary. This is only used in
134  /// per-module summaries and when the IR is available. E.g. when module
135  /// analysis is being run, or when parsing both the IR and the summary
136  /// from assembly.
137  const GlobalValue *GV;
138 
139  /// Summary string representation. This StringRef points to BC module
140  /// string table and is valid until module data is stored in memory.
141  /// This is guaranteed to happen until runThinLTOBackend function is
142  /// called, so it is safe to use this field during thin link. This field
143  /// is only valid if summary index was loaded from BC file.
145  } U;
146 
147  GlobalValueSummaryInfo(bool HaveGVs) : U(HaveGVs) {}
148 
149  /// List of global value summary structures for a particular value held
150  /// in the GlobalValueMap. Requires a vector in the case of multiple
151  /// COMDAT values of the same name.
153 };
154 
155 /// Map from global value GUID to corresponding summary structures. Use a
156 /// std::map rather than a DenseMap so that pointers to the map's value_type
157 /// (which are used by ValueInfo) are not invalidated by insertion. Also it will
158 /// likely incur less overhead, as the value type is not very small and the size
159 /// of the map is unknown, resulting in inefficiencies due to repeated
160 /// insertions and resizing.
162  std::map<GlobalValue::GUID, GlobalValueSummaryInfo>;
163 
164 /// Struct that holds a reference to a particular GUID in a global value
165 /// summary.
166 struct ValueInfo {
167  enum Flags { HaveGV = 1, ReadOnly = 2, WriteOnly = 4 };
170 
171  ValueInfo() = default;
172  ValueInfo(bool HaveGVs, const GlobalValueSummaryMapTy::value_type *R) {
174  RefAndFlags.setInt(HaveGVs);
175  }
176 
177  explicit operator bool() const { return getRef(); }
178 
179  GlobalValue::GUID getGUID() const { return getRef()->first; }
180  const GlobalValue *getValue() const {
181  assert(haveGVs());
182  return getRef()->second.U.GV;
183  }
184 
186  return getRef()->second.SummaryList;
187  }
188 
189  StringRef name() const {
190  return haveGVs() ? getRef()->second.U.GV->getName()
191  : getRef()->second.U.Name;
192  }
193 
194  bool haveGVs() const { return RefAndFlags.getInt() & HaveGV; }
195  bool isReadOnly() const {
197  return RefAndFlags.getInt() & ReadOnly;
198  }
199  bool isWriteOnly() const {
201  return RefAndFlags.getInt() & WriteOnly;
202  }
203  unsigned getAccessSpecifier() const {
205  return RefAndFlags.getInt() & (ReadOnly | WriteOnly);
206  }
207  bool isValidAccessSpecifier() const {
208  unsigned BadAccessMask = ReadOnly | WriteOnly;
209  return (RefAndFlags.getInt() & BadAccessMask) != BadAccessMask;
210  }
211  void setReadOnly() {
212  // We expect ro/wo attribute to set only once during
213  // ValueInfo lifetime.
214  assert(getAccessSpecifier() == 0);
216  }
217  void setWriteOnly() {
218  assert(getAccessSpecifier() == 0);
220  }
221 
222  const GlobalValueSummaryMapTy::value_type *getRef() const {
223  return RefAndFlags.getPointer();
224  }
225 
226  /// Returns the most constraining visibility among summaries. The
227  /// visibilities, ordered from least to most constraining, are: default,
228  /// protected and hidden.
230 
231  /// Checks if all summaries are DSO local (have the flag set). When DSOLocal
232  /// propagation has been done, set the parameter to enable fast check.
233  bool isDSOLocal(bool WithDSOLocalPropagation = false) const;
234 
235  /// Checks if all copies are eligible for auto-hiding (have flag set).
236  bool canAutoHide() const;
237 };
238 
240  OS << VI.getGUID();
241  if (!VI.name().empty())
242  OS << " (" << VI.name() << ")";
243  return OS;
244 }
245 
246 inline bool operator==(const ValueInfo &A, const ValueInfo &B) {
247  assert(A.getRef() && B.getRef() &&
248  "Need ValueInfo with non-null Ref for comparison");
249  return A.getRef() == B.getRef();
250 }
251 
252 inline bool operator!=(const ValueInfo &A, const ValueInfo &B) {
253  assert(A.getRef() && B.getRef() &&
254  "Need ValueInfo with non-null Ref for comparison");
255  return A.getRef() != B.getRef();
256 }
257 
258 inline bool operator<(const ValueInfo &A, const ValueInfo &B) {
259  assert(A.getRef() && B.getRef() &&
260  "Need ValueInfo with non-null Ref to compare GUIDs");
261  return A.getGUID() < B.getGUID();
262 }
263 
264 template <> struct DenseMapInfo<ValueInfo> {
265  static inline ValueInfo getEmptyKey() {
266  return ValueInfo(false, (GlobalValueSummaryMapTy::value_type *)-8);
267  }
268 
269  static inline ValueInfo getTombstoneKey() {
270  return ValueInfo(false, (GlobalValueSummaryMapTy::value_type *)-16);
271  }
272 
273  static inline bool isSpecialKey(ValueInfo V) {
274  return V == getTombstoneKey() || V == getEmptyKey();
275  }
276 
277  static bool isEqual(ValueInfo L, ValueInfo R) {
278  // We are not supposed to mix ValueInfo(s) with different HaveGVs flag
279  // in a same container.
280  assert(isSpecialKey(L) || isSpecialKey(R) || (L.haveGVs() == R.haveGVs()));
281  return L.getRef() == R.getRef();
282  }
283  static unsigned getHashValue(ValueInfo I) { return (uintptr_t)I.getRef(); }
284 };
285 
286 /// Function and variable summary information to aid decisions and
287 /// implementation of importing.
289 public:
290  /// Sububclass discriminator (for dyn_cast<> et al.)
292 
293  /// Group flags (Linkage, NotEligibleToImport, etc.) as a bitfield.
294  struct GVFlags {
295  /// The linkage type of the associated global value.
296  ///
297  /// One use is to flag values that have local linkage types and need to
298  /// have module identifier appended before placing into the combined
299  /// index, to disambiguate from other values with the same name.
300  /// In the future this will be used to update and optimize linkage
301  /// types based on global summary-based analysis.
302  unsigned Linkage : 4;
303 
304  /// Indicates the visibility.
305  unsigned Visibility : 2;
306 
307  /// Indicate if the global value cannot be imported (e.g. it cannot
308  /// be renamed or references something that can't be renamed).
309  unsigned NotEligibleToImport : 1;
310 
311  /// In per-module summary, indicate that the global value must be considered
312  /// a live root for index-based liveness analysis. Used for special LLVM
313  /// values such as llvm.global_ctors that the linker does not know about.
314  ///
315  /// In combined summary, indicate that the global value is live.
316  unsigned Live : 1;
317 
318  /// Indicates that the linker resolved the symbol to a definition from
319  /// within the same linkage unit.
320  unsigned DSOLocal : 1;
321 
322  /// In the per-module summary, indicates that the global value is
323  /// linkonce_odr and global unnamed addr (so eligible for auto-hiding
324  /// via hidden visibility). In the combined summary, indicates that the
325  /// prevailing linkonce_odr copy can be auto-hidden via hidden visibility
326  /// when it is upgraded to weak_odr in the backend. This is legal when
327  /// all copies are eligible for auto-hiding (i.e. all copies were
328  /// linkonce_odr global unnamed addr. If any copy is not (e.g. it was
329  /// originally weak_odr, we cannot auto-hide the prevailing copy as it
330  /// means the symbol was externally visible.
331  unsigned CanAutoHide : 1;
332 
333  /// Convenience Constructors
336  bool NotEligibleToImport, bool Live, bool IsLocal,
337  bool CanAutoHide)
340  DSOLocal(IsLocal), CanAutoHide(CanAutoHide) {}
341  };
342 
343 private:
344  /// Kind of summary for use in dyn_cast<> et al.
345  SummaryKind Kind;
346 
347  GVFlags Flags;
348 
349  /// This is the hash of the name of the symbol in the original file. It is
350  /// identical to the GUID for global symbols, but differs for local since the
351  /// GUID includes the module level id in the hash.
352  GlobalValue::GUID OriginalName = 0;
353 
354  /// Path of module IR containing value's definition, used to locate
355  /// module during importing.
356  ///
357  /// This is only used during parsing of the combined index, or when
358  /// parsing the per-module index for creation of the combined summary index,
359  /// not during writing of the per-module index which doesn't contain a
360  /// module path string table.
361  StringRef ModulePath;
362 
363  /// List of values referenced by this global value's definition
364  /// (either by the initializer of a global variable, or referenced
365  /// from within a function). This does not include functions called, which
366  /// are listed in the derived FunctionSummary object.
367  std::vector<ValueInfo> RefEdgeList;
368 
369 protected:
370  GlobalValueSummary(SummaryKind K, GVFlags Flags, std::vector<ValueInfo> Refs)
371  : Kind(K), Flags(Flags), RefEdgeList(std::move(Refs)) {
372  assert((K != AliasKind || Refs.empty()) &&
373  "Expect no references for AliasSummary");
374  }
375 
376 public:
377  virtual ~GlobalValueSummary() = default;
378 
379  /// Returns the hash of the original name, it is identical to the GUID for
380  /// externally visible symbols, but not for local ones.
381  GlobalValue::GUID getOriginalName() const { return OriginalName; }
382 
383  /// Initialize the original name hash in this summary.
384  void setOriginalName(GlobalValue::GUID Name) { OriginalName = Name; }
385 
386  /// Which kind of summary subclass this is.
387  SummaryKind getSummaryKind() const { return Kind; }
388 
389  /// Set the path to the module containing this function, for use in
390  /// the combined index.
391  void setModulePath(StringRef ModPath) { ModulePath = ModPath; }
392 
393  /// Get the path to the module containing this function.
394  StringRef modulePath() const { return ModulePath; }
395 
396  /// Get the flags for this GlobalValue (see \p struct GVFlags).
397  GVFlags flags() const { return Flags; }
398 
399  /// Return linkage type recorded for this global value.
401  return static_cast<GlobalValue::LinkageTypes>(Flags.Linkage);
402  }
403 
404  /// Sets the linkage to the value determined by global summary-based
405  /// optimization. Will be applied in the ThinLTO backends.
407  Flags.Linkage = Linkage;
408  }
409 
410  /// Return true if this global value can't be imported.
411  bool notEligibleToImport() const { return Flags.NotEligibleToImport; }
412 
413  bool isLive() const { return Flags.Live; }
414 
415  void setLive(bool Live) { Flags.Live = Live; }
416 
417  void setDSOLocal(bool Local) { Flags.DSOLocal = Local; }
418 
419  bool isDSOLocal() const { return Flags.DSOLocal; }
420 
421  void setCanAutoHide(bool CanAutoHide) { Flags.CanAutoHide = CanAutoHide; }
422 
423  bool canAutoHide() const { return Flags.CanAutoHide; }
424 
426  return (GlobalValue::VisibilityTypes)Flags.Visibility;
427  }
429  Flags.Visibility = (unsigned)Vis;
430  }
431 
432  /// Flag that this global value cannot be imported.
433  void setNotEligibleToImport() { Flags.NotEligibleToImport = true; }
434 
435  /// Return the list of values referenced by this global value definition.
436  ArrayRef<ValueInfo> refs() const { return RefEdgeList; }
437 
438  /// If this is an alias summary, returns the summary of the aliased object (a
439  /// global variable or function), otherwise returns itself.
441  const GlobalValueSummary *getBaseObject() const;
442 
443  friend class ModuleSummaryIndex;
444 };
445 
446 /// Alias summary information.
448  ValueInfo AliaseeValueInfo;
449 
450  /// This is the Aliasee in the same module as alias (could get from VI, trades
451  /// memory for time). Note that this pointer may be null (and the value info
452  /// empty) when we have a distributed index where the alias is being imported
453  /// (as a copy of the aliasee), but the aliasee is not.
454  GlobalValueSummary *AliaseeSummary;
455 
456 public:
459  AliaseeSummary(nullptr) {}
460 
461  /// Check if this is an alias summary.
462  static bool classof(const GlobalValueSummary *GVS) {
463  return GVS->getSummaryKind() == AliasKind;
464  }
465 
466  void setAliasee(ValueInfo &AliaseeVI, GlobalValueSummary *Aliasee) {
467  AliaseeValueInfo = AliaseeVI;
468  AliaseeSummary = Aliasee;
469  }
470 
471  bool hasAliasee() const {
472  assert(!!AliaseeSummary == (AliaseeValueInfo &&
473  !AliaseeValueInfo.getSummaryList().empty()) &&
474  "Expect to have both aliasee summary and summary list or neither");
475  return !!AliaseeSummary;
476  }
477 
479  assert(AliaseeSummary && "Unexpected missing aliasee summary");
480  return *AliaseeSummary;
481  }
482 
484  return const_cast<GlobalValueSummary &>(
485  static_cast<const AliasSummary *>(this)->getAliasee());
486  }
488  assert(AliaseeValueInfo && "Unexpected missing aliasee");
489  return AliaseeValueInfo;
490  }
492  assert(AliaseeValueInfo && "Unexpected missing aliasee");
493  return AliaseeValueInfo.getGUID();
494  }
495 };
496 
498  if (auto *AS = dyn_cast<AliasSummary>(this))
499  return &AS->getAliasee();
500  return this;
501 }
502 
504  if (auto *AS = dyn_cast<AliasSummary>(this))
505  return &AS->getAliasee();
506  return this;
507 }
508 
509 /// Function summary information to aid decisions and implementation of
510 /// importing.
512 public:
513  /// <CalleeValueInfo, CalleeInfo> call edge pair.
514  using EdgeTy = std::pair<ValueInfo, CalleeInfo>;
515 
516  /// Types for -force-summary-edges-cold debugging option.
517  enum ForceSummaryHotnessType : unsigned {
521  };
522 
523  /// An "identifier" for a virtual function. This contains the type identifier
524  /// represented as a GUID and the offset from the address point to the virtual
525  /// function pointer, where "address point" is as defined in the Itanium ABI:
526  /// https://itanium-cxx-abi.github.io/cxx-abi/abi.html#vtable-general
527  struct VFuncId {
529  uint64_t Offset;
530  };
531 
532  /// A specification for a virtual function call with all constant integer
533  /// arguments. This is used to perform virtual constant propagation on the
534  /// summary.
535  struct ConstVCall {
537  std::vector<uint64_t> Args;
538  };
539 
540  /// All type identifier related information. Because these fields are
541  /// relatively uncommon we only allocate space for them if necessary.
542  struct TypeIdInfo {
543  /// List of type identifiers used by this function in llvm.type.test
544  /// intrinsics referenced by something other than an llvm.assume intrinsic,
545  /// represented as GUIDs.
546  std::vector<GlobalValue::GUID> TypeTests;
547 
548  /// List of virtual calls made by this function using (respectively)
549  /// llvm.assume(llvm.type.test) or llvm.type.checked.load intrinsics that do
550  /// not have all constant integer arguments.
552 
553  /// List of virtual calls made by this function using (respectively)
554  /// llvm.assume(llvm.type.test) or llvm.type.checked.load intrinsics with
555  /// all constant integer arguments.
556  std::vector<ConstVCall> TypeTestAssumeConstVCalls,
558  };
559 
560  /// Flags specific to function summaries.
561  struct FFlags {
562  // Function attribute flags. Used to track if a function accesses memory,
563  // recurses or aliases.
564  unsigned ReadNone : 1;
565  unsigned ReadOnly : 1;
566  unsigned NoRecurse : 1;
567  unsigned ReturnDoesNotAlias : 1;
568 
569  // Indicate if the global value cannot be inlined.
570  unsigned NoInline : 1;
571  // Indicate if function should be always inlined.
572  unsigned AlwaysInline : 1;
573  };
574 
575  /// Describes the uses of a parameter by the function.
576  struct ParamAccess {
577  static constexpr uint32_t RangeWidth = 64;
578 
579  /// Describes the use of a value in a call instruction, specifying the
580  /// call's target, the value's parameter number, and the possible range of
581  /// offsets from the beginning of the value that are passed.
582  struct Call {
583  uint64_t ParamNo = 0;
585  ConstantRange Offsets{/*BitWidth=*/RangeWidth, /*isFullSet=*/true};
586 
587  Call() = default;
590  };
591 
592  uint64_t ParamNo = 0;
593  /// The range contains byte offsets from the parameter pointer which
594  /// accessed by the function. In the per-module summary, it only includes
595  /// accesses made by the function instructions. In the combined summary, it
596  /// also includes accesses by nested function calls.
597  ConstantRange Use{/*BitWidth=*/RangeWidth, /*isFullSet=*/true};
598  /// In the per-module summary, it summarizes the byte offset applied to each
599  /// pointer parameter before passing to each corresponding callee.
600  /// In the combined summary, it's empty and information is propagated by
601  /// inter-procedural analysis and applied to the Use field.
602  std::vector<Call> Calls;
603 
604  ParamAccess() = default;
606  : ParamNo(ParamNo), Use(Use) {}
607  };
608 
609  /// Create an empty FunctionSummary (with specified call edges).
610  /// Used to represent external nodes and the dummy root node.
611  static FunctionSummary
612  makeDummyFunctionSummary(std::vector<FunctionSummary::EdgeTy> Edges) {
613  return FunctionSummary(
615  GlobalValue::LinkageTypes::AvailableExternallyLinkage,
617  /*NotEligibleToImport=*/true, /*Live=*/true, /*IsLocal=*/false,
618  /*CanAutoHide=*/false),
619  /*NumInsts=*/0, FunctionSummary::FFlags{}, /*EntryCount=*/0,
620  std::vector<ValueInfo>(), std::move(Edges),
621  std::vector<GlobalValue::GUID>(),
622  std::vector<FunctionSummary::VFuncId>(),
623  std::vector<FunctionSummary::VFuncId>(),
624  std::vector<FunctionSummary::ConstVCall>(),
625  std::vector<FunctionSummary::ConstVCall>(),
626  std::vector<FunctionSummary::ParamAccess>());
627  }
628 
629  /// A dummy node to reference external functions that aren't in the index
631 
632 private:
633  /// Number of instructions (ignoring debug instructions, e.g.) computed
634  /// during the initial compile step when the summary index is first built.
635  unsigned InstCount;
636 
637  /// Function summary specific flags.
638  FFlags FunFlags;
639 
640  /// The synthesized entry count of the function.
641  /// This is only populated during ThinLink phase and remains unused while
642  /// generating per-module summaries.
643  uint64_t EntryCount = 0;
644 
645  /// List of <CalleeValueInfo, CalleeInfo> call edge pairs from this function.
646  std::vector<EdgeTy> CallGraphEdgeList;
647 
648  std::unique_ptr<TypeIdInfo> TIdInfo;
649 
650  /// Uses for every parameter to this function.
651  using ParamAccessesTy = std::vector<ParamAccess>;
652  std::unique_ptr<ParamAccessesTy> ParamAccesses;
653 
654 public:
655  FunctionSummary(GVFlags Flags, unsigned NumInsts, FFlags FunFlags,
656  uint64_t EntryCount, std::vector<ValueInfo> Refs,
657  std::vector<EdgeTy> CGEdges,
658  std::vector<GlobalValue::GUID> TypeTests,
659  std::vector<VFuncId> TypeTestAssumeVCalls,
660  std::vector<VFuncId> TypeCheckedLoadVCalls,
661  std::vector<ConstVCall> TypeTestAssumeConstVCalls,
662  std::vector<ConstVCall> TypeCheckedLoadConstVCalls,
663  std::vector<ParamAccess> Params)
664  : GlobalValueSummary(FunctionKind, Flags, std::move(Refs)),
665  InstCount(NumInsts), FunFlags(FunFlags), EntryCount(EntryCount),
666  CallGraphEdgeList(std::move(CGEdges)) {
667  if (!TypeTests.empty() || !TypeTestAssumeVCalls.empty() ||
668  !TypeCheckedLoadVCalls.empty() || !TypeTestAssumeConstVCalls.empty() ||
669  !TypeCheckedLoadConstVCalls.empty())
670  TIdInfo = std::make_unique<TypeIdInfo>(
671  TypeIdInfo{std::move(TypeTests), std::move(TypeTestAssumeVCalls),
672  std::move(TypeCheckedLoadVCalls),
673  std::move(TypeTestAssumeConstVCalls),
674  std::move(TypeCheckedLoadConstVCalls)});
675  if (!Params.empty())
676  ParamAccesses = std::make_unique<ParamAccessesTy>(std::move(Params));
677  }
678  // Gets the number of readonly and writeonly refs in RefEdgeList
679  std::pair<unsigned, unsigned> specialRefCounts() const;
680 
681  /// Check if this is a function summary.
682  static bool classof(const GlobalValueSummary *GVS) {
683  return GVS->getSummaryKind() == FunctionKind;
684  }
685 
686  /// Get function summary flags.
687  FFlags fflags() const { return FunFlags; }
688 
689  /// Get the instruction count recorded for this function.
690  unsigned instCount() const { return InstCount; }
691 
692  /// Get the synthetic entry count for this function.
693  uint64_t entryCount() const { return EntryCount; }
694 
695  /// Set the synthetic entry count for this function.
696  void setEntryCount(uint64_t EC) { EntryCount = EC; }
697 
698  /// Return the list of <CalleeValueInfo, CalleeInfo> pairs.
699  ArrayRef<EdgeTy> calls() const { return CallGraphEdgeList; }
700 
701  void addCall(EdgeTy E) { CallGraphEdgeList.push_back(E); }
702 
703  /// Returns the list of type identifiers used by this function in
704  /// llvm.type.test intrinsics other than by an llvm.assume intrinsic,
705  /// represented as GUIDs.
707  if (TIdInfo)
708  return TIdInfo->TypeTests;
709  return {};
710  }
711 
712  /// Returns the list of virtual calls made by this function using
713  /// llvm.assume(llvm.type.test) intrinsics that do not have all constant
714  /// integer arguments.
716  if (TIdInfo)
717  return TIdInfo->TypeTestAssumeVCalls;
718  return {};
719  }
720 
721  /// Returns the list of virtual calls made by this function using
722  /// llvm.type.checked.load intrinsics that do not have all constant integer
723  /// arguments.
725  if (TIdInfo)
726  return TIdInfo->TypeCheckedLoadVCalls;
727  return {};
728  }
729 
730  /// Returns the list of virtual calls made by this function using
731  /// llvm.assume(llvm.type.test) intrinsics with all constant integer
732  /// arguments.
734  if (TIdInfo)
735  return TIdInfo->TypeTestAssumeConstVCalls;
736  return {};
737  }
738 
739  /// Returns the list of virtual calls made by this function using
740  /// llvm.type.checked.load intrinsics with all constant integer arguments.
742  if (TIdInfo)
743  return TIdInfo->TypeCheckedLoadConstVCalls;
744  return {};
745  }
746 
747  /// Returns the list of known uses of pointer parameters.
749  if (ParamAccesses)
750  return *ParamAccesses;
751  return {};
752  }
753 
754  /// Sets the list of known uses of pointer parameters.
755  void setParamAccesses(std::vector<ParamAccess> NewParams) {
756  if (NewParams.empty())
757  ParamAccesses.reset();
758  else if (ParamAccesses)
759  *ParamAccesses = std::move(NewParams);
760  else
761  ParamAccesses = std::make_unique<ParamAccessesTy>(std::move(NewParams));
762  }
763 
764  /// Add a type test to the summary. This is used by WholeProgramDevirt if we
765  /// were unable to devirtualize a checked call.
767  if (!TIdInfo)
768  TIdInfo = std::make_unique<TypeIdInfo>();
769  TIdInfo->TypeTests.push_back(Guid);
770  }
771 
772  const TypeIdInfo *getTypeIdInfo() const { return TIdInfo.get(); };
773 
774  friend struct GraphTraits<ValueInfo>;
775 };
776 
777 template <> struct DenseMapInfo<FunctionSummary::VFuncId> {
778  static FunctionSummary::VFuncId getEmptyKey() { return {0, uint64_t(-1)}; }
779 
781  return {0, uint64_t(-2)};
782  }
783 
785  return L.GUID == R.GUID && L.Offset == R.Offset;
786  }
787 
788  static unsigned getHashValue(FunctionSummary::VFuncId I) { return I.GUID; }
789 };
790 
791 template <> struct DenseMapInfo<FunctionSummary::ConstVCall> {
793  return {{0, uint64_t(-1)}, {}};
794  }
795 
797  return {{0, uint64_t(-2)}, {}};
798  }
799 
803  L.Args == R.Args;
804  }
805 
807  return I.VFunc.GUID;
808  }
809 };
810 
811 /// The ValueInfo and offset for a function within a vtable definition
812 /// initializer array.
815  : FuncVI(VI), VTableOffset(Offset) {}
816 
818  uint64_t VTableOffset;
819 };
820 /// List of functions referenced by a particular vtable definition.
821 using VTableFuncList = std::vector<VirtFuncOffset>;
822 
823 /// Global variable summary information to aid decisions and
824 /// implementation of importing.
825 ///
826 /// Global variable summary has two extra flag, telling if it is
827 /// readonly or writeonly. Both readonly and writeonly variables
828 /// can be optimized in the backed: readonly variables can be
829 /// const-folded, while writeonly vars can be completely eliminated
830 /// together with corresponding stores. We let both things happen
831 /// by means of internalizing such variables after ThinLTO import.
833 private:
834  /// For vtable definitions this holds the list of functions and
835  /// their corresponding offsets within the initializer array.
836  std::unique_ptr<VTableFuncList> VTableFuncs;
837 
838 public:
839  struct GVarFlags {
840  GVarFlags(bool ReadOnly, bool WriteOnly, bool Constant,
842  : MaybeReadOnly(ReadOnly), MaybeWriteOnly(WriteOnly),
844 
845  // If true indicates that this global variable might be accessed
846  // purely by non-volatile load instructions. This in turn means
847  // it can be internalized in source and destination modules during
848  // thin LTO import because it neither modified nor its address
849  // is taken.
850  unsigned MaybeReadOnly : 1;
851  // If true indicates that variable is possibly only written to, so
852  // its value isn't loaded and its address isn't taken anywhere.
853  // False, when 'Constant' attribute is set.
854  unsigned MaybeWriteOnly : 1;
855  // Indicates that value is a compile-time constant. Global variable
856  // can be 'Constant' while not being 'ReadOnly' on several occasions:
857  // - it is volatile, (e.g mapped device address)
858  // - its address is taken, meaning that unlike 'ReadOnly' vars we can't
859  // internalize it.
860  // Constant variables are always imported thus giving compiler an
861  // opportunity to make some extra optimizations. Readonly constants
862  // are also internalized.
863  unsigned Constant : 1;
864  // Set from metadata on vtable definitions during the module summary
865  // analysis.
866  unsigned VCallVisibility : 2;
867  } VarFlags;
868 
870  std::vector<ValueInfo> Refs)
871  : GlobalValueSummary(GlobalVarKind, Flags, std::move(Refs)),
872  VarFlags(VarFlags) {}
873 
874  /// Check if this is a global variable summary.
875  static bool classof(const GlobalValueSummary *GVS) {
876  return GVS->getSummaryKind() == GlobalVarKind;
877  }
878 
879  GVarFlags varflags() const { return VarFlags; }
880  void setReadOnly(bool RO) { VarFlags.MaybeReadOnly = RO; }
881  void setWriteOnly(bool WO) { VarFlags.MaybeWriteOnly = WO; }
882  bool maybeReadOnly() const { return VarFlags.MaybeReadOnly; }
883  bool maybeWriteOnly() const { return VarFlags.MaybeWriteOnly; }
884  bool isConstant() const { return VarFlags.Constant; }
887  }
890  }
891 
893  assert(!VTableFuncs);
894  VTableFuncs = std::make_unique<VTableFuncList>(std::move(Funcs));
895  }
896 
898  if (VTableFuncs)
899  return *VTableFuncs;
900  return {};
901  }
902 };
903 
905  /// Specifies which kind of type check we should emit for this byte array.
906  /// See http://clang.llvm.org/docs/ControlFlowIntegrityDesign.html for full
907  /// details on each kind of check; the enumerators are described with
908  /// reference to that document.
909  enum Kind {
910  Unsat, ///< Unsatisfiable type (i.e. no global has this type metadata)
911  ByteArray, ///< Test a byte array (first example)
912  Inline, ///< Inlined bit vector ("Short Inline Bit Vectors")
913  Single, ///< Single element (last example in "Short Inline Bit Vectors")
914  AllOnes, ///< All-ones bit vector ("Eliminating Bit Vector Checks for
915  /// All-Ones Bit Vectors")
916  Unknown, ///< Unknown (analysis not performed, don't lower)
917  } TheKind = Unknown;
918 
919  /// Range of size-1 expressed as a bit width. For example, if the size is in
920  /// range [1,256], this number will be 8. This helps generate the most compact
921  /// instruction sequences.
922  unsigned SizeM1BitWidth = 0;
923 
924  // The following fields are only used if the target does not support the use
925  // of absolute symbols to store constants. Their meanings are the same as the
926  // corresponding fields in LowerTypeTestsModule::TypeIdLowering in
927  // LowerTypeTests.cpp.
928 
929  uint64_t AlignLog2 = 0;
930  uint64_t SizeM1 = 0;
931  uint8_t BitMask = 0;
932  uint64_t InlineBits = 0;
933 };
934 
936  enum Kind {
937  Indir, ///< Just do a regular virtual call
938  SingleImpl, ///< Single implementation devirtualization
939  BranchFunnel, ///< When retpoline mitigation is enabled, use a branch funnel
940  ///< that is defined in the merged module. Otherwise same as
941  ///< Indir.
942  } TheKind = Indir;
943 
944  std::string SingleImplName;
945 
946  struct ByArg {
947  enum Kind {
948  Indir, ///< Just do a regular virtual call
949  UniformRetVal, ///< Uniform return value optimization
950  UniqueRetVal, ///< Unique return value optimization
951  VirtualConstProp, ///< Virtual constant propagation
952  } TheKind = Indir;
953 
954  /// Additional information for the resolution:
955  /// - UniformRetVal: the uniform return value.
956  /// - UniqueRetVal: the return value associated with the unique vtable (0 or
957  /// 1).
958  uint64_t Info = 0;
959 
960  // The following fields are only used if the target does not support the use
961  // of absolute symbols to store constants.
962 
965  };
966 
967  /// Resolutions for calls with all constant integer arguments (excluding the
968  /// first argument, "this"), where the key is the argument vector.
969  std::map<std::vector<uint64_t>, ByArg> ResByArg;
970 };
971 
974 
975  /// Mapping from byte offset to whole-program devirt resolution for that
976  /// (typeid, byte offset) pair.
977  std::map<uint64_t, WholeProgramDevirtResolution> WPDRes;
978 };
979 
980 /// 160 bits SHA1
981 using ModuleHash = std::array<uint32_t, 5>;
982 
983 /// Type used for iterating through the global value summary map.
984 using const_gvsummary_iterator = GlobalValueSummaryMapTy::const_iterator;
985 using gvsummary_iterator = GlobalValueSummaryMapTy::iterator;
986 
987 /// String table to hold/own module path strings, which additionally holds the
988 /// module ID assigned to each module during the plugin step, as well as a hash
989 /// of the module. The StringMap makes a copy of and owns inserted strings.
991 
992 /// Map of global value GUID to its summary, used to identify values defined in
993 /// a particular module, and provide efficient access to their summary.
995 
996 /// Map of a type GUID to type id string and summary (multimap used
997 /// in case of GUID conflicts).
998 using TypeIdSummaryMapTy =
999  std::multimap<GlobalValue::GUID, std::pair<std::string, TypeIdSummary>>;
1000 
1001 /// The following data structures summarize type metadata information.
1002 /// For type metadata overview see https://llvm.org/docs/TypeMetadata.html.
1003 /// Each type metadata includes both the type identifier and the offset of
1004 /// the address point of the type (the address held by objects of that type
1005 /// which may not be the beginning of the virtual table). Vtable definitions
1006 /// are decorated with type metadata for the types they are compatible with.
1007 ///
1008 /// Holds information about vtable definitions decorated with type metadata:
1009 /// the vtable definition value and its address point offset in a type
1010 /// identifier metadata it is decorated (compatible) with.
1014 
1017 };
1018 /// List of vtable definitions decorated by a particular type identifier,
1019 /// and their corresponding offsets in that type identifier's metadata.
1020 /// Note that each type identifier may be compatible with multiple vtables, due
1021 /// to inheritance, which is why this is a vector.
1022 using TypeIdCompatibleVtableInfo = std::vector<TypeIdOffsetVtableInfo>;
1023 
1024 /// Class to hold module path string table and global value map,
1025 /// and encapsulate methods for operating on them.
1027 private:
1028  /// Map from value name to list of summary instances for values of that
1029  /// name (may be duplicates in the COMDAT case, e.g.).
1030  GlobalValueSummaryMapTy GlobalValueMap;
1031 
1032  /// Holds strings for combined index, mapping to the corresponding module ID.
1033  ModulePathStringTableTy ModulePathStringTable;
1034 
1035  /// Mapping from type identifier GUIDs to type identifier and its summary
1036  /// information. Produced by thin link.
1037  TypeIdSummaryMapTy TypeIdMap;
1038 
1039  /// Mapping from type identifier to information about vtables decorated
1040  /// with that type identifier's metadata. Produced by per module summary
1041  /// analysis and consumed by thin link. For more information, see description
1042  /// above where TypeIdCompatibleVtableInfo is defined.
1043  std::map<std::string, TypeIdCompatibleVtableInfo, std::less<>>
1044  TypeIdCompatibleVtableMap;
1045 
1046  /// Mapping from original ID to GUID. If original ID can map to multiple
1047  /// GUIDs, it will be mapped to 0.
1048  std::map<GlobalValue::GUID, GlobalValue::GUID> OidGuidMap;
1049 
1050  /// Indicates that summary-based GlobalValue GC has run, and values with
1051  /// GVFlags::Live==false are really dead. Otherwise, all values must be
1052  /// considered live.
1053  bool WithGlobalValueDeadStripping = false;
1054 
1055  /// Indicates that summary-based attribute propagation has run and
1056  /// GVarFlags::MaybeReadonly / GVarFlags::MaybeWriteonly are really
1057  /// read/write only.
1058  bool WithAttributePropagation = false;
1059 
1060  /// Indicates that summary-based DSOLocal propagation has run and the flag in
1061  /// every summary of a GV is synchronized.
1062  bool WithDSOLocalPropagation = false;
1063 
1064  /// Indicates that summary-based synthetic entry count propagation has run
1065  bool HasSyntheticEntryCounts = false;
1066 
1067  /// Indicates that distributed backend should skip compilation of the
1068  /// module. Flag is suppose to be set by distributed ThinLTO indexing
1069  /// when it detected that the module is not needed during the final
1070  /// linking. As result distributed backend should just output a minimal
1071  /// valid object file.
1072  bool SkipModuleByDistributedBackend = false;
1073 
1074  /// If true then we're performing analysis of IR module, or parsing along with
1075  /// the IR from assembly. The value of 'false' means we're reading summary
1076  /// from BC or YAML source. Affects the type of value stored in NameOrGV
1077  /// union.
1078  bool HaveGVs;
1079 
1080  // True if the index was created for a module compiled with -fsplit-lto-unit.
1081  bool EnableSplitLTOUnit;
1082 
1083  // True if some of the modules were compiled with -fsplit-lto-unit and
1084  // some were not. Set when the combined index is created during the thin link.
1085  bool PartiallySplitLTOUnits = false;
1086 
1087  /// True if some of the FunctionSummary contains a ParamAccess.
1088  bool HasParamAccess = false;
1089 
1090  std::set<std::string> CfiFunctionDefs;
1091  std::set<std::string> CfiFunctionDecls;
1092 
1093  // Used in cases where we want to record the name of a global, but
1094  // don't have the string owned elsewhere (e.g. the Strtab on a module).
1095  StringSaver Saver;
1096  BumpPtrAllocator Alloc;
1097 
1098  // The total number of basic blocks in the module in the per-module summary or
1099  // the total number of basic blocks in the LTO unit in the combined index.
1100  uint64_t BlockCount;
1101 
1102  // YAML I/O support.
1104 
1105  GlobalValueSummaryMapTy::value_type *
1106  getOrInsertValuePtr(GlobalValue::GUID GUID) {
1107  return &*GlobalValueMap.emplace(GUID, GlobalValueSummaryInfo(HaveGVs))
1108  .first;
1109  }
1110 
1111 public:
1112  // See HaveGVs variable comment.
1113  ModuleSummaryIndex(bool HaveGVs, bool EnableSplitLTOUnit = false)
1114  : HaveGVs(HaveGVs), EnableSplitLTOUnit(EnableSplitLTOUnit), Saver(Alloc),
1115  BlockCount(0) {}
1116 
1117  // Current version for the module summary in bitcode files.
1118  // The BitcodeSummaryVersion should be bumped whenever we introduce changes
1119  // in the way some record are interpreted, like flags for instance.
1120  // Note that incrementing this may require changes in both BitcodeReader.cpp
1121  // and BitcodeWriter.cpp.
1122  static constexpr uint64_t BitcodeSummaryVersion = 9;
1123 
1124  // Regular LTO module name for ASM writer
1125  static constexpr const char *getRegularLTOModuleName() {
1126  return "[Regular LTO]";
1127  }
1128 
1129  bool haveGVs() const { return HaveGVs; }
1130 
1131  uint64_t getFlags() const;
1132  void setFlags(uint64_t Flags);
1133 
1134  uint64_t getBlockCount() const { return BlockCount; }
1135  void addBlockCount(uint64_t C) { BlockCount += C; }
1136  void setBlockCount(uint64_t C) { BlockCount = C; }
1137 
1138  gvsummary_iterator begin() { return GlobalValueMap.begin(); }
1139  const_gvsummary_iterator begin() const { return GlobalValueMap.begin(); }
1140  gvsummary_iterator end() { return GlobalValueMap.end(); }
1141  const_gvsummary_iterator end() const { return GlobalValueMap.end(); }
1142  size_t size() const { return GlobalValueMap.size(); }
1143 
1144  /// Convenience function for doing a DFS on a ValueInfo. Marks the function in
1145  /// the FunctionHasParent map.
1146  static void discoverNodes(ValueInfo V,
1147  std::map<ValueInfo, bool> &FunctionHasParent) {
1148  if (!V.getSummaryList().size())
1149  return; // skip external functions that don't have summaries
1150 
1151  // Mark discovered if we haven't yet
1152  auto S = FunctionHasParent.emplace(V, false);
1153 
1154  // Stop if we've already discovered this node
1155  if (!S.second)
1156  return;
1157 
1158  FunctionSummary *F =
1159  dyn_cast<FunctionSummary>(V.getSummaryList().front().get());
1160  assert(F != nullptr && "Expected FunctionSummary node");
1161 
1162  for (auto &C : F->calls()) {
1163  // Insert node if necessary
1164  auto S = FunctionHasParent.emplace(C.first, true);
1165 
1166  // Skip nodes that we're sure have parents
1167  if (!S.second && S.first->second)
1168  continue;
1169 
1170  if (S.second)
1171  discoverNodes(C.first, FunctionHasParent);
1172  else
1173  S.first->second = true;
1174  }
1175  }
1176 
1177  // Calculate the callgraph root
1179  // Functions that have a parent will be marked in FunctionHasParent pair.
1180  // Once we've marked all functions, the functions in the map that are false
1181  // have no parent (so they're the roots)
1182  std::map<ValueInfo, bool> FunctionHasParent;
1183 
1184  for (auto &S : *this) {
1185  // Skip external functions
1186  if (!S.second.SummaryList.size() ||
1187  !isa<FunctionSummary>(S.second.SummaryList.front().get()))
1188  continue;
1189  discoverNodes(ValueInfo(HaveGVs, &S), FunctionHasParent);
1190  }
1191 
1192  std::vector<FunctionSummary::EdgeTy> Edges;
1193  // create edges to all roots in the Index
1194  for (auto &P : FunctionHasParent) {
1195  if (P.second)
1196  continue; // skip over non-root nodes
1197  Edges.push_back(std::make_pair(P.first, CalleeInfo{}));
1198  }
1199  if (Edges.empty()) {
1200  // Failed to find root - return an empty node
1202  }
1203  auto CallGraphRoot = FunctionSummary::makeDummyFunctionSummary(Edges);
1204  return CallGraphRoot;
1205  }
1206 
1208  return WithGlobalValueDeadStripping;
1209  }
1211  WithGlobalValueDeadStripping = true;
1212  }
1213 
1214  bool withAttributePropagation() const { return WithAttributePropagation; }
1216  WithAttributePropagation = true;
1217  }
1218 
1219  bool withDSOLocalPropagation() const { return WithDSOLocalPropagation; }
1220  void setWithDSOLocalPropagation() { WithDSOLocalPropagation = true; }
1221 
1222  bool isReadOnly(const GlobalVarSummary *GVS) const {
1223  return WithAttributePropagation && GVS->maybeReadOnly();
1224  }
1225  bool isWriteOnly(const GlobalVarSummary *GVS) const {
1226  return WithAttributePropagation && GVS->maybeWriteOnly();
1227  }
1228 
1229  bool hasSyntheticEntryCounts() const { return HasSyntheticEntryCounts; }
1230  void setHasSyntheticEntryCounts() { HasSyntheticEntryCounts = true; }
1231 
1233  return SkipModuleByDistributedBackend;
1234  }
1236  SkipModuleByDistributedBackend = true;
1237  }
1238 
1239  bool enableSplitLTOUnit() const { return EnableSplitLTOUnit; }
1240  void setEnableSplitLTOUnit() { EnableSplitLTOUnit = true; }
1241 
1242  bool partiallySplitLTOUnits() const { return PartiallySplitLTOUnits; }
1243  void setPartiallySplitLTOUnits() { PartiallySplitLTOUnits = true; }
1244 
1245  bool hasParamAccess() const { return HasParamAccess; }
1246 
1247  bool isGlobalValueLive(const GlobalValueSummary *GVS) const {
1248  return !WithGlobalValueDeadStripping || GVS->isLive();
1249  }
1250  bool isGUIDLive(GlobalValue::GUID GUID) const;
1251 
1252  /// Return a ValueInfo for the index value_type (convenient when iterating
1253  /// index).
1254  ValueInfo getValueInfo(const GlobalValueSummaryMapTy::value_type &R) const {
1255  return ValueInfo(HaveGVs, &R);
1256  }
1257 
1258  /// Return a ValueInfo for GUID if it exists, otherwise return ValueInfo().
1260  auto I = GlobalValueMap.find(GUID);
1261  return ValueInfo(HaveGVs, I == GlobalValueMap.end() ? nullptr : &*I);
1262  }
1263 
1264  /// Return a ValueInfo for \p GUID.
1266  return ValueInfo(HaveGVs, getOrInsertValuePtr(GUID));
1267  }
1268 
1269  // Save a string in the Index. Use before passing Name to
1270  // getOrInsertValueInfo when the string isn't owned elsewhere (e.g. on the
1271  // module's Strtab).
1272  StringRef saveString(StringRef String) { return Saver.save(String); }
1273 
1274  /// Return a ValueInfo for \p GUID setting value \p Name.
1276  assert(!HaveGVs);
1277  auto VP = getOrInsertValuePtr(GUID);
1278  VP->second.U.Name = Name;
1279  return ValueInfo(HaveGVs, VP);
1280  }
1281 
1282  /// Return a ValueInfo for \p GV and mark it as belonging to GV.
1284  assert(HaveGVs);
1285  auto VP = getOrInsertValuePtr(GV->getGUID());
1286  VP->second.U.GV = GV;
1287  return ValueInfo(HaveGVs, VP);
1288  }
1289 
1290  /// Return the GUID for \p OriginalId in the OidGuidMap.
1292  const auto I = OidGuidMap.find(OriginalID);
1293  return I == OidGuidMap.end() ? 0 : I->second;
1294  }
1295 
1296  std::set<std::string> &cfiFunctionDefs() { return CfiFunctionDefs; }
1297  const std::set<std::string> &cfiFunctionDefs() const { return CfiFunctionDefs; }
1298 
1299  std::set<std::string> &cfiFunctionDecls() { return CfiFunctionDecls; }
1300  const std::set<std::string> &cfiFunctionDecls() const { return CfiFunctionDecls; }
1301 
1302  /// Add a global value summary for a value.
1304  std::unique_ptr<GlobalValueSummary> Summary) {
1306  }
1307 
1308  /// Add a global value summary for a value of the given name.
1310  std::unique_ptr<GlobalValueSummary> Summary) {
1312  std::move(Summary));
1313  }
1314 
1315  /// Add a global value summary for the given ValueInfo.
1317  std::unique_ptr<GlobalValueSummary> Summary) {
1318  if (const FunctionSummary *FS = dyn_cast<FunctionSummary>(Summary.get()))
1319  HasParamAccess |= !FS->paramAccesses().empty();
1320  addOriginalName(VI.getGUID(), Summary->getOriginalName());
1321  // Here we have a notionally const VI, but the value it points to is owned
1322  // by the non-const *this.
1323  const_cast<GlobalValueSummaryMapTy::value_type *>(VI.getRef())
1324  ->second.SummaryList.push_back(std::move(Summary));
1325  }
1326 
1327  /// Add an original name for the value of the given GUID.
1329  GlobalValue::GUID OrigGUID) {
1330  if (OrigGUID == 0 || ValueGUID == OrigGUID)
1331  return;
1332  if (OidGuidMap.count(OrigGUID) && OidGuidMap[OrigGUID] != ValueGUID)
1333  OidGuidMap[OrigGUID] = 0;
1334  else
1335  OidGuidMap[OrigGUID] = ValueGUID;
1336  }
1337 
1338  /// Find the summary for ValueInfo \p VI in module \p ModuleId, or nullptr if
1339  /// not found.
1341  auto SummaryList = VI.getSummaryList();
1342  auto Summary =
1343  llvm::find_if(SummaryList,
1344  [&](const std::unique_ptr<GlobalValueSummary> &Summary) {
1345  return Summary->modulePath() == ModuleId;
1346  });
1347  if (Summary == SummaryList.end())
1348  return nullptr;
1349  return Summary->get();
1350  }
1351 
1352  /// Find the summary for global \p GUID in module \p ModuleId, or nullptr if
1353  /// not found.
1355  StringRef ModuleId) const {
1356  auto CalleeInfo = getValueInfo(ValueGUID);
1357  if (!CalleeInfo)
1358  return nullptr; // This function does not have a summary
1359  return findSummaryInModule(CalleeInfo, ModuleId);
1360  }
1361 
1362  /// Returns the first GlobalValueSummary for \p GV, asserting that there
1363  /// is only one if \p PerModuleIndex.
1365  bool PerModuleIndex = true) const {
1366  assert(GV.hasName() && "Can't get GlobalValueSummary for GV with no name");
1367  return getGlobalValueSummary(GV.getGUID(), PerModuleIndex);
1368  }
1369 
1370  /// Returns the first GlobalValueSummary for \p ValueGUID, asserting that
1371  /// there
1372  /// is only one if \p PerModuleIndex.
1374  bool PerModuleIndex = true) const;
1375 
1376  /// Table of modules, containing module hash and id.
1378  return ModulePathStringTable;
1379  }
1380 
1381  /// Table of modules, containing hash and id.
1383  return ModulePathStringTable;
1384  }
1385 
1386  /// Get the module ID recorded for the given module path.
1387  uint64_t getModuleId(const StringRef ModPath) const {
1388  return ModulePathStringTable.lookup(ModPath).first;
1389  }
1390 
1391  /// Get the module SHA1 hash recorded for the given module path.
1392  const ModuleHash &getModuleHash(const StringRef ModPath) const {
1393  auto It = ModulePathStringTable.find(ModPath);
1394  assert(It != ModulePathStringTable.end() && "Module not registered");
1395  return It->second.second;
1396  }
1397 
1398  /// Convenience method for creating a promoted global name
1399  /// for the given value name of a local, and its original module's ID.
1400  static std::string getGlobalNameForLocal(StringRef Name, ModuleHash ModHash) {
1401  SmallString<256> NewName(Name);
1402  NewName += ".llvm.";
1403  NewName += utostr((uint64_t(ModHash[0]) << 32) |
1404  ModHash[1]); // Take the first 64 bits
1405  return std::string(NewName.str());
1406  }
1407 
1408  /// Helper to obtain the unpromoted name for a global value (or the original
1409  /// name if not promoted). Split off the rightmost ".llvm.${hash}" suffix,
1410  /// because it is possible in certain clients (not clang at the moment) for
1411  /// two rounds of ThinLTO optimization and therefore promotion to occur.
1413  std::pair<StringRef, StringRef> Pair = Name.rsplit(".llvm.");
1414  return Pair.first;
1415  }
1416 
1418 
1419  /// Add a new module with the given \p Hash, mapped to the given \p
1420  /// ModID, and return a reference to the module.
1421  ModuleInfo *addModule(StringRef ModPath, uint64_t ModId,
1422  ModuleHash Hash = ModuleHash{{0}}) {
1423  return &*ModulePathStringTable.insert({ModPath, {ModId, Hash}}).first;
1424  }
1425 
1426  /// Return module entry for module with the given \p ModPath.
1428  auto It = ModulePathStringTable.find(ModPath);
1429  assert(It != ModulePathStringTable.end() && "Module not registered");
1430  return &*It;
1431  }
1432 
1433  /// Check if the given Module has any functions available for exporting
1434  /// in the index. We consider any module present in the ModulePathStringTable
1435  /// to have exported functions.
1436  bool hasExportedFunctions(const Module &M) const {
1437  return ModulePathStringTable.count(M.getModuleIdentifier());
1438  }
1439 
1440  const TypeIdSummaryMapTy &typeIds() const { return TypeIdMap; }
1441 
1442  /// Return an existing or new TypeIdSummary entry for \p TypeId.
1443  /// This accessor can mutate the map and therefore should not be used in
1444  /// the ThinLTO backends.
1446  auto TidIter = TypeIdMap.equal_range(GlobalValue::getGUID(TypeId));
1447  for (auto It = TidIter.first; It != TidIter.second; ++It)
1448  if (It->second.first == TypeId)
1449  return It->second.second;
1450  auto It = TypeIdMap.insert(
1451  {GlobalValue::getGUID(TypeId), {std::string(TypeId), TypeIdSummary()}});
1452  return It->second.second;
1453  }
1454 
1455  /// This returns either a pointer to the type id summary (if present in the
1456  /// summary map) or null (if not present). This may be used when importing.
1458  auto TidIter = TypeIdMap.equal_range(GlobalValue::getGUID(TypeId));
1459  for (auto It = TidIter.first; It != TidIter.second; ++It)
1460  if (It->second.first == TypeId)
1461  return &It->second.second;
1462  return nullptr;
1463  }
1464 
1466  return const_cast<TypeIdSummary *>(
1467  static_cast<const ModuleSummaryIndex *>(this)->getTypeIdSummary(
1468  TypeId));
1469  }
1470 
1471  const auto &typeIdCompatibleVtableMap() const {
1472  return TypeIdCompatibleVtableMap;
1473  }
1474 
1475  /// Return an existing or new TypeIdCompatibleVtableMap entry for \p TypeId.
1476  /// This accessor can mutate the map and therefore should not be used in
1477  /// the ThinLTO backends.
1480  return TypeIdCompatibleVtableMap[std::string(TypeId)];
1481  }
1482 
1483  /// For the given \p TypeId, this returns the TypeIdCompatibleVtableMap
1484  /// entry if present in the summary map. This may be used when importing.
1487  auto I = TypeIdCompatibleVtableMap.find(TypeId);
1488  if (I == TypeIdCompatibleVtableMap.end())
1489  return None;
1490  return I->second;
1491  }
1492 
1493  /// Collect for the given module the list of functions it defines
1494  /// (GUID -> Summary).
1496  GVSummaryMapTy &GVSummaryMap) const;
1497 
1498  /// Collect for each module the list of Summaries it defines (GUID ->
1499  /// Summary).
1500  template <class Map>
1501  void
1502  collectDefinedGVSummariesPerModule(Map &ModuleToDefinedGVSummaries) const {
1503  for (auto &GlobalList : *this) {
1504  auto GUID = GlobalList.first;
1505  for (auto &Summary : GlobalList.second.SummaryList) {
1506  ModuleToDefinedGVSummaries[Summary->modulePath()][GUID] = Summary.get();
1507  }
1508  }
1509  }
1510 
1511  /// Print to an output stream.
1512  void print(raw_ostream &OS, bool IsForDebug = false) const;
1513 
1514  /// Dump to stderr (for debugging).
1515  void dump() const;
1516 
1517  /// Export summary to dot file for GraphViz.
1518  void
1520  const DenseSet<GlobalValue::GUID> &GUIDPreservedSymbols) const;
1521 
1522  /// Print out strongly connected components for debugging.
1523  void dumpSCCs(raw_ostream &OS);
1524 
1525  /// Do the access attribute and DSOLocal propagation in combined index.
1526  void propagateAttributes(const DenseSet<GlobalValue::GUID> &PreservedSymbols);
1527 
1528  /// Checks if we can import global variable from another module.
1529  bool canImportGlobalVar(GlobalValueSummary *S, bool AnalyzeRefs) const;
1530 };
1531 
1532 /// GraphTraits definition to build SCC for the index
1533 template <> struct GraphTraits<ValueInfo> {
1536 
1538  return P.first;
1539  }
1540  using ChildIteratorType =
1542  decltype(&valueInfoFromEdge)>;
1543 
1544  using ChildEdgeIteratorType = std::vector<FunctionSummary::EdgeTy>::iterator;
1545 
1546  static NodeRef getEntryNode(ValueInfo V) { return V; }
1547 
1549  if (!N.getSummaryList().size()) // handle external function
1550  return ChildIteratorType(
1551  FunctionSummary::ExternalNode.CallGraphEdgeList.begin(),
1552  &valueInfoFromEdge);
1553  FunctionSummary *F =
1554  cast<FunctionSummary>(N.getSummaryList().front()->getBaseObject());
1555  return ChildIteratorType(F->CallGraphEdgeList.begin(), &valueInfoFromEdge);
1556  }
1557 
1559  if (!N.getSummaryList().size()) // handle external function
1560  return ChildIteratorType(
1561  FunctionSummary::ExternalNode.CallGraphEdgeList.end(),
1562  &valueInfoFromEdge);
1563  FunctionSummary *F =
1564  cast<FunctionSummary>(N.getSummaryList().front()->getBaseObject());
1565  return ChildIteratorType(F->CallGraphEdgeList.end(), &valueInfoFromEdge);
1566  }
1567 
1569  if (!N.getSummaryList().size()) // handle external function
1570  return FunctionSummary::ExternalNode.CallGraphEdgeList.begin();
1571 
1572  FunctionSummary *F =
1573  cast<FunctionSummary>(N.getSummaryList().front()->getBaseObject());
1574  return F->CallGraphEdgeList.begin();
1575  }
1576 
1578  if (!N.getSummaryList().size()) // handle external function
1579  return FunctionSummary::ExternalNode.CallGraphEdgeList.end();
1580 
1581  FunctionSummary *F =
1582  cast<FunctionSummary>(N.getSummaryList().front()->getBaseObject());
1583  return F->CallGraphEdgeList.end();
1584  }
1585 
1586  static NodeRef edge_dest(EdgeRef E) { return E.first; }
1587 };
1588 
1589 template <>
1592  std::unique_ptr<GlobalValueSummary> Root =
1593  std::make_unique<FunctionSummary>(I->calculateCallGraphRoot());
1594  GlobalValueSummaryInfo G(I->haveGVs());
1595  G.SummaryList.push_back(std::move(Root));
1596  static auto P =
1597  GlobalValueSummaryMapTy::value_type(GlobalValue::GUID(0), std::move(G));
1598  return ValueInfo(I->haveGVs(), &P);
1599  }
1600 };
1601 } // end namespace llvm
1602 
1603 #endif // LLVM_IR_MODULESUMMARYINDEX_H
llvm::FunctionSummary::TypeIdInfo
All type identifier related information.
Definition: ModuleSummaryIndex.h:542
llvm::WholeProgramDevirtResolution::ResByArg
std::map< std::vector< uint64_t >, ByArg > ResByArg
Resolutions for calls with all constant integer arguments (excluding the first argument,...
Definition: ModuleSummaryIndex.h:969
llvm::GlobalValue::GUID
uint64_t GUID
Declare a type to represent a global unique identifier for a global value.
Definition: GlobalValue.h:503
llvm::ValueInfo::ValueInfo
ValueInfo(bool HaveGVs, const GlobalValueSummaryMapTy::value_type *R)
Definition: ModuleSummaryIndex.h:172
llvm::FunctionSummary::ParamAccess::ParamNo
uint64_t ParamNo
Definition: ModuleSummaryIndex.h:592
llvm::const_gvsummary_iterator
GlobalValueSummaryMapTy::const_iterator const_gvsummary_iterator
Type used for iterating through the global value summary map.
Definition: ModuleSummaryIndex.h:984
llvm::FunctionSummary::FFlags::ReadOnly
unsigned ReadOnly
Definition: ModuleSummaryIndex.h:565
llvm::ValueInfo::getSummaryList
ArrayRef< std::unique_ptr< GlobalValueSummary > > getSummaryList() const
Definition: ModuleSummaryIndex.h:185
llvm::ModuleSummaryIndex::addGlobalValueSummary
void addGlobalValueSummary(StringRef ValueName, std::unique_ptr< GlobalValueSummary > Summary)
Add a global value summary for a value of the given name.
Definition: ModuleSummaryIndex.h:1309
llvm::ModuleSummaryIndex::hasSyntheticEntryCounts
bool hasSyntheticEntryCounts() const
Definition: ModuleSummaryIndex.h:1229
llvm::ModuleSummaryIndex::haveGVs
bool haveGVs() const
Definition: ModuleSummaryIndex.h:1129
llvm::DenseMapInfo< FunctionSummary::VFuncId >::isEqual
static bool isEqual(FunctionSummary::VFuncId L, FunctionSummary::VFuncId R)
Definition: ModuleSummaryIndex.h:784
MathExtras.h
llvm::GlobalValueSummaryInfo::NameOrGV::GV
const GlobalValue * GV
The GlobalValue corresponding to this summary.
Definition: ModuleSummaryIndex.h:137
llvm
This class represents lattice values for constants.
Definition: AllocatorList.h:23
llvm::FunctionSummary::ConstVCall::Args
std::vector< uint64_t > Args
Definition: ModuleSummaryIndex.h:537
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::ModuleSummaryIndex::getOrInsertValueInfo
ValueInfo getOrInsertValueInfo(GlobalValue::GUID GUID, StringRef Name)
Return a ValueInfo for GUID setting value Name.
Definition: ModuleSummaryIndex.h:1275
llvm::DenseMapInfo< ValueInfo >::getEmptyKey
static ValueInfo getEmptyKey()
Definition: ModuleSummaryIndex.h:265
llvm::StringMapEntry
StringMapEntry - This is used to represent one value that is inserted into a StringMap.
Definition: StringMapEntry.h:69
llvm::ModuleSummaryIndex::getTypeIdSummary
TypeIdSummary * getTypeIdSummary(StringRef TypeId)
Definition: ModuleSummaryIndex.h:1465
llvm::WholeProgramDevirtResolution::ByArg::TheKind
enum llvm::WholeProgramDevirtResolution::ByArg::Kind TheKind
llvm::GraphTraits< ValueInfo >::edge_dest
static NodeRef edge_dest(EdgeRef E)
Definition: ModuleSummaryIndex.h:1586
llvm::GlobalValueSummary::setNotEligibleToImport
void setNotEligibleToImport()
Flag that this global value cannot be imported.
Definition: ModuleSummaryIndex.h:433
llvm::GraphTraits< ValueInfo >::getEntryNode
static NodeRef getEntryNode(ValueInfo V)
Definition: ModuleSummaryIndex.h:1546
llvm::GlobalValueSummary::setModulePath
void setModulePath(StringRef ModPath)
Set the path to the module containing this function, for use in the combined index.
Definition: ModuleSummaryIndex.h:391
llvm::GraphTraits< ValueInfo >::child_begin
static ChildIteratorType child_begin(NodeRef N)
Definition: ModuleSummaryIndex.h:1548
llvm::ModuleSummaryIndex::begin
const_gvsummary_iterator begin() const
Definition: ModuleSummaryIndex.h:1139
llvm::ModuleSummaryIndex::getModule
ModuleInfo * getModule(StringRef ModPath)
Return module entry for module with the given ModPath.
Definition: ModuleSummaryIndex.h:1427
llvm::ModuleSummaryIndex::ModuleInfo
ModulePathStringTableTy::value_type ModuleInfo
Definition: ModuleSummaryIndex.h:1417
llvm::GlobalValueSummaryMapTy
std::map< GlobalValue::GUID, GlobalValueSummaryInfo > GlobalValueSummaryMapTy
Map from global value GUID to corresponding summary structures.
Definition: ModuleSummaryIndex.h:162
llvm::DenseMapInfo< ValueInfo >::isEqual
static bool isEqual(ValueInfo L, ValueInfo R)
Definition: ModuleSummaryIndex.h:277
llvm::ModuleSummaryIndex::setPartiallySplitLTOUnits
void setPartiallySplitLTOUnits()
Definition: ModuleSummaryIndex.h:1243
llvm::ModuleSummaryIndex::isReadOnly
bool isReadOnly(const GlobalVarSummary *GVS) const
Definition: ModuleSummaryIndex.h:1222
llvm::FunctionSummary::classof
static bool classof(const GlobalValueSummary *GVS)
Check if this is a function summary.
Definition: ModuleSummaryIndex.h:682
llvm::ModuleSummaryIndex::getModuleHash
const ModuleHash & getModuleHash(const StringRef ModPath) const
Get the module SHA1 hash recorded for the given module path.
Definition: ModuleSummaryIndex.h:1392
llvm::FunctionSummary::calls
ArrayRef< EdgeTy > calls() const
Return the list of <CalleeValueInfo, CalleeInfo> pairs.
Definition: ModuleSummaryIndex.h:699
llvm::ModuleSummaryIndex::setEnableSplitLTOUnit
void setEnableSplitLTOUnit()
Definition: ModuleSummaryIndex.h:1240
llvm::CalleeInfo::MaxRelBlockFreq
static constexpr uint64_t MaxRelBlockFreq
Definition: ModuleSummaryIndex.h:72
llvm::ModuleSummaryIndex::saveString
StringRef saveString(StringRef String)
Definition: ModuleSummaryIndex.h:1272
llvm::TypeTestResolution::Kind
Kind
Specifies which kind of type check we should emit for this byte array.
Definition: ModuleSummaryIndex.h:909
llvm::FunctionSummary::fflags
FFlags fflags() const
Get function summary flags.
Definition: ModuleSummaryIndex.h:687
llvm::FunctionSummary::paramAccesses
ArrayRef< ParamAccess > paramAccesses() const
Returns the list of known uses of pointer parameters.
Definition: ModuleSummaryIndex.h:748
StringRef.h
P
This currently compiles esp xmm0 movsd esp eax eax esp ret We should use not the dag combiner This is because dagcombine2 needs to be able to see through the X86ISD::Wrapper which DAGCombine can t really do The code for turning x load into a single vector load is target independent and should be moved to the dag combiner The code for turning x load into a vector load can only handle a direct load from a global or a direct load from the stack It should be generalized to handle any load from P
Definition: README-SSE.txt:411
llvm::GlobalVarSummary
Global variable summary information to aid decisions and implementation of importing.
Definition: ModuleSummaryIndex.h:832
llvm::FunctionSummary::FFlags::AlwaysInline
unsigned AlwaysInline
Definition: ModuleSummaryIndex.h:572
llvm::GlobalVarSummary::setWriteOnly
void setWriteOnly(bool WO)
Definition: ModuleSummaryIndex.h:881
llvm::FunctionSummary::ParamAccess::Call::Offsets
ConstantRange Offsets
Definition: ModuleSummaryIndex.h:585
llvm::GraphTraits< ValueInfo >::child_edge_end
static ChildEdgeIteratorType child_edge_end(NodeRef N)
Definition: ModuleSummaryIndex.h:1577
llvm::GlobalValueSummary::setLive
void setLive(bool Live)
Definition: ModuleSummaryIndex.h:415
llvm::GraphTraits< ValueInfo >::ChildEdgeIteratorType
std::vector< FunctionSummary::EdgeTy >::iterator ChildEdgeIteratorType
Definition: ModuleSummaryIndex.h:1544
llvm::ValueInfo::getGUID
GlobalValue::GUID getGUID() const
Definition: ModuleSummaryIndex.h:179
llvm::FunctionSummary::ParamAccess::ParamAccess
ParamAccess()=default
llvm::GlobalValueSummary::isDSOLocal
bool isDSOLocal() const
Definition: ModuleSummaryIndex.h:419
llvm::ValueInfo::HaveGV
@ HaveGV
Definition: ModuleSummaryIndex.h:167
llvm::GlobalValueSummary::notEligibleToImport
bool notEligibleToImport() const
Return true if this global value can't be imported.
Definition: ModuleSummaryIndex.h:411
llvm::TypeTestResolution::InlineBits
uint64_t InlineBits
Definition: ModuleSummaryIndex.h:932
llvm::Value::hasName
bool hasName() const
Definition: Value.h:252
llvm::TypeTestResolution::Unsat
@ Unsat
Unsatisfiable type (i.e. no global has this type metadata)
Definition: ModuleSummaryIndex.h:910
llvm::CalleeInfo::HotnessType::Cold
@ Cold
Allocator.h
llvm::ModuleSummaryIndex::end
const_gvsummary_iterator end() const
Definition: ModuleSummaryIndex.h:1141
llvm::GlobalVarSummary::GlobalVarSummary
GlobalVarSummary(GVFlags Flags, GVarFlags VarFlags, std::vector< ValueInfo > Refs)
Definition: ModuleSummaryIndex.h:869
llvm::ModuleSummaryIndex::getOrInsertTypeIdSummary
TypeIdSummary & getOrInsertTypeIdSummary(StringRef TypeId)
Return an existing or new TypeIdSummary entry for TypeId.
Definition: ModuleSummaryIndex.h:1445
llvm::FunctionSummary::addCall
void addCall(EdgeTy E)
Definition: ModuleSummaryIndex.h:701
llvm::AliasSummary
Alias summary information.
Definition: ModuleSummaryIndex.h:447
llvm::GlobalValueSummaryInfo::SummaryList
GlobalValueSummaryList SummaryList
List of global value summary structures for a particular value held in the GlobalValueMap.
Definition: ModuleSummaryIndex.h:152
llvm::TypeTestResolution::AllOnes
@ AllOnes
All-ones bit vector ("Eliminating Bit Vector Checks for All-Ones Bit Vectors")
Definition: ModuleSummaryIndex.h:914
llvm::VirtFuncOffset
The ValueInfo and offset for a function within a vtable definition initializer array.
Definition: ModuleSummaryIndex.h:813
llvm::ValueInfo::getValue
const GlobalValue * getValue() const
Definition: ModuleSummaryIndex.h:180
llvm::StringMap::end
iterator end()
Definition: StringMap.h:205
llvm::FunctionSummary::type_test_assume_const_vcalls
ArrayRef< ConstVCall > type_test_assume_const_vcalls() const
Returns the list of virtual calls made by this function using llvm.assume(llvm.type....
Definition: ModuleSummaryIndex.h:733
llvm::VirtFuncOffset::VTableOffset
uint64_t VTableOffset
Definition: ModuleSummaryIndex.h:818
DenseMap.h
Module.h
llvm::GlobalValueSummary::setVisibility
void setVisibility(GlobalValue::VisibilityTypes Vis)
Definition: ModuleSummaryIndex.h:428
llvm::TypeIdOffsetVtableInfo
The following data structures summarize type metadata information.
Definition: ModuleSummaryIndex.h:1011
llvm::GlobalValueSummary::GVFlags::Linkage
unsigned Linkage
The linkage type of the associated global value.
Definition: ModuleSummaryIndex.h:302
llvm::operator!=
bool operator!=(uint64_t V1, const APInt &V2)
Definition: APInt.h:2037
llvm::Optional
Definition: APInt.h:33
llvm::VirtFuncOffset::VirtFuncOffset
VirtFuncOffset(ValueInfo VI, uint64_t Offset)
Definition: ModuleSummaryIndex.h:814
llvm::GlobalVarSummary::getVCallVisibility
GlobalObject::VCallVisibility getVCallVisibility() const
Definition: ModuleSummaryIndex.h:888
llvm::GlobalValueSummary::isLive
bool isLive() const
Definition: ModuleSummaryIndex.h:413
llvm::GlobalValue::DefaultVisibility
@ DefaultVisibility
The GV is visible.
Definition: GlobalValue.h:63
llvm::mapped_iterator
Definition: STLExtras.h:286
llvm::ModuleSummaryIndex::getTypeIdSummary
const TypeIdSummary * getTypeIdSummary(StringRef TypeId) const
This returns either a pointer to the type id summary (if present in the summary map) or null (if not ...
Definition: ModuleSummaryIndex.h:1457
Offset
uint64_t Offset
Definition: ELFObjHandler.cpp:81
llvm::FunctionSummary::FSHT_AllNonCritical
@ FSHT_AllNonCritical
Definition: ModuleSummaryIndex.h:519
llvm::ModuleSummaryIndex::isGlobalValueLive
bool isGlobalValueLive(const GlobalValueSummary *GVS) const
Definition: ModuleSummaryIndex.h:1247
llvm::FunctionSummary::TypeIdInfo::TypeTestAssumeConstVCalls
std::vector< ConstVCall > TypeTestAssumeConstVCalls
List of virtual calls made by this function using (respectively) llvm.assume(llvm....
Definition: ModuleSummaryIndex.h:556
llvm::FunctionSummary::FFlags::ReturnDoesNotAlias
unsigned ReturnDoesNotAlias
Definition: ModuleSummaryIndex.h:567
llvm::AliasSummary::setAliasee
void setAliasee(ValueInfo &AliaseeVI, GlobalValueSummary *Aliasee)
Definition: ModuleSummaryIndex.h:466
llvm::FunctionSummary::FFlags::NoInline
unsigned NoInline
Definition: ModuleSummaryIndex.h:570
STLExtras.h
llvm::ValueInfo::Flags
Flags
Definition: ModuleSummaryIndex.h:167
llvm::GlobalValueSummary::GVFlags::NotEligibleToImport
unsigned NotEligibleToImport
Indicate if the global value cannot be imported (e.g.
Definition: ModuleSummaryIndex.h:309
llvm::FunctionSummary::FFlags::NoRecurse
unsigned NoRecurse
Definition: ModuleSummaryIndex.h:566
llvm::ModuleSummaryIndex::getOriginalNameBeforePromote
static StringRef getOriginalNameBeforePromote(StringRef Name)
Helper to obtain the unpromoted name for a global value (or the original name if not promoted).
Definition: ModuleSummaryIndex.h:1412
llvm::GlobalValue::LinkageTypes
LinkageTypes
An enumeration for the kinds of linkage for global values.
Definition: GlobalValue.h:47
llvm::StringMap::find
iterator find(StringRef Key)
Definition: StringMap.h:218
llvm::FunctionSummary::ParamAccess::Call::Call
Call()=default
llvm::ModuleSummaryIndex::hasParamAccess
bool hasParamAccess() const
Definition: ModuleSummaryIndex.h:1245
llvm::yaml::MappingTraits
Definition: ModuleSummaryIndex.h:50
llvm::ModuleSummaryIndex::propagateAttributes
void propagateAttributes(const DenseSet< GlobalValue::GUID > &PreservedSymbols)
Do the access attribute and DSOLocal propagation in combined index.
Definition: ModuleSummaryIndex.cpp:245
llvm::ModuleSummaryIndex::end
gvsummary_iterator end()
Definition: ModuleSummaryIndex.h:1140
llvm::FunctionSummary::VFuncId::Offset
uint64_t Offset
Definition: ModuleSummaryIndex.h:529
llvm::AliasSummary::getAliasee
const GlobalValueSummary & getAliasee() const
Definition: ModuleSummaryIndex.h:478
llvm::ModuleSummaryIndex::getModuleId
uint64_t getModuleId(const StringRef ModPath) const
Get the module ID recorded for the given module path.
Definition: ModuleSummaryIndex.h:1387
llvm::GlobalValueSummary::getVisibility
GlobalValue::VisibilityTypes getVisibility() const
Definition: ModuleSummaryIndex.h:425
llvm::ValueInfo::isDSOLocal
bool isDSOLocal(bool WithDSOLocalPropagation=false) const
Checks if all summaries are DSO local (have the flag set).
Definition: ModuleSummaryIndex.cpp:55
llvm::GraphTraits< ValueInfo >::NodeRef
ValueInfo NodeRef
Definition: ModuleSummaryIndex.h:1534
F
#define F(x, y, z)
Definition: MD5.cpp:56
llvm::GlobalValueSummary::refs
ArrayRef< ValueInfo > refs() const
Return the list of values referenced by this global value definition.
Definition: ModuleSummaryIndex.h:436
llvm::ModuleSummaryIndex::withDSOLocalPropagation
bool withDSOLocalPropagation() const
Definition: ModuleSummaryIndex.h:1219
llvm::GlobalValueSummary::GVFlags
Group flags (Linkage, NotEligibleToImport, etc.) as a bitfield.
Definition: ModuleSummaryIndex.h:294
llvm::FunctionSummary::TypeIdInfo::TypeCheckedLoadVCalls
std::vector< VFuncId > TypeCheckedLoadVCalls
Definition: ModuleSummaryIndex.h:551
llvm::ValueInfo::WriteOnly
@ WriteOnly
Definition: ModuleSummaryIndex.h:167
llvm::VirtFuncOffset::FuncVI
ValueInfo FuncVI
Definition: ModuleSummaryIndex.h:817
llvm::FunctionSummary::ConstVCall
A specification for a virtual function call with all constant integer arguments.
Definition: ModuleSummaryIndex.h:535
llvm::ModuleSummaryIndex::size
size_t size() const
Definition: ModuleSummaryIndex.h:1142
llvm::ValueInfo::ValueInfo
ValueInfo()=default
llvm::ModuleSummaryIndex::setWithAttributePropagation
void setWithAttributePropagation()
Definition: ModuleSummaryIndex.h:1215
llvm::GlobalValueSummary
Function and variable summary information to aid decisions and implementation of importing.
Definition: ModuleSummaryIndex.h:288
llvm::DenseMapInfo
Definition: APInt.h:34
llvm::GlobalVarSummary::GVarFlags::MaybeWriteOnly
unsigned MaybeWriteOnly
Definition: ModuleSummaryIndex.h:854
llvm::ValueInfo::name
StringRef name() const
Definition: ModuleSummaryIndex.h:189
llvm::GlobalValueSummaryInfo
Definition: ModuleSummaryIndex.h:124
GlobalValue.h
llvm::TypeIdOffsetVtableInfo::VTableVI
ValueInfo VTableVI
Definition: ModuleSummaryIndex.h:1016
llvm::GlobalValue::VisibilityTypes
VisibilityTypes
An enumeration for the kinds of visibility of global values.
Definition: GlobalValue.h:62
llvm::GlobalVarSummary::GVarFlags
Definition: ModuleSummaryIndex.h:839
llvm::FunctionSummary::EdgeTy
std::pair< ValueInfo, CalleeInfo > EdgeTy
<CalleeValueInfo, CalleeInfo> call edge pair.
Definition: ModuleSummaryIndex.h:514
llvm::FunctionSummary::ParamAccess::Call::Callee
ValueInfo Callee
Definition: ModuleSummaryIndex.h:584
llvm::GlobalVarSummary::GVarFlags::VCallVisibility
unsigned VCallVisibility
Definition: ModuleSummaryIndex.h:866
SmallString.h
E
static GCRegistry::Add< CoreCLRGC > E("coreclr", "CoreCLR-compatible GC")
llvm::ModuleSummaryIndex::enableSplitLTOUnit
bool enableSplitLTOUnit() const
Definition: ModuleSummaryIndex.h:1239
llvm::ValueInfo::isWriteOnly
bool isWriteOnly() const
Definition: ModuleSummaryIndex.h:199
llvm::GlobalValueSummary::setCanAutoHide
void setCanAutoHide(bool CanAutoHide)
Definition: ModuleSummaryIndex.h:421
llvm::yaml::MappingTraits< ModuleSummaryIndex >
Definition: ModuleSummaryIndexYAML.h:278
C
(vector float) vec_cmpeq(*A, *B) C
Definition: README_ALTIVEC.txt:86
llvm::GlobalValueSummaryInfo::NameOrGV
Definition: ModuleSummaryIndex.h:125
llvm::FunctionSummary::ParamAccess::Call::ParamNo
uint64_t ParamNo
Definition: ModuleSummaryIndex.h:583
llvm::StringMap::insert
bool insert(MapEntryTy *KeyValue)
insert - Insert the specified key/value pair into the map.
Definition: StringMap.h:276
llvm::FunctionSummary::type_tests
ArrayRef< GlobalValue::GUID > type_tests() const
Returns the list of type identifiers used by this function in llvm.type.test intrinsics other than by...
Definition: ModuleSummaryIndex.h:706
llvm::FunctionSummary::type_test_assume_vcalls
ArrayRef< VFuncId > type_test_assume_vcalls() const
Returns the list of virtual calls made by this function using llvm.assume(llvm.type....
Definition: ModuleSummaryIndex.h:715
llvm::WholeProgramDevirtResolution::ByArg::Kind
Kind
Definition: ModuleSummaryIndex.h:947
llvm::FunctionSummary::ForceSummaryHotnessType
ForceSummaryHotnessType
Types for -force-summary-edges-cold debugging option.
Definition: ModuleSummaryIndex.h:517
llvm::GlobalValueSummaryInfo::U
union llvm::GlobalValueSummaryInfo::NameOrGV U
llvm::GlobalValueSummary::GlobalVarKind
@ GlobalVarKind
Definition: ModuleSummaryIndex.h:291
llvm::X86AS::FS
@ FS
Definition: X86.h:182
llvm::GlobalValueSummary::flags
GVFlags flags() const
Get the flags for this GlobalValue (see struct GVFlags).
Definition: ModuleSummaryIndex.h:397
llvm::CalleeInfo::HotnessType
HotnessType
Definition: ModuleSummaryIndex.h:56
B
static GCRegistry::Add< OcamlGC > B("ocaml", "ocaml 3.10-compatible GC")
llvm::ModuleSummaryIndex::modulePaths
StringMap< std::pair< uint64_t, ModuleHash > > & modulePaths()
Table of modules, containing hash and id.
Definition: ModuleSummaryIndex.h:1382
llvm::WholeProgramDevirtResolution::ByArg::Byte
uint32_t Byte
Definition: ModuleSummaryIndex.h:963
llvm::GlobalVarSummary::isConstant
bool isConstant() const
Definition: ModuleSummaryIndex.h:884
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::operator<<
raw_ostream & operator<<(raw_ostream &OS, const APFixedPoint &FX)
Definition: APFixedPoint.h:230
llvm::GlobalValueSummary::getSummaryKind
SummaryKind getSummaryKind() const
Which kind of summary subclass this is.
Definition: ModuleSummaryIndex.h:387
llvm::FunctionSummary::ParamAccess::ParamAccess
ParamAccess(uint64_t ParamNo, const ConstantRange &Use)
Definition: ModuleSummaryIndex.h:605
llvm::getHotnessName
const char * getHotnessName(CalleeInfo::HotnessType HT)
Definition: ModuleSummaryIndex.h:104
llvm::GlobalVarSummary::maybeReadOnly
bool maybeReadOnly() const
Definition: ModuleSummaryIndex.h:882
llvm::ModuleSummaryIndex::addOriginalName
void addOriginalName(GlobalValue::GUID ValueGUID, GlobalValue::GUID OrigGUID)
Add an original name for the value of the given GUID.
Definition: ModuleSummaryIndex.h:1328
llvm::ModuleSummaryIndex::hasExportedFunctions
bool hasExportedFunctions(const Module &M) const
Check if the given Module has any functions available for exporting in the index.
Definition: ModuleSummaryIndex.h:1436
llvm::ModuleSummaryIndex::getFlags
uint64_t getFlags() const
Definition: ModuleSummaryIndex.cpp:93
llvm::CalleeInfo::updateRelBlockFreq
void updateRelBlockFreq(uint64_t BlockFreq, uint64_t EntryFreq)
Update RelBlockFreq from BlockFreq and EntryFreq.
Definition: ModuleSummaryIndex.h:90
llvm::ModuleSummaryIndex::findSummaryInModule
GlobalValueSummary * findSummaryInModule(ValueInfo VI, StringRef ModuleId) const
Find the summary for ValueInfo VI in module ModuleId, or nullptr if not found.
Definition: ModuleSummaryIndex.h:1340
StringMap.h
llvm::ModuleSummaryIndex::withGlobalValueDeadStripping
bool withGlobalValueDeadStripping() const
Definition: ModuleSummaryIndex.h:1207
llvm::WholeProgramDevirtResolution::Kind
Kind
Definition: ModuleSummaryIndex.h:936
llvm::WholeProgramDevirtResolution::BranchFunnel
@ BranchFunnel
When retpoline mitigation is enabled, use a branch funnel that is defined in the merged module.
Definition: ModuleSummaryIndex.h:939
llvm::ValueInfo::ReadOnly
@ ReadOnly
Definition: ModuleSummaryIndex.h:167
llvm::TypeTestResolution::BitMask
uint8_t BitMask
Definition: ModuleSummaryIndex.h:931
llvm::TypeTestResolution::Inline
@ Inline
Inlined bit vector ("Short Inline Bit Vectors")
Definition: ModuleSummaryIndex.h:912
llvm::None
const NoneType None
Definition: None.h:23
llvm::ValueInfo::getELFVisibility
GlobalValue::VisibilityTypes getELFVisibility() const
Returns the most constraining visibility among summaries.
Definition: ModuleSummaryIndex.cpp:43
llvm::GlobalValueSummary::GVFlags::Visibility
unsigned Visibility
Indicates the visibility.
Definition: ModuleSummaryIndex.h:305
llvm::GlobalValue::getGUID
static GUID getGUID(StringRef GlobalName)
Return a 64-bit global unique ID constructed from global value name (i.e.
Definition: GlobalValue.h:507
llvm::FunctionSummary::addTypeTest
void addTypeTest(GlobalValue::GUID Guid)
Add a type test to the summary.
Definition: ModuleSummaryIndex.h:766
llvm::ModuleSummaryIndex::setHasSyntheticEntryCounts
void setHasSyntheticEntryCounts()
Definition: ModuleSummaryIndex.h:1230
llvm::CalleeInfo
Class to accumulate and hold information about a callee.
Definition: ModuleSummaryIndex.h:55
llvm::WholeProgramDevirtResolution::SingleImpl
@ SingleImpl
Single implementation devirtualization.
Definition: ModuleSummaryIndex.h:938
llvm::StringMap< std::pair< uint64_t, ModuleHash > >
llvm::ValueInfo
Struct that holds a reference to a particular GUID in a global value summary.
Definition: ModuleSummaryIndex.h:166
llvm::SmallString< 256 >
llvm::CalleeInfo::HotnessType::None
@ None
llvm::ValueInfo::setReadOnly
void setReadOnly()
Definition: ModuleSummaryIndex.h:211
llvm::ValueInfo::canAutoHide
bool canAutoHide() const
Checks if all copies are eligible for auto-hiding (have flag set).
Definition: ModuleSummaryIndex.cpp:68
llvm::TypeTestResolution::AlignLog2
uint64_t AlignLog2
Definition: ModuleSummaryIndex.h:929
llvm::GlobalVarSummary::setVCallVisibility
void setVCallVisibility(GlobalObject::VCallVisibility Vis)
Definition: ModuleSummaryIndex.h:885
llvm::WholeProgramDevirtResolution::SingleImplName
std::string SingleImplName
Definition: ModuleSummaryIndex.h:944
llvm::AliasSummary::hasAliasee
bool hasAliasee() const
Definition: ModuleSummaryIndex.h:471
StringSaver.h
llvm::ModuleSummaryIndex::findSummaryInModule
GlobalValueSummary * findSummaryInModule(GlobalValue::GUID ValueGUID, StringRef ModuleId) const
Find the summary for global GUID in module ModuleId, or nullptr if not found.
Definition: ModuleSummaryIndex.h:1354
llvm::GlobalVarSummary::maybeWriteOnly
bool maybeWriteOnly() const
Definition: ModuleSummaryIndex.h:883
llvm::TypeTestResolution::Single
@ Single
Single element (last example in "Short Inline Bit Vectors")
Definition: ModuleSummaryIndex.h:913
llvm::WholeProgramDevirtResolution::ByArg::UniformRetVal
@ UniformRetVal
Uniform return value optimization.
Definition: ModuleSummaryIndex.h:949
llvm::PointerIntPair::getPointer
PointerTy getPointer() const
Definition: PointerIntPair.h:59
G
const DataFlowGraph & G
Definition: RDFGraph.cpp:202
llvm::DenseSet< GlobalValue::GUID >
llvm::ModuleSummaryIndex::isGUIDLive
bool isGUIDLive(GlobalValue::GUID GUID) const
Definition: ModuleSummaryIndex.cpp:175
llvm::FunctionSummary::VFuncId
An "identifier" for a virtual function.
Definition: ModuleSummaryIndex.h:527
llvm::CalleeInfo::HotnessType::Hot
@ Hot
llvm::GlobalValue
Definition: GlobalValue.h:44
VI
@ VI
Definition: SIInstrInfo.cpp:7367
llvm::WholeProgramDevirtResolution::ByArg::Indir
@ Indir
Just do a regular virtual call.
Definition: ModuleSummaryIndex.h:948
llvm::Constant
This is an important base class in LLVM.
Definition: Constant.h:41
llvm::GlobalValueSummary::linkage
GlobalValue::LinkageTypes linkage() const
Return linkage type recorded for this global value.
Definition: ModuleSummaryIndex.h:400
llvm::GlobalVarSummary::vTableFuncs
ArrayRef< VirtFuncOffset > vTableFuncs() const
Definition: ModuleSummaryIndex.h:897
llvm::GlobalValueSummary::GVFlags::GVFlags
GVFlags(GlobalValue::LinkageTypes Linkage, GlobalValue::VisibilityTypes Visibility, bool NotEligibleToImport, bool Live, bool IsLocal, bool CanAutoHide)
Convenience Constructors.
Definition: ModuleSummaryIndex.h:334
llvm::WholeProgramDevirtResolution::Indir
@ Indir
Just do a regular virtual call.
Definition: ModuleSummaryIndex.h:937
llvm::ValueInfo::getAccessSpecifier
unsigned getAccessSpecifier() const
Definition: ModuleSummaryIndex.h:203
llvm::ModuleSummaryIndex::dumpSCCs
void dumpSCCs(raw_ostream &OS)
Print out strongly connected components for debugging.
Definition: ModuleSummaryIndex.cpp:350
llvm::BumpPtrAllocatorImpl
Allocate memory in an ever growing pool, as if by bump-pointer.
Definition: Allocator.h:67
llvm::ModuleSummaryIndex::getValueInfo
ValueInfo getValueInfo(const GlobalValueSummaryMapTy::value_type &R) const
Return a ValueInfo for the index value_type (convenient when iterating index).
Definition: ModuleSummaryIndex.h:1254
move
compiles ldr LCPI1_0 ldr ldr mov lsr tst moveq r1 ldr LCPI1_1 and r0 bx lr It would be better to do something like to fold the shift into the conditional move
Definition: README.txt:546
llvm::ModuleSummaryIndex::getGUIDFromOriginalID
GlobalValue::GUID getGUIDFromOriginalID(GlobalValue::GUID OriginalID) const
Return the GUID for OriginalId in the OidGuidMap.
Definition: ModuleSummaryIndex.h:1291
llvm::DenseMap
Definition: DenseMap.h:714
llvm::ModuleSummaryIndex::getBlockCount
uint64_t getBlockCount() const
Definition: ModuleSummaryIndex.h:1134
llvm::AliasSummary::AliasSummary
AliasSummary(GVFlags Flags)
Definition: ModuleSummaryIndex.h:457
llvm::operator<
bool operator<(int64_t V1, const APSInt &V2)
Definition: APSInt.h:343
llvm::VTableFuncList
std::vector< VirtFuncOffset > VTableFuncList
List of functions referenced by a particular vtable definition.
Definition: ModuleSummaryIndex.h:821
llvm::DenseMapInfo< FunctionSummary::ConstVCall >::getTombstoneKey
static FunctionSummary::ConstVCall getTombstoneKey()
Definition: ModuleSummaryIndex.h:796
I
#define I(x, y, z)
Definition: MD5.cpp:59
llvm::StringMap::lookup
ValueTy lookup(StringRef Key) const
lookup - Return the entry for the specified key, or a default constructed value if no such entry exis...
Definition: StringMap.h:234
llvm::PointerIntPair::getInt
IntType getInt() const
Definition: PointerIntPair.h:61
StringExtras.h
llvm::GraphTraits< ValueInfo >::child_end
static ChildIteratorType child_end(NodeRef N)
Definition: ModuleSummaryIndex.h:1558
llvm::ModuleSummaryIndex::setBlockCount
void setBlockCount(uint64_t C)
Definition: ModuleSummaryIndex.h:1136
llvm::GraphTraits< ModuleSummaryIndex * >::getEntryNode
static NodeRef getEntryNode(ModuleSummaryIndex *I)
Definition: ModuleSummaryIndex.h:1591
llvm::ModuleSummaryIndex::print
void print(raw_ostream &OS, bool IsForDebug=false) const
Print to an output stream.
Definition: AsmWriter.cpp:4731
llvm::ModuleSummaryIndex::getTypeIdCompatibleVtableSummary
Optional< TypeIdCompatibleVtableInfo > getTypeIdCompatibleVtableSummary(StringRef TypeId) const
For the given TypeId, this returns the TypeIdCompatibleVtableMap entry if present in the summary map.
Definition: ModuleSummaryIndex.h:1486
llvm::ModuleSummaryIndex::skipModuleByDistributedBackend
bool skipModuleByDistributedBackend() const
Definition: ModuleSummaryIndex.h:1232
llvm::FunctionSummary::makeDummyFunctionSummary
static FunctionSummary makeDummyFunctionSummary(std::vector< FunctionSummary::EdgeTy > Edges)
Create an empty FunctionSummary (with specified call edges).
Definition: ModuleSummaryIndex.h:612
llvm::WholeProgramDevirtResolution::ByArg::UniqueRetVal
@ UniqueRetVal
Unique return value optimization.
Definition: ModuleSummaryIndex.h:950
ArrayRef.h
llvm::gvsummary_iterator
GlobalValueSummaryMapTy::iterator gvsummary_iterator
Definition: ModuleSummaryIndex.h:985
llvm::TypeIdSummary
Definition: ModuleSummaryIndex.h:972
llvm::TypeIdOffsetVtableInfo::TypeIdOffsetVtableInfo
TypeIdOffsetVtableInfo(uint64_t Offset, ValueInfo VI)
Definition: ModuleSummaryIndex.h:1012
llvm::ModuleSummaryIndex::modulePaths
const StringMap< std::pair< uint64_t, ModuleHash > > & modulePaths() const
Table of modules, containing module hash and id.
Definition: ModuleSummaryIndex.h:1377
llvm::ModuleSummaryIndex::addBlockCount
void addBlockCount(uint64_t C)
Definition: ModuleSummaryIndex.h:1135
llvm::CalleeInfo::Hotness
uint32_t Hotness
Definition: ModuleSummaryIndex.h:66
assert
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
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:1556
llvm::GlobalValueSummary::FunctionKind
@ FunctionKind
Definition: ModuleSummaryIndex.h:291
llvm::ModuleSummaryIndex::getOrInsertValueInfo
ValueInfo getOrInsertValueInfo(GlobalValue::GUID GUID)
Return a ValueInfo for GUID.
Definition: ModuleSummaryIndex.h:1265
llvm::operator==
bool operator==(uint64_t V1, const APInt &V2)
Definition: APInt.h:2035
llvm::ModuleSummaryIndex::typeIds
const TypeIdSummaryMapTy & typeIds() const
Definition: ModuleSummaryIndex.h:1440
llvm::ModuleSummaryIndex::setWithDSOLocalPropagation
void setWithDSOLocalPropagation()
Definition: ModuleSummaryIndex.h:1220
llvm::ModuleSummaryIndex::begin
gvsummary_iterator begin()
Definition: ModuleSummaryIndex.h:1138
llvm::Module
A Module instance is used to store all the information related to an LLVM module.
Definition: Module.h:67
llvm::ModuleSummaryIndex::cfiFunctionDefs
std::set< std::string > & cfiFunctionDefs()
Definition: ModuleSummaryIndex.h:1296
llvm::ModuleSummaryIndex::ModuleSummaryIndex
ModuleSummaryIndex(bool HaveGVs, bool EnableSplitLTOUnit=false)
Definition: ModuleSummaryIndex.h:1113
TinyPtrVector.h
llvm::FunctionSummary::FFlags
Flags specific to function summaries.
Definition: ModuleSummaryIndex.h:561
llvm::StringSaver
Saves strings in the provided stable storage and returns a StringRef with a stable character pointer.
Definition: StringSaver.h:21
llvm::ModuleSummaryIndex::partiallySplitLTOUnits
bool partiallySplitLTOUnits() const
Definition: ModuleSummaryIndex.h:1242
llvm::DenseMapInfo< FunctionSummary::VFuncId >::getEmptyKey
static FunctionSummary::VFuncId getEmptyKey()
Definition: ModuleSummaryIndex.h:778
llvm::FunctionSummary::setParamAccesses
void setParamAccesses(std::vector< ParamAccess > NewParams)
Sets the list of known uses of pointer parameters.
Definition: ModuleSummaryIndex.h:755
llvm::FunctionSummary::instCount
unsigned instCount() const
Get the instruction count recorded for this function.
Definition: ModuleSummaryIndex.h:690
llvm::ArrayRef
ArrayRef - Represent a constant reference to an array (0 or more elements consecutively in memory),...
Definition: APInt.h:32
llvm::GlobalValueSummary::SummaryKind
SummaryKind
Sububclass discriminator (for dyn_cast<> et al.)
Definition: ModuleSummaryIndex.h:291
llvm::CalleeInfo::HotnessType::Unknown
@ Unknown
llvm::min
Expected< ExpressionValue > min(const ExpressionValue &Lhs, const ExpressionValue &Rhs)
Definition: FileCheck.cpp:339
llvm::ModuleSummaryIndex::exportToDot
void exportToDot(raw_ostream &OS, const DenseSet< GlobalValue::GUID > &GUIDPreservedSymbols) const
Export summary to dot file for GraphViz.
Definition: ModuleSummaryIndex.cpp:523
llvm::ModuleSummaryIndex::setFlags
void setFlags(uint64_t Flags)
Definition: ModuleSummaryIndex.cpp:112
llvm::StringRef
StringRef - Represent a constant reference to a string, i.e.
Definition: StringRef.h:57
llvm_unreachable
#define llvm_unreachable(msg)
Marks that the current location is not supposed to be reachable.
Definition: ErrorHandling.h:136
llvm::GlobalValueSummary::AliasKind
@ AliasKind
Definition: ModuleSummaryIndex.h:291
llvm::ModuleSummaryIndex::getValueInfo
ValueInfo getValueInfo(GlobalValue::GUID GUID) const
Return a ValueInfo for GUID if it exists, otherwise return ValueInfo().
Definition: ModuleSummaryIndex.h:1259
llvm::GlobalValueSummaryInfo::NameOrGV::NameOrGV
NameOrGV(bool HaveGVs)
Definition: ModuleSummaryIndex.h:126
uint32_t
llvm::ModuleSummaryIndex::collectDefinedGVSummariesPerModule
void collectDefinedGVSummariesPerModule(Map &ModuleToDefinedGVSummaries) const
Collect for each module the list of Summaries it defines (GUID -> Summary).
Definition: ModuleSummaryIndex.h:1502
llvm::ValueInfo::haveGVs
bool haveGVs() const
Definition: ModuleSummaryIndex.h:194
llvm::GlobalValueSummary::GlobalValueSummary
GlobalValueSummary(SummaryKind K, GVFlags Flags, std::vector< ValueInfo > Refs)
Definition: ModuleSummaryIndex.h:370
llvm::FunctionSummary::ParamAccess::Call::Call
Call(uint64_t ParamNo, ValueInfo Callee, const ConstantRange &Offsets)
Definition: ModuleSummaryIndex.h:588
ConstantRange.h
llvm::CalleeInfo::updateHotness
void updateHotness(const HotnessType OtherHotness)
Definition: ModuleSummaryIndex.h:79
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::AliasSummary::getAliasee
GlobalValueSummary & getAliasee()
Definition: ModuleSummaryIndex.h:483
llvm::TypeTestResolution
Definition: ModuleSummaryIndex.h:904
llvm::TypeIdCompatibleVtableInfo
std::vector< TypeIdOffsetVtableInfo > TypeIdCompatibleVtableInfo
List of vtable definitions decorated by a particular type identifier, and their corresponding offsets...
Definition: ModuleSummaryIndex.h:1022
llvm::ModuleSummaryIndex::cfiFunctionDecls
std::set< std::string > & cfiFunctionDecls()
Definition: ModuleSummaryIndex.h:1299
llvm::GlobalValueSummaryInfo::NameOrGV::Name
StringRef Name
Summary string representation.
Definition: ModuleSummaryIndex.h:144
llvm::ValueInfo::RefAndFlags
PointerIntPair< const GlobalValueSummaryMapTy::value_type *, 3, int > RefAndFlags
Definition: ModuleSummaryIndex.h:169
llvm::FunctionSummary::FSHT_None
@ FSHT_None
Definition: ModuleSummaryIndex.h:518
llvm::FunctionSummary::entryCount
uint64_t entryCount() const
Get the synthetic entry count for this function.
Definition: ModuleSummaryIndex.h:693
llvm::TypeTestResolution::TheKind
enum llvm::TypeTestResolution::Kind TheKind
llvm::TypeTestResolution::Unknown
@ Unknown
Unknown (analysis not performed, don't lower)
Definition: ModuleSummaryIndex.h:916
ScaledNumber.h
llvm::GlobalVarSummary::setVTableFuncs
void setVTableFuncs(VTableFuncList Funcs)
Definition: ModuleSummaryIndex.h:892
llvm::ValueInfo::getRef
const GlobalValueSummaryMapTy::value_type * getRef() const
Definition: ModuleSummaryIndex.h:222
llvm::find_if
auto find_if(R &&Range, UnaryPredicate P)
Provide wrappers to std::find_if which take ranges instead of having to pass begin/end explicitly.
Definition: STLExtras.h:1525
llvm::ModuleSummaryIndex::canImportGlobalVar
bool canImportGlobalVar(GlobalValueSummary *S, bool AnalyzeRefs) const
Checks if we can import global variable from another module.
Definition: ModuleSummaryIndex.cpp:315
llvm::CalleeInfo::CalleeInfo
CalleeInfo()
Definition: ModuleSummaryIndex.h:74
llvm::GlobalVarSummary::GVarFlags::Constant
unsigned Constant
Definition: ModuleSummaryIndex.h:863
llvm::DenseMapInfo< FunctionSummary::VFuncId >::getHashValue
static unsigned getHashValue(FunctionSummary::VFuncId I)
Definition: ModuleSummaryIndex.h:788
llvm::PointerIntPair::setPointer
void setPointer(PointerTy PtrVal) LLVM_LVALUE_FUNCTION
Definition: PointerIntPair.h:63
llvm::GlobalValueSummaryList
std::vector< std::unique_ptr< GlobalValueSummary > > GlobalValueSummaryList
Definition: ModuleSummaryIndex.h:122
llvm::CalleeInfo::HotnessType::Critical
@ Critical
llvm::FunctionSummary::type_checked_load_vcalls
ArrayRef< VFuncId > type_checked_load_vcalls() const
Returns the list of virtual calls made by this function using llvm.type.checked.load intrinsics that ...
Definition: ModuleSummaryIndex.h:724
llvm::DenseMapInfo< ValueInfo >::getHashValue
static unsigned getHashValue(ValueInfo I)
Definition: ModuleSummaryIndex.h:283
llvm::ModuleSummaryIndex::cfiFunctionDecls
const std::set< std::string > & cfiFunctionDecls() const
Definition: ModuleSummaryIndex.h:1300
llvm::ScaledNumber< uint64_t >
llvm::DenseMapInfo< FunctionSummary::ConstVCall >::getEmptyKey
static FunctionSummary::ConstVCall getEmptyKey()
Definition: ModuleSummaryIndex.h:792
llvm::FunctionSummary::ExternalNode
static FunctionSummary ExternalNode
A dummy node to reference external functions that aren't in the index.
Definition: ModuleSummaryIndex.h:630
llvm::GlobalVarSummary::varflags
GVarFlags varflags() const
Definition: ModuleSummaryIndex.h:879
llvm::WholeProgramDevirtResolution::ByArg
Definition: ModuleSummaryIndex.h:946
llvm::FunctionSummary
Function summary information to aid decisions and implementation of importing.
Definition: ModuleSummaryIndex.h:511
llvm::TypeTestResolution::SizeM1
uint64_t SizeM1
Definition: ModuleSummaryIndex.h:930
llvm::ModuleSummaryIndex::setWithGlobalValueDeadStripping
void setWithGlobalValueDeadStripping()
Definition: ModuleSummaryIndex.h:1210
llvm::GlobalObject::VCallVisibility
VCallVisibility
Definition: GlobalObject.h:35
llvm::GraphProgram::Name
Name
Definition: GraphWriter.h:52
std
Definition: BitVector.h:941
llvm::AliasSummary::classof
static bool classof(const GlobalValueSummary *GVS)
Check if this is an alias summary.
Definition: ModuleSummaryIndex.h:462
llvm::FunctionSummary::ParamAccess::Calls
std::vector< Call > Calls
In the per-module summary, it summarizes the byte offset applied to each pointer parameter before pas...
Definition: ModuleSummaryIndex.h:602
llvm::FunctionSummary::ParamAccess::RangeWidth
static constexpr uint32_t RangeWidth
Definition: ModuleSummaryIndex.h:577
get
Should compile to something r4 addze r3 instead we get
Definition: README.txt:24
llvm::GlobalValueSummary::getOriginalName
GlobalValue::GUID getOriginalName() const
Returns the hash of the original name, it is identical to the GUID for externally visible symbols,...
Definition: ModuleSummaryIndex.h:381
llvm::FunctionSummary::FFlags::ReadNone
unsigned ReadNone
Definition: ModuleSummaryIndex.h:564
llvm::ModuleSummaryIndex::calculateCallGraphRoot
FunctionSummary calculateCallGraphRoot()
Definition: ModuleSummaryIndex.h:1178
llvm::ModuleSummaryIndex::cfiFunctionDefs
const std::set< std::string > & cfiFunctionDefs() const
Definition: ModuleSummaryIndex.h:1297
llvm::GlobalValue::getGUID
GUID getGUID() const
Return a 64-bit global unique ID constructed from global value name (i.e.
Definition: GlobalValue.h:511
llvm::ModuleSummaryIndex::typeIdCompatibleVtableMap
const auto & typeIdCompatibleVtableMap() const
Definition: ModuleSummaryIndex.h:1471
llvm::CalleeInfo::RelBlockFreq
uint32_t RelBlockFreq
The value stored in RelBlockFreq has to be interpreted as the digits of a scaled number with a scale ...
Definition: ModuleSummaryIndex.h:70
llvm::CalleeInfo::getHotness
HotnessType getHotness() const
Definition: ModuleSummaryIndex.h:83
llvm::DenseMapInfo< FunctionSummary::VFuncId >::getTombstoneKey
static FunctionSummary::VFuncId getTombstoneKey()
Definition: ModuleSummaryIndex.h:780
llvm::GlobalValueSummary::GVFlags::CanAutoHide
unsigned CanAutoHide
In the per-module summary, indicates that the global value is linkonce_odr and global unnamed addr (s...
Definition: ModuleSummaryIndex.h:331
llvm::WholeProgramDevirtResolution::ByArg::Info
uint64_t Info
Additional information for the resolution:
Definition: ModuleSummaryIndex.h:958
llvm::WholeProgramDevirtResolution::ByArg::VirtualConstProp
@ VirtualConstProp
Virtual constant propagation.
Definition: ModuleSummaryIndex.h:951
llvm::ModuleSummaryIndex::getGlobalValueSummary
GlobalValueSummary * getGlobalValueSummary(const GlobalValue &GV, bool PerModuleIndex=true) const
Returns the first GlobalValueSummary for GV, asserting that there is only one if PerModuleIndex.
Definition: ModuleSummaryIndex.h:1364
llvm::GlobalVarSummary::setReadOnly
void setReadOnly(bool RO)
Definition: ModuleSummaryIndex.h:880
Scaled64
ScaledNumber< uint64_t > Scaled64
Definition: SyntheticCountsPropagation.cpp:42
llvm::FunctionSummary::specialRefCounts
std::pair< unsigned, unsigned > specialRefCounts() const
Definition: ModuleSummaryIndex.cpp:78
isEqual
static bool isEqual(const Function &Caller, const Function &Callee)
Definition: Attributes.cpp:1920
llvm::StringMap::count
size_type count(StringRef Key) const
count - Return 1 if the element is in the map, 0 otherwise.
Definition: StringMap.h:246
llvm::SmallString::str
StringRef str() const
Explicit conversion to StringRef.
Definition: SmallString.h:259
llvm::ModuleSummaryIndex::BitcodeSummaryVersion
static constexpr uint64_t BitcodeSummaryVersion
Definition: ModuleSummaryIndex.h:1122
llvm::ModuleSummaryIndex::dump
void dump() const
Dump to stderr (for debugging).
Definition: AsmWriter.cpp:4773
llvm::ConstantRange
This class represents a range of values.
Definition: ConstantRange.h:47
llvm::PointerIntPair::setInt
void setInt(IntType IntVal) LLVM_LVALUE_FUNCTION
Definition: PointerIntPair.h:67
llvm::TypeIdSummary::WPDRes
std::map< uint64_t, WholeProgramDevirtResolution > WPDRes
Mapping from byte offset to whole-program devirt resolution for that (typeid, byte offset) pair.
Definition: ModuleSummaryIndex.h:977
llvm::WholeProgramDevirtResolution::TheKind
enum llvm::WholeProgramDevirtResolution::Kind TheKind
llvm::ModuleSummaryIndex::isWriteOnly
bool isWriteOnly(const GlobalVarSummary *GVS) const
Definition: ModuleSummaryIndex.h:1225
llvm::GlobalVarSummary::classof
static bool classof(const GlobalValueSummary *GVS)
Check if this is a global variable summary.
Definition: ModuleSummaryIndex.h:875
llvm::ModuleSummaryIndex::setSkipModuleByDistributedBackend
void setSkipModuleByDistributedBackend()
Definition: ModuleSummaryIndex.h:1235
llvm::ModuleSummaryIndex::addGlobalValueSummary
void addGlobalValueSummary(const GlobalValue &GV, std::unique_ptr< GlobalValueSummary > Summary)
Add a global value summary for a value.
Definition: ModuleSummaryIndex.h:1303
llvm::FunctionSummary::type_checked_load_const_vcalls
ArrayRef< ConstVCall > type_checked_load_const_vcalls() const
Returns the list of virtual calls made by this function using llvm.type.checked.load intrinsics with ...
Definition: ModuleSummaryIndex.h:741
llvm::GlobalValueSummary::setLinkage
void setLinkage(GlobalValue::LinkageTypes Linkage)
Sets the linkage to the value determined by global summary-based optimization.
Definition: ModuleSummaryIndex.h:406
llvm::ValueInfo::setWriteOnly
void setWriteOnly()
Definition: ModuleSummaryIndex.h:217
llvm::GraphTraits< ValueInfo >::child_edge_begin
static ChildEdgeIteratorType child_edge_begin(NodeRef N)
Definition: ModuleSummaryIndex.h:1568
llvm::GlobalValueSummary::canAutoHide
bool canAutoHide() const
Definition: ModuleSummaryIndex.h:423
llvm::PointerIntPair< const GlobalValueSummaryMapTy::value_type *, 3, int >
llvm::GraphTraits< ValueInfo >::valueInfoFromEdge
static NodeRef valueInfoFromEdge(FunctionSummary::EdgeTy &P)
Definition: ModuleSummaryIndex.h:1537
llvm::TypeIdSummary::TTRes
TypeTestResolution TTRes
Definition: ModuleSummaryIndex.h:973
llvm::GlobalValueSummary::getBaseObject
GlobalValueSummary * getBaseObject()
If this is an alias summary, returns the summary of the aliased object (a global variable or function...
Definition: ModuleSummaryIndex.h:497
llvm::ModuleSummaryIndex
Class to hold module path string table and global value map, and encapsulate methods for operating on...
Definition: ModuleSummaryIndex.h:1026
llvm::ModuleSummaryIndex::getGlobalNameForLocal
static std::string getGlobalNameForLocal(StringRef Name, ModuleHash ModHash)
Convenience method for creating a promoted global name for the given value name of a local,...
Definition: ModuleSummaryIndex.h:1400
llvm::GlobalValueSummary::modulePath
StringRef modulePath() const
Get the path to the module containing this function.
Definition: ModuleSummaryIndex.h:394
llvm::FunctionSummary::FSHT_All
@ FSHT_All
Definition: ModuleSummaryIndex.h:520
llvm::FunctionSummary::ParamAccess
Describes the uses of a parameter by the function.
Definition: ModuleSummaryIndex.h:576
llvm::CalleeInfo::CalleeInfo
CalleeInfo(HotnessType Hotness, uint64_t RelBF)
Definition: ModuleSummaryIndex.h:76
N
#define N
llvm::ModuleSummaryIndex::getOrInsertValueInfo
ValueInfo getOrInsertValueInfo(const GlobalValue *GV)
Return a ValueInfo for GV and mark it as belonging to GV.
Definition: ModuleSummaryIndex.h:1283
llvm::max
Align max(MaybeAlign Lhs, Align Rhs)
Definition: Alignment.h:350
llvm::StringSaver::save
StringRef save(const char *S)
Definition: StringSaver.h:28
llvm::FunctionSummary::ParamAccess::Call
Describes the use of a value in a call instruction, specifying the call's target, the value's paramet...
Definition: ModuleSummaryIndex.h:582
llvm::GlobalValueSummaryInfo::GlobalValueSummaryInfo
GlobalValueSummaryInfo(bool HaveGVs)
Definition: ModuleSummaryIndex.h:147
llvm::GlobalVarSummary::GVarFlags::GVarFlags
GVarFlags(bool ReadOnly, bool WriteOnly, bool Constant, GlobalObject::VCallVisibility Vis)
Definition: ModuleSummaryIndex.h:840
llvm::TypeIdOffsetVtableInfo::AddressPointOffset
uint64_t AddressPointOffset
Definition: ModuleSummaryIndex.h:1015
llvm::GlobalValueSummary::~GlobalValueSummary
virtual ~GlobalValueSummary()=default
llvm::WholeProgramDevirtResolution
Definition: ModuleSummaryIndex.h:935
llvm::FunctionSummary::TypeIdInfo::TypeTests
std::vector< GlobalValue::GUID > TypeTests
List of type identifiers used by this function in llvm.type.test intrinsics referenced by something o...
Definition: ModuleSummaryIndex.h:546
llvm::FunctionSummary::setEntryCount
void setEntryCount(uint64_t EC)
Set the synthetic entry count for this function.
Definition: ModuleSummaryIndex.h:696
llvm::ModuleSummaryIndex::collectDefinedFunctionsForModule
void collectDefinedFunctionsForModule(StringRef ModulePath, GVSummaryMapTy &GVSummaryMap) const
Collect for the given module the list of functions it defines (GUID -> Summary).
Definition: ModuleSummaryIndex.cpp:147
llvm::GlobalValueSummary::GVFlags::Live
unsigned Live
In per-module summary, indicate that the global value must be considered a live root for index-based ...
Definition: ModuleSummaryIndex.h:316
llvm::GlobalValueSummary::GVFlags::DSOLocal
unsigned DSOLocal
Indicates that the linker resolved the symbol to a definition from within the same linkage unit.
Definition: ModuleSummaryIndex.h:320
llvm::CalleeInfo::ScaleShift
static constexpr int32_t ScaleShift
Definition: ModuleSummaryIndex.h:71
llvm::ValueInfo::isValidAccessSpecifier
bool isValidAccessSpecifier() const
Definition: ModuleSummaryIndex.h:207
llvm::GraphTraits
Definition: GraphTraits.h:35
llvm::ModuleSummaryIndex::withAttributePropagation
bool withAttributePropagation() const
Definition: ModuleSummaryIndex.h:1214
llvm::ModuleSummaryIndex::addGlobalValueSummary
void addGlobalValueSummary(ValueInfo VI, std::unique_ptr< GlobalValueSummary > Summary)
Add a global value summary for the given ValueInfo.
Definition: ModuleSummaryIndex.h:1316
llvm::DenseMapInfo< ValueInfo >::getTombstoneKey
static ValueInfo getTombstoneKey()
Definition: ModuleSummaryIndex.h:269
llvm::ModuleSummaryIndex::discoverNodes
static void discoverNodes(ValueInfo V, std::map< ValueInfo, bool > &FunctionHasParent)
Convenience function for doing a DFS on a ValueInfo.
Definition: ModuleSummaryIndex.h:1146
llvm::FunctionSummary::TypeIdInfo::TypeTestAssumeVCalls
std::vector< VFuncId > TypeTestAssumeVCalls
List of virtual calls made by this function using (respectively) llvm.assume(llvm....
Definition: ModuleSummaryIndex.h:551
raw_ostream.h
llvm::FunctionSummary::FunctionSummary
FunctionSummary(GVFlags Flags, unsigned NumInsts, FFlags FunFlags, uint64_t EntryCount, std::vector< ValueInfo > Refs, std::vector< EdgeTy > CGEdges, std::vector< GlobalValue::GUID > TypeTests, std::vector< VFuncId > TypeTestAssumeVCalls, std::vector< VFuncId > TypeCheckedLoadVCalls, std::vector< ConstVCall > TypeTestAssumeConstVCalls, std::vector< ConstVCall > TypeCheckedLoadConstVCalls, std::vector< ParamAccess > Params)
Definition: ModuleSummaryIndex.h:655
llvm::TypeTestResolution::ByteArray
@ ByteArray
Test a byte array (first example)
Definition: ModuleSummaryIndex.h:911
llvm::TypeIdSummaryMapTy
std::multimap< GlobalValue::GUID, std::pair< std::string, TypeIdSummary > > TypeIdSummaryMapTy
Map of a type GUID to type id string and summary (multimap used in case of GUID conflicts).
Definition: ModuleSummaryIndex.h:999
llvm::DenseMapInfo< FunctionSummary::ConstVCall >::getHashValue
static unsigned getHashValue(FunctionSummary::ConstVCall I)
Definition: ModuleSummaryIndex.h:806
llvm::FunctionSummary::ConstVCall::VFunc
VFuncId VFunc
Definition: ModuleSummaryIndex.h:536
llvm::GlobalValueSummary::setOriginalName
void setOriginalName(GlobalValue::GUID Name)
Initialize the original name hash in this summary.
Definition: ModuleSummaryIndex.h:384
llvm::ModuleHash
std::array< uint32_t, 5 > ModuleHash
160 bits SHA1
Definition: ModuleSummaryIndex.h:981
llvm::FunctionSummary::VFuncId::GUID
GlobalValue::GUID GUID
Definition: ModuleSummaryIndex.h:528
llvm::GlobalVarSummary::VarFlags
struct llvm::GlobalVarSummary::GVarFlags VarFlags
llvm::GraphTraits< ValueInfo >::EdgeRef
FunctionSummary::EdgeTy & EdgeRef
Definition: ModuleSummaryIndex.h:1535
llvm::WholeProgramDevirtResolution::ByArg::Bit
uint32_t Bit
Definition: ModuleSummaryIndex.h:964
llvm::FunctionSummary::TypeIdInfo::TypeCheckedLoadConstVCalls
std::vector< ConstVCall > TypeCheckedLoadConstVCalls
Definition: ModuleSummaryIndex.h:557
llvm::ModuleSummaryIndex::addModule
ModuleInfo * addModule(StringRef ModPath, uint64_t ModId, ModuleHash Hash=ModuleHash{{0}})
Add a new module with the given Hash, mapped to the given ModID, and return a reference to the module...
Definition: ModuleSummaryIndex.h:1421
llvm::FunctionSummary::getTypeIdInfo
const TypeIdInfo * getTypeIdInfo() const
Definition: ModuleSummaryIndex.h:772
llvm::DenseMapInfo< ValueInfo >::isSpecialKey
static bool isSpecialKey(ValueInfo V)
Definition: ModuleSummaryIndex.h:273
llvm::AliasSummary::getAliaseeGUID
GlobalValue::GUID getAliaseeGUID() const
Definition: ModuleSummaryIndex.h:491
llvm::GlobalVarSummary::GVarFlags::MaybeReadOnly
unsigned MaybeReadOnly
Definition: ModuleSummaryIndex.h:850
llvm::ValueInfo::isReadOnly
bool isReadOnly() const
Definition: ModuleSummaryIndex.h:195
llvm::TypeTestResolution::SizeM1BitWidth
unsigned SizeM1BitWidth
Range of size-1 expressed as a bit width.
Definition: ModuleSummaryIndex.h:922
llvm::Use
A Use represents the edge between a Value definition and its users.
Definition: Use.h:44
llvm::DenseMapInfo< FunctionSummary::ConstVCall >::isEqual
static bool isEqual(FunctionSummary::ConstVCall L, FunctionSummary::ConstVCall R)
Definition: ModuleSummaryIndex.h:800
llvm::GraphTraits< ValueInfo >
GraphTraits definition to build SCC for the index.
Definition: ModuleSummaryIndex.h:1533
llvm::AliasSummary::getAliaseeVI
ValueInfo getAliaseeVI() const
Definition: ModuleSummaryIndex.h:487
llvm::GlobalValueSummary::setDSOLocal
void setDSOLocal(bool Local)
Definition: ModuleSummaryIndex.h:417
llvm::ModuleSummaryIndex::getOrInsertTypeIdCompatibleVtableSummary
TypeIdCompatibleVtableInfo & getOrInsertTypeIdCompatibleVtableSummary(StringRef TypeId)
Return an existing or new TypeIdCompatibleVtableMap entry for TypeId.
Definition: ModuleSummaryIndex.h:1479
llvm::ModuleSummaryIndex::getRegularLTOModuleName
static constexpr const char * getRegularLTOModuleName()
Definition: ModuleSummaryIndex.h:1125