LLVM  14.0.0git
DiagnosticInfo.h
Go to the documentation of this file.
1 //===- llvm/IR/DiagnosticInfo.h - Diagnostic Declaration --------*- C++ -*-===//
2 //
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6 //
7 //===----------------------------------------------------------------------===//
8 //
9 // This file declares the different classes involved in low level diagnostics.
10 //
11 // Diagnostics reporting is still done as part of the LLVMContext.
12 //===----------------------------------------------------------------------===//
13 
14 #ifndef LLVM_IR_DIAGNOSTICINFO_H
15 #define LLVM_IR_DIAGNOSTICINFO_H
16 
17 #include "llvm-c/Types.h"
18 #include "llvm/ADT/Optional.h"
19 #include "llvm/ADT/SmallVector.h"
20 #include "llvm/ADT/StringRef.h"
21 #include "llvm/ADT/Twine.h"
22 #include "llvm/IR/DebugLoc.h"
24 #include "llvm/Support/TypeSize.h"
26 #include <algorithm>
27 #include <cstdint>
28 #include <functional>
29 #include <iterator>
30 #include <string>
31 
32 namespace llvm {
33 
34 // Forward declarations.
35 class DiagnosticPrinter;
36 class CallInst;
37 class Function;
38 class Instruction;
39 class InstructionCost;
40 class LLVMContext;
41 class Module;
42 class SMDiagnostic;
43 
44 /// Defines the different supported severity of a diagnostic.
45 enum DiagnosticSeverity : char {
49  // A note attaches additional information to one of the previous diagnostic
50  // types.
52 };
53 
54 /// Defines the different supported kind of a diagnostic.
55 /// This enum should be extended with a new ID for each added concrete subclass.
84  DK_FirstPluginKind // Must be last value to work with
85  // getNextAvailablePluginDiagnosticKind
86 };
87 
88 /// Get the next available kind ID for a plugin diagnostic.
89 /// Each time this function is called, it returns a different number.
90 /// Therefore, a plugin that wants to "identify" its own classes
91 /// with a dynamic identifier, just have to use this method to get a new ID
92 /// and assign it to each of its classes.
93 /// The returned ID will be greater than or equal to DK_FirstPluginKind.
94 /// Thus, the plugin identifiers will not conflict with the
95 /// DiagnosticKind values.
97 
98 /// This is the base abstract class for diagnostic reporting in
99 /// the backend.
100 /// The print method must be overloaded by the subclasses to print a
101 /// user-friendly message in the client of the backend (let us call it a
102 /// frontend).
104 private:
105  /// Kind defines the kind of report this is about.
106  const /* DiagnosticKind */ int Kind;
107  /// Severity gives the severity of the diagnostic.
108  const DiagnosticSeverity Severity;
109 
110  virtual void anchor();
111 public:
112  DiagnosticInfo(/* DiagnosticKind */ int Kind, DiagnosticSeverity Severity)
113  : Kind(Kind), Severity(Severity) {}
114 
115  virtual ~DiagnosticInfo() = default;
116 
117  /* DiagnosticKind */ int getKind() const { return Kind; }
118  DiagnosticSeverity getSeverity() const { return Severity; }
119 
120  /// Print using the given \p DP a user-friendly message.
121  /// This is the default message that will be printed to the user.
122  /// It is used when the frontend does not directly take advantage
123  /// of the information contained in fields of the subclasses.
124  /// The printed message must not end with '.' nor start with a severity
125  /// keyword.
126  virtual void print(DiagnosticPrinter &DP) const = 0;
127 };
128 
130 
131 /// Diagnostic information for inline asm reporting.
132 /// This is basically a message and an optional location.
134 private:
135  /// Optional line information. 0 if not set.
136  uint64_t LocCookie = 0;
137  /// Message to be reported.
138  const Twine &MsgStr;
139  /// Optional origin of the problem.
140  const Instruction *Instr = nullptr;
141 
142 public:
143  /// \p MsgStr is the message to be reported to the frontend.
144  /// This class does not copy \p MsgStr, therefore the reference must be valid
145  /// for the whole life time of the Diagnostic.
147  DiagnosticSeverity Severity = DS_Error)
148  : DiagnosticInfo(DK_InlineAsm, Severity), MsgStr(MsgStr) {}
149 
150  /// \p LocCookie if non-zero gives the line number for this report.
151  /// \p MsgStr gives the message.
152  /// This class does not copy \p MsgStr, therefore the reference must be valid
153  /// for the whole life time of the Diagnostic.
154  DiagnosticInfoInlineAsm(uint64_t LocCookie, const Twine &MsgStr,
155  DiagnosticSeverity Severity = DS_Error)
156  : DiagnosticInfo(DK_InlineAsm, Severity), LocCookie(LocCookie),
157  MsgStr(MsgStr) {}
158 
159  /// \p Instr gives the original instruction that triggered the diagnostic.
160  /// \p MsgStr gives the message.
161  /// This class does not copy \p MsgStr, therefore the reference must be valid
162  /// for the whole life time of the Diagnostic.
163  /// Same for \p I.
164  DiagnosticInfoInlineAsm(const Instruction &I, const Twine &MsgStr,
165  DiagnosticSeverity Severity = DS_Error);
166 
167  uint64_t getLocCookie() const { return LocCookie; }
168  const Twine &getMsgStr() const { return MsgStr; }
169  const Instruction *getInstruction() const { return Instr; }
170 
171  /// \see DiagnosticInfo::print.
172  void print(DiagnosticPrinter &DP) const override;
173 
174  static bool classof(const DiagnosticInfo *DI) {
175  return DI->getKind() == DK_InlineAsm;
176  }
177 };
178 
179 /// Diagnostic information for stack size etc. reporting.
180 /// This is basically a function and a size.
182 private:
183  /// The function that is concerned by this resource limit diagnostic.
184  const Function &Fn;
185 
186  /// Description of the resource type (e.g. stack size)
187  const char *ResourceName;
188 
189  /// The computed size usage
190  uint64_t ResourceSize;
191 
192  // Threshould passed
193  uint64_t ResourceLimit;
194 
195 public:
196  /// \p The function that is concerned by this stack size diagnostic.
197  /// \p The computed stack size.
198  DiagnosticInfoResourceLimit(const Function &Fn, const char *ResourceName,
199  uint64_t ResourceSize, uint64_t ResourceLimit,
200  DiagnosticSeverity Severity = DS_Warning,
202  : DiagnosticInfo(Kind, Severity), Fn(Fn), ResourceName(ResourceName),
203  ResourceSize(ResourceSize), ResourceLimit(ResourceLimit) {}
204 
205  const Function &getFunction() const { return Fn; }
206  const char *getResourceName() const { return ResourceName; }
207  uint64_t getResourceSize() const { return ResourceSize; }
208  uint64_t getResourceLimit() const { return ResourceLimit; }
209 
210  /// \see DiagnosticInfo::print.
211  void print(DiagnosticPrinter &DP) const override;
212 
213  static bool classof(const DiagnosticInfo *DI) {
214  return DI->getKind() == DK_ResourceLimit || DI->getKind() == DK_StackSize;
215  }
216 };
217 
219  void anchor() override;
220 public:
222  uint64_t StackLimit,
223  DiagnosticSeverity Severity = DS_Warning)
224  : DiagnosticInfoResourceLimit(Fn, "stack frame size", StackSize,
225  StackLimit, Severity, DK_StackSize) {}
226 
227  uint64_t getStackSize() const { return getResourceSize(); }
229 
230  static bool classof(const DiagnosticInfo *DI) {
231  return DI->getKind() == DK_StackSize;
232  }
233 };
234 
235 /// Diagnostic information for debug metadata version reporting.
236 /// This is basically a module and a version.
238 private:
239  /// The module that is concerned by this debug metadata version diagnostic.
240  const Module &M;
241  /// The actual metadata version.
242  unsigned MetadataVersion;
243 
244 public:
245  /// \p The module that is concerned by this debug metadata version diagnostic.
246  /// \p The actual metadata version.
247  DiagnosticInfoDebugMetadataVersion(const Module &M, unsigned MetadataVersion,
248  DiagnosticSeverity Severity = DS_Warning)
249  : DiagnosticInfo(DK_DebugMetadataVersion, Severity), M(M),
250  MetadataVersion(MetadataVersion) {}
251 
252  const Module &getModule() const { return M; }
253  unsigned getMetadataVersion() const { return MetadataVersion; }
254 
255  /// \see DiagnosticInfo::print.
256  void print(DiagnosticPrinter &DP) const override;
257 
258  static bool classof(const DiagnosticInfo *DI) {
259  return DI->getKind() == DK_DebugMetadataVersion;
260  }
261 };
262 
263 /// Diagnostic information for stripping invalid debug metadata.
265 private:
266  /// The module that is concerned by this debug metadata version diagnostic.
267  const Module &M;
268 
269 public:
270  /// \p The module that is concerned by this debug metadata version diagnostic.
272  const Module &M, DiagnosticSeverity Severity = DS_Warning)
273  : DiagnosticInfo(DK_DebugMetadataVersion, Severity), M(M) {}
274 
275  const Module &getModule() const { return M; }
276 
277  /// \see DiagnosticInfo::print.
278  void print(DiagnosticPrinter &DP) const override;
279 
280  static bool classof(const DiagnosticInfo *DI) {
281  return DI->getKind() == DK_DebugMetadataInvalid;
282  }
283 };
284 
285 /// Diagnostic information for the sample profiler.
287 public:
288  DiagnosticInfoSampleProfile(StringRef FileName, unsigned LineNum,
289  const Twine &Msg,
290  DiagnosticSeverity Severity = DS_Error)
291  : DiagnosticInfo(DK_SampleProfile, Severity), FileName(FileName),
292  LineNum(LineNum), Msg(Msg) {}
294  DiagnosticSeverity Severity = DS_Error)
295  : DiagnosticInfo(DK_SampleProfile, Severity), FileName(FileName),
296  Msg(Msg) {}
298  DiagnosticSeverity Severity = DS_Error)
299  : DiagnosticInfo(DK_SampleProfile, Severity), Msg(Msg) {}
300 
301  /// \see DiagnosticInfo::print.
302  void print(DiagnosticPrinter &DP) const override;
303 
304  static bool classof(const DiagnosticInfo *DI) {
305  return DI->getKind() == DK_SampleProfile;
306  }
307 
308  StringRef getFileName() const { return FileName; }
309  unsigned getLineNum() const { return LineNum; }
310  const Twine &getMsg() const { return Msg; }
311 
312 private:
313  /// Name of the input file associated with this diagnostic.
314  StringRef FileName;
315 
316  /// Line number where the diagnostic occurred. If 0, no line number will
317  /// be emitted in the message.
318  unsigned LineNum = 0;
319 
320  /// Message to report.
321  const Twine &Msg;
322 };
323 
324 /// Diagnostic information for the PGO profiler.
326 public:
327  DiagnosticInfoPGOProfile(const char *FileName, const Twine &Msg,
328  DiagnosticSeverity Severity = DS_Error)
329  : DiagnosticInfo(DK_PGOProfile, Severity), FileName(FileName), Msg(Msg) {}
330 
331  /// \see DiagnosticInfo::print.
332  void print(DiagnosticPrinter &DP) const override;
333 
334  static bool classof(const DiagnosticInfo *DI) {
335  return DI->getKind() == DK_PGOProfile;
336  }
337 
338  const char *getFileName() const { return FileName; }
339  const Twine &getMsg() const { return Msg; }
340 
341 private:
342  /// Name of the input file associated with this diagnostic.
343  const char *FileName;
344 
345  /// Message to report.
346  const Twine &Msg;
347 };
348 
350  DIFile *File = nullptr;
351  unsigned Line = 0;
352  unsigned Column = 0;
353 
354 public:
355  DiagnosticLocation() = default;
357  DiagnosticLocation(const DISubprogram *SP);
358 
359  bool isValid() const { return File; }
360  /// Return the full path to the file.
361  std::string getAbsolutePath() const;
362  /// Return the file name relative to the compilation directory.
363  StringRef getRelativePath() const;
364  unsigned getLine() const { return Line; }
365  unsigned getColumn() const { return Column; }
366 };
367 
368 /// Common features for diagnostics with an associated location.
370  void anchor() override;
371 public:
372  /// \p Fn is the function where the diagnostic is being emitted. \p Loc is
373  /// the location information to use in the diagnostic.
375  enum DiagnosticSeverity Severity,
376  const Function &Fn,
377  const DiagnosticLocation &Loc)
378  : DiagnosticInfo(Kind, Severity), Fn(Fn), Loc(Loc) {}
379 
380  /// Return true if location information is available for this diagnostic.
381  bool isLocationAvailable() const { return Loc.isValid(); }
382 
383  /// Return a string with the location information for this diagnostic
384  /// in the format "file:line:col". If location information is not available,
385  /// it returns "<unknown>:0:0".
386  std::string getLocationStr() const;
387 
388  /// Return location information for this diagnostic in three parts:
389  /// the relative source file path, line number and column.
390  void getLocation(StringRef &RelativePath, unsigned &Line,
391  unsigned &Column) const;
392 
393  /// Return the absolute path tot the file.
394  std::string getAbsolutePath() const;
395 
396  const Function &getFunction() const { return Fn; }
397  DiagnosticLocation getLocation() const { return Loc; }
398 
399 private:
400  /// Function where this diagnostic is triggered.
401  const Function &Fn;
402 
403  /// Debug location where this diagnostic is triggered.
404  DiagnosticLocation Loc;
405 };
406 
407 /// Common features for diagnostics dealing with optimization remarks
408 /// that are used by both IR and MIR passes.
410 public:
411  /// Used to set IsVerbose via the stream interface.
412  struct setIsVerbose {};
413 
414  /// When an instance of this is inserted into the stream, the arguments
415  /// following will not appear in the remark printed in the compiler output
416  /// (-Rpass) but only in the optimization record file
417  /// (-fsave-optimization-record).
418  struct setExtraArgs {};
419 
420  /// Used in the streaming interface as the general argument type. It
421  /// internally converts everything into a key-value pair.
422  struct Argument {
423  std::string Key;
424  std::string Val;
425  // If set, the debug location corresponding to the value.
427 
428  explicit Argument(StringRef Str = "") : Key("String"), Val(Str) {}
429  Argument(StringRef Key, const Value *V);
430  Argument(StringRef Key, const Type *T);
432  Argument(StringRef Key, const char *S) : Argument(Key, StringRef(S)) {};
433  Argument(StringRef Key, int N);
434  Argument(StringRef Key, float N);
435  Argument(StringRef Key, long N);
436  Argument(StringRef Key, long long N);
437  Argument(StringRef Key, unsigned N);
438  Argument(StringRef Key, unsigned long N);
439  Argument(StringRef Key, unsigned long long N);
441  Argument(StringRef Key, bool B) : Key(Key), Val(B ? "true" : "false") {}
444  };
445 
446  /// \p PassName is the name of the pass emitting this diagnostic. \p
447  /// RemarkName is a textual identifier for the remark (single-word,
448  /// camel-case). \p Fn is the function where the diagnostic is being emitted.
449  /// \p Loc is the location information to use in the diagnostic. If line table
450  /// information is available, the diagnostic will include the source code
451  /// location.
453  enum DiagnosticSeverity Severity,
454  const char *PassName, StringRef RemarkName,
455  const Function &Fn,
456  const DiagnosticLocation &Loc)
457  : DiagnosticInfoWithLocationBase(Kind, Severity, Fn, Loc),
459 
460  void insert(StringRef S);
461  void insert(Argument A);
462  void insert(setIsVerbose V);
463  void insert(setExtraArgs EA);
464 
465  /// \see DiagnosticInfo::print.
466  void print(DiagnosticPrinter &DP) const override;
467 
468  /// Return true if this optimization remark is enabled by one of
469  /// of the LLVM command line flags (-pass-remarks, -pass-remarks-missed,
470  /// or -pass-remarks-analysis). Note that this only handles the LLVM
471  /// flags. We cannot access Clang flags from here (they are handled
472  /// in BackendConsumer::OptimizationRemarkHandler).
473  virtual bool isEnabled() const = 0;
474 
475  StringRef getPassName() const { return PassName; }
476  StringRef getRemarkName() const { return RemarkName; }
477  std::string getMsg() const;
480 
481  bool isVerbose() const { return IsVerbose; }
482 
483  ArrayRef<Argument> getArgs() const { return Args; }
484 
485  static bool classof(const DiagnosticInfo *DI) {
486  return (DI->getKind() >= DK_FirstRemark &&
487  DI->getKind() <= DK_LastRemark) ||
488  (DI->getKind() >= DK_FirstMachineRemark &&
489  DI->getKind() <= DK_LastMachineRemark);
490  }
491 
492  bool isPassed() const {
493  return (getKind() == DK_OptimizationRemark ||
495  }
496 
497  bool isMissed() const {
498  return (getKind() == DK_OptimizationRemarkMissed ||
500  }
501 
502  bool isAnalysis() const {
503  return (getKind() == DK_OptimizationRemarkAnalysis ||
505  }
506 
507 protected:
508  /// Name of the pass that triggers this report. If this matches the
509  /// regular expression given in -Rpass=regexp, then the remark will
510  /// be emitted.
511  const char *PassName;
512 
513  /// Textual identifier for the remark (single-word, camel-case). Can be used
514  /// by external tools reading the output file for optimization remarks to
515  /// identify the remark.
517 
518  /// If profile information is available, this is the number of times the
519  /// corresponding code was executed in a profile instrumentation run.
521 
522  /// Arguments collected via the streaming interface.
524 
525  /// The remark is expected to be noisy.
526  bool IsVerbose = false;
527 
528  /// If positive, the index of the first argument that only appear in
529  /// the optimization records and not in the remark printed in the compiler
530  /// output.
532 };
533 
534 /// Allow the insertion operator to return the actual remark type rather than a
535 /// common base class. This allows returning the result of the insertion
536 /// directly by value, e.g. return OptimizationRemarkAnalysis(...) << "blah".
537 template <class RemarkT>
538 RemarkT &
539 operator<<(RemarkT &R,
540  std::enable_if_t<
541  std::is_base_of<DiagnosticInfoOptimizationBase, RemarkT>::value,
542  StringRef>
543  S) {
544  R.insert(S);
545  return R;
546 }
547 
548 /// Also allow r-value for the remark to allow insertion into a
549 /// temporarily-constructed remark.
550 template <class RemarkT>
551 RemarkT &
552 operator<<(RemarkT &&R,
553  std::enable_if_t<
554  std::is_base_of<DiagnosticInfoOptimizationBase, RemarkT>::value,
555  StringRef>
556  S) {
557  R.insert(S);
558  return R;
559 }
560 
561 template <class RemarkT>
562 RemarkT &
563 operator<<(RemarkT &R,
564  std::enable_if_t<
565  std::is_base_of<DiagnosticInfoOptimizationBase, RemarkT>::value,
567  A) {
568  R.insert(A);
569  return R;
570 }
571 
572 template <class RemarkT>
573 RemarkT &
574 operator<<(RemarkT &&R,
575  std::enable_if_t<
576  std::is_base_of<DiagnosticInfoOptimizationBase, RemarkT>::value,
578  A) {
579  R.insert(A);
580  return R;
581 }
582 
583 template <class RemarkT>
584 RemarkT &
585 operator<<(RemarkT &R,
586  std::enable_if_t<
587  std::is_base_of<DiagnosticInfoOptimizationBase, RemarkT>::value,
589  V) {
590  R.insert(V);
591  return R;
592 }
593 
594 template <class RemarkT>
595 RemarkT &
596 operator<<(RemarkT &&R,
597  std::enable_if_t<
598  std::is_base_of<DiagnosticInfoOptimizationBase, RemarkT>::value,
600  V) {
601  R.insert(V);
602  return R;
603 }
604 
605 template <class RemarkT>
606 RemarkT &
607 operator<<(RemarkT &R,
608  std::enable_if_t<
609  std::is_base_of<DiagnosticInfoOptimizationBase, RemarkT>::value,
611  EA) {
612  R.insert(EA);
613  return R;
614 }
615 
616 /// Common features for diagnostics dealing with optimization remarks
617 /// that are used by IR passes.
619  void anchor() override;
620 public:
621  /// \p PassName is the name of the pass emitting this diagnostic. \p
622  /// RemarkName is a textual identifier for the remark (single-word,
623  /// camel-case). \p Fn is the function where the diagnostic is being emitted.
624  /// \p Loc is the location information to use in the diagnostic. If line table
625  /// information is available, the diagnostic will include the source code
626  /// location. \p CodeRegion is IR value (currently basic block) that the
627  /// optimization operates on. This is currently used to provide run-time
628  /// hotness information with PGO.
630  enum DiagnosticSeverity Severity,
631  const char *PassName, StringRef RemarkName,
632  const Function &Fn,
633  const DiagnosticLocation &Loc,
634  const Value *CodeRegion = nullptr)
635  : DiagnosticInfoOptimizationBase(Kind, Severity, PassName, RemarkName, Fn,
636  Loc),
637  CodeRegion(CodeRegion) {}
638 
639  /// This is ctor variant allows a pass to build an optimization remark
640  /// from an existing remark.
641  ///
642  /// This is useful when a transformation pass (e.g LV) wants to emit a remark
643  /// (\p Orig) generated by one of its analyses (e.g. LAA) as its own analysis
644  /// remark. The string \p Prepend will be emitted before the original
645  /// message.
647  const DiagnosticInfoIROptimization &Orig)
649  (DiagnosticKind)Orig.getKind(), Orig.getSeverity(), PassName,
650  Orig.RemarkName, Orig.getFunction(), Orig.getLocation()),
651  CodeRegion(Orig.getCodeRegion()) {
652  *this << Prepend;
653  std::copy(Orig.Args.begin(), Orig.Args.end(), std::back_inserter(Args));
654  }
655 
656  /// Legacy interface.
657  /// \p PassName is the name of the pass emitting this diagnostic.
658  /// \p Fn is the function where the diagnostic is being emitted. \p Loc is
659  /// the location information to use in the diagnostic. If line table
660  /// information is available, the diagnostic will include the source code
661  /// location. \p Msg is the message to show. Note that this class does not
662  /// copy this message, so this reference must be valid for the whole life time
663  /// of the diagnostic.
665  enum DiagnosticSeverity Severity,
666  const char *PassName, const Function &Fn,
667  const DiagnosticLocation &Loc, const Twine &Msg)
668  : DiagnosticInfoOptimizationBase(Kind, Severity, PassName, "", Fn, Loc) {
669  *this << Msg.str();
670  }
671 
672  const Value *getCodeRegion() const { return CodeRegion; }
673 
674  static bool classof(const DiagnosticInfo *DI) {
675  return DI->getKind() >= DK_FirstRemark && DI->getKind() <= DK_LastRemark;
676  }
677 
678 private:
679  /// The IR value (currently basic block) that the optimization operates on.
680  /// This is currently used to provide run-time hotness information with PGO.
681  const Value *CodeRegion = nullptr;
682 };
683 
684 /// Diagnostic information for applied optimization remarks.
686 public:
687  /// \p PassName is the name of the pass emitting this diagnostic. If this name
688  /// matches the regular expression given in -Rpass=, then the diagnostic will
689  /// be emitted. \p RemarkName is a textual identifier for the remark (single-
690  /// word, camel-case). \p Loc is the debug location and \p CodeRegion is the
691  /// region that the optimization operates on (currently only block is
692  /// supported).
694  const DiagnosticLocation &Loc, const Value *CodeRegion);
695 
696  /// Same as above, but the debug location and code region are derived from \p
697  /// Instr.
699  const Instruction *Inst);
700 
701  /// Same as above, but the debug location and code region are derived from \p
702  /// Func.
704  const Function *Func);
705 
706  static bool classof(const DiagnosticInfo *DI) {
707  return DI->getKind() == DK_OptimizationRemark;
708  }
709 
710  /// \see DiagnosticInfoOptimizationBase::isEnabled.
711  bool isEnabled() const override;
712 
713 private:
714  /// This is deprecated now and only used by the function API below.
715  /// \p PassName is the name of the pass emitting this diagnostic. If
716  /// this name matches the regular expression given in -Rpass=, then the
717  /// diagnostic will be emitted. \p Fn is the function where the diagnostic
718  /// is being emitted. \p Loc is the location information to use in the
719  /// diagnostic. If line table information is available, the diagnostic
720  /// will include the source code location. \p Msg is the message to show.
721  /// Note that this class does not copy this message, so this reference
722  /// must be valid for the whole life time of the diagnostic.
723  OptimizationRemark(const char *PassName, const Function &Fn,
724  const DiagnosticLocation &Loc, const Twine &Msg)
726  Fn, Loc, Msg) {}
727 };
728 
729 /// Diagnostic information for missed-optimization remarks.
731 public:
732  /// \p PassName is the name of the pass emitting this diagnostic. If this name
733  /// matches the regular expression given in -Rpass-missed=, then the
734  /// diagnostic will be emitted. \p RemarkName is a textual identifier for the
735  /// remark (single-word, camel-case). \p Loc is the debug location and \p
736  /// CodeRegion is the region that the optimization operates on (currently only
737  /// block is supported).
739  const DiagnosticLocation &Loc,
740  const Value *CodeRegion);
741 
742  /// Same as above but \p Inst is used to derive code region and debug
743  /// location.
745  const Instruction *Inst);
746 
747  /// Same as above but \p F is used to derive code region and debug
748  /// location.
750  const Function *F);
751 
752  static bool classof(const DiagnosticInfo *DI) {
753  return DI->getKind() == DK_OptimizationRemarkMissed;
754  }
755 
756  /// \see DiagnosticInfoOptimizationBase::isEnabled.
757  bool isEnabled() const override;
758 
759 private:
760  /// This is deprecated now and only used by the function API below.
761  /// \p PassName is the name of the pass emitting this diagnostic. If
762  /// this name matches the regular expression given in -Rpass-missed=, then the
763  /// diagnostic will be emitted. \p Fn is the function where the diagnostic
764  /// is being emitted. \p Loc is the location information to use in the
765  /// diagnostic. If line table information is available, the diagnostic
766  /// will include the source code location. \p Msg is the message to show.
767  /// Note that this class does not copy this message, so this reference
768  /// must be valid for the whole life time of the diagnostic.
769  OptimizationRemarkMissed(const char *PassName, const Function &Fn,
770  const DiagnosticLocation &Loc, const Twine &Msg)
772  PassName, Fn, Loc, Msg) {}
773 };
774 
775 /// Diagnostic information for optimization analysis remarks.
777 public:
778  /// \p PassName is the name of the pass emitting this diagnostic. If this name
779  /// matches the regular expression given in -Rpass-analysis=, then the
780  /// diagnostic will be emitted. \p RemarkName is a textual identifier for the
781  /// remark (single-word, camel-case). \p Loc is the debug location and \p
782  /// CodeRegion is the region that the optimization operates on (currently only
783  /// block is supported).
785  const DiagnosticLocation &Loc,
786  const Value *CodeRegion);
787 
788  /// This is ctor variant allows a pass to build an optimization remark
789  /// from an existing remark.
790  ///
791  /// This is useful when a transformation pass (e.g LV) wants to emit a remark
792  /// (\p Orig) generated by one of its analyses (e.g. LAA) as its own analysis
793  /// remark. The string \p Prepend will be emitted before the original
794  /// message.
796  const OptimizationRemarkAnalysis &Orig)
797  : DiagnosticInfoIROptimization(PassName, Prepend, Orig) {}
798 
799  /// Same as above but \p Inst is used to derive code region and debug
800  /// location.
802  const Instruction *Inst);
803 
804  /// Same as above but \p F is used to derive code region and debug
805  /// location.
807  const Function *F);
808 
809  static bool classof(const DiagnosticInfo *DI) {
810  return DI->getKind() == DK_OptimizationRemarkAnalysis;
811  }
812 
813  /// \see DiagnosticInfoOptimizationBase::isEnabled.
814  bool isEnabled() const override;
815 
816  static const char *AlwaysPrint;
817 
818  bool shouldAlwaysPrint() const { return getPassName() == AlwaysPrint; }
819 
820 protected:
822  const Function &Fn, const DiagnosticLocation &Loc,
823  const Twine &Msg)
824  : DiagnosticInfoIROptimization(Kind, DS_Remark, PassName, Fn, Loc, Msg) {}
825 
826  OptimizationRemarkAnalysis(enum DiagnosticKind Kind, const char *PassName,
828  const DiagnosticLocation &Loc,
829  const Value *CodeRegion);
830 
831 private:
832  /// This is deprecated now and only used by the function API below.
833  /// \p PassName is the name of the pass emitting this diagnostic. If
834  /// this name matches the regular expression given in -Rpass-analysis=, then
835  /// the diagnostic will be emitted. \p Fn is the function where the diagnostic
836  /// is being emitted. \p Loc is the location information to use in the
837  /// diagnostic. If line table information is available, the diagnostic will
838  /// include the source code location. \p Msg is the message to show. Note that
839  /// this class does not copy this message, so this reference must be valid for
840  /// the whole life time of the diagnostic.
841  OptimizationRemarkAnalysis(const char *PassName, const Function &Fn,
842  const DiagnosticLocation &Loc, const Twine &Msg)
844  PassName, Fn, Loc, Msg) {}
845 };
846 
847 /// Diagnostic information for optimization analysis remarks related to
848 /// floating-point non-commutativity.
850  void anchor() override;
851 public:
852  /// \p PassName is the name of the pass emitting this diagnostic. If this name
853  /// matches the regular expression given in -Rpass-analysis=, then the
854  /// diagnostic will be emitted. \p RemarkName is a textual identifier for the
855  /// remark (single-word, camel-case). \p Loc is the debug location and \p
856  /// CodeRegion is the region that the optimization operates on (currently only
857  /// block is supported). The front-end will append its own message related to
858  /// options that address floating-point non-commutativity.
861  const DiagnosticLocation &Loc,
862  const Value *CodeRegion)
864  PassName, RemarkName, Loc, CodeRegion) {}
865 
866  static bool classof(const DiagnosticInfo *DI) {
868  }
869 
870 private:
871  /// This is deprecated now and only used by the function API below.
872  /// \p PassName is the name of the pass emitting this diagnostic. If
873  /// this name matches the regular expression given in -Rpass-analysis=, then
874  /// the diagnostic will be emitted. \p Fn is the function where the diagnostic
875  /// is being emitted. \p Loc is the location information to use in the
876  /// diagnostic. If line table information is available, the diagnostic will
877  /// include the source code location. \p Msg is the message to show. The
878  /// front-end will append its own message related to options that address
879  /// floating-point non-commutativity. Note that this class does not copy this
880  /// message, so this reference must be valid for the whole life time of the
881  /// diagnostic.
883  const DiagnosticLocation &Loc,
884  const Twine &Msg)
886  PassName, Fn, Loc, Msg) {}
887 };
888 
889 /// Diagnostic information for optimization analysis remarks related to
890 /// pointer aliasing.
892  void anchor() override;
893 public:
894  /// \p PassName is the name of the pass emitting this diagnostic. If this name
895  /// matches the regular expression given in -Rpass-analysis=, then the
896  /// diagnostic will be emitted. \p RemarkName is a textual identifier for the
897  /// remark (single-word, camel-case). \p Loc is the debug location and \p
898  /// CodeRegion is the region that the optimization operates on (currently only
899  /// block is supported). The front-end will append its own message related to
900  /// options that address pointer aliasing legality.
902  const DiagnosticLocation &Loc,
903  const Value *CodeRegion)
905  PassName, RemarkName, Loc, CodeRegion) {}
906 
907  static bool classof(const DiagnosticInfo *DI) {
909  }
910 
911 private:
912  /// This is deprecated now and only used by the function API below.
913  /// \p PassName is the name of the pass emitting this diagnostic. If
914  /// this name matches the regular expression given in -Rpass-analysis=, then
915  /// the diagnostic will be emitted. \p Fn is the function where the diagnostic
916  /// is being emitted. \p Loc is the location information to use in the
917  /// diagnostic. If line table information is available, the diagnostic will
918  /// include the source code location. \p Msg is the message to show. The
919  /// front-end will append its own message related to options that address
920  /// pointer aliasing legality. Note that this class does not copy this
921  /// message, so this reference must be valid for the whole life time of the
922  /// diagnostic.
924  const DiagnosticLocation &Loc,
925  const Twine &Msg)
927  PassName, Fn, Loc, Msg) {}
928 };
929 
930 /// Diagnostic information for machine IR parser.
931 // FIXME: Remove this, use DiagnosticInfoSrcMgr instead.
933  const SMDiagnostic &Diagnostic;
934 
935 public:
937  const SMDiagnostic &Diagnostic)
938  : DiagnosticInfo(DK_MIRParser, Severity), Diagnostic(Diagnostic) {}
939 
940  const SMDiagnostic &getDiagnostic() const { return Diagnostic; }
941 
942  void print(DiagnosticPrinter &DP) const override;
943 
944  static bool classof(const DiagnosticInfo *DI) {
945  return DI->getKind() == DK_MIRParser;
946  }
947 };
948 
949 /// Diagnostic information for ISel fallback path.
951  /// The function that is concerned by this diagnostic.
952  const Function &Fn;
953 
954 public:
956  DiagnosticSeverity Severity = DS_Warning)
957  : DiagnosticInfo(DK_ISelFallback, Severity), Fn(Fn) {}
958 
959  const Function &getFunction() const { return Fn; }
960 
961  void print(DiagnosticPrinter &DP) const override;
962 
963  static bool classof(const DiagnosticInfo *DI) {
964  return DI->getKind() == DK_ISelFallback;
965  }
966 };
967 
968 // Create wrappers for C Binding types (see CBindingWrapping.h).
970 
971 /// Diagnostic information for optimization failures.
973 public:
974  /// \p Fn is the function where the diagnostic is being emitted. \p Loc is
975  /// the location information to use in the diagnostic. If line table
976  /// information is available, the diagnostic will include the source code
977  /// location. \p Msg is the message to show. Note that this class does not
978  /// copy this message, so this reference must be valid for the whole life time
979  /// of the diagnostic.
981  const DiagnosticLocation &Loc,
982  const Twine &Msg)
984  nullptr, Fn, Loc, Msg) {}
985 
986  /// \p PassName is the name of the pass emitting this diagnostic. \p
987  /// RemarkName is a textual identifier for the remark (single-word,
988  /// camel-case). \p Loc is the debug location and \p CodeRegion is the
989  /// region that the optimization operates on (currently basic block is
990  /// supported).
991  DiagnosticInfoOptimizationFailure(const char *PassName, StringRef RemarkName,
992  const DiagnosticLocation &Loc,
993  const Value *CodeRegion);
994 
995  static bool classof(const DiagnosticInfo *DI) {
996  return DI->getKind() == DK_OptimizationFailure;
997  }
998 
999  /// \see DiagnosticInfoOptimizationBase::isEnabled.
1000  bool isEnabled() const override;
1001 };
1002 
1003 /// Diagnostic information for unsupported feature in backend.
1005 private:
1006  Twine Msg;
1007 
1008 public:
1009  /// \p Fn is the function where the diagnostic is being emitted. \p Loc is
1010  /// the location information to use in the diagnostic. If line table
1011  /// information is available, the diagnostic will include the source code
1012  /// location. \p Msg is the message to show. Note that this class does not
1013  /// copy this message, so this reference must be valid for the whole life time
1014  /// of the diagnostic.
1016  const Function &Fn, const Twine &Msg,
1017  const DiagnosticLocation &Loc = DiagnosticLocation(),
1018  DiagnosticSeverity Severity = DS_Error)
1019  : DiagnosticInfoWithLocationBase(DK_Unsupported, Severity, Fn, Loc),
1020  Msg(Msg) {}
1021 
1022  static bool classof(const DiagnosticInfo *DI) {
1023  return DI->getKind() == DK_Unsupported;
1024  }
1025 
1026  const Twine &getMessage() const { return Msg; }
1027 
1028  void print(DiagnosticPrinter &DP) const override;
1029 };
1030 
1032  switch (DK) {
1034  return DS_Error;
1035  break;
1037  return DS_Warning;
1038  break;
1040  return DS_Note;
1041  break;
1043  return DS_Remark;
1044  break;
1045  }
1046  llvm_unreachable("unknown SourceMgr::DiagKind");
1047 }
1048 
1049 /// Diagnostic information for SMDiagnostic reporting.
1051  const SMDiagnostic &Diagnostic;
1052 
1053  // For inlineasm !srcloc translation.
1054  bool InlineAsmDiag;
1055  unsigned LocCookie;
1056 
1057 public:
1059  bool InlineAsmDiag = true, unsigned LocCookie = 0)
1061  Diagnostic(Diagnostic), InlineAsmDiag(InlineAsmDiag),
1062  LocCookie(LocCookie) {}
1063 
1064  bool isInlineAsmDiag() const { return InlineAsmDiag; }
1065  const SMDiagnostic &getSMDiag() const { return Diagnostic; }
1066  unsigned getLocCookie() const { return LocCookie; }
1067  void print(DiagnosticPrinter &DP) const override;
1068 
1069  static bool classof(const DiagnosticInfo *DI) {
1070  return DI->getKind() == DK_SrcMgr;
1071  }
1072 };
1073 
1074 void diagnoseDontCall(const CallInst &CI);
1075 
1077  StringRef CalleeName;
1078  StringRef Note;
1079  unsigned LocCookie;
1080 
1081 public:
1083  DiagnosticSeverity DS, unsigned LocCookie)
1084  : DiagnosticInfo(DK_DontCall, DS), CalleeName(CalleeName), Note(Note),
1085  LocCookie(LocCookie) {}
1086  StringRef getFunctionName() const { return CalleeName; }
1087  StringRef getNote() const { return Note; }
1088  unsigned getLocCookie() const { return LocCookie; }
1089  void print(DiagnosticPrinter &DP) const override;
1090  static bool classof(const DiagnosticInfo *DI) {
1091  return DI->getKind() == DK_DontCall;
1092  }
1093 };
1094 
1095 } // end namespace llvm
1096 
1097 #endif // LLVM_IR_DIAGNOSTICINFO_H
llvm::DK_FirstPluginKind
@ DK_FirstPluginKind
Definition: DiagnosticInfo.h:84
llvm::InstructionCost
Definition: InstructionCost.h:29
llvm::DiagnosticInfoOptimizationBase::Argument::Val
std::string Val
Definition: DiagnosticInfo.h:424
llvm::Argument
This class represents an incoming formal argument to a Function.
Definition: Argument.h:29
llvm::DK_Lowering
@ DK_Lowering
Definition: DiagnosticInfo.h:61
llvm::DiagnosticLocation::DiagnosticLocation
DiagnosticLocation()=default
llvm::OptimizationRemarkMissed
Diagnostic information for missed-optimization remarks.
Definition: DiagnosticInfo.h:730
llvm::DiagnosticInfoIgnoringInvalidDebugMetadata::DiagnosticInfoIgnoringInvalidDebugMetadata
DiagnosticInfoIgnoringInvalidDebugMetadata(const Module &M, DiagnosticSeverity Severity=DS_Warning)
The module that is concerned by this debug metadata version diagnostic.
Definition: DiagnosticInfo.h:271
llvm::DiagnosticInfoOptimizationBase::print
void print(DiagnosticPrinter &DP) const override
Definition: DiagnosticInfo.cpp:237
llvm::DiagnosticInfoIgnoringInvalidDebugMetadata::classof
static bool classof(const DiagnosticInfo *DI)
Definition: DiagnosticInfo.h:280
llvm
This file implements support for optimizing divisions by a constant.
Definition: AllocatorList.h:23
llvm::DiagnosticInfoISelFallback
Diagnostic information for ISel fallback path.
Definition: DiagnosticInfo.h:950
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::DiagnosticInfoIROptimization::DiagnosticInfoIROptimization
DiagnosticInfoIROptimization(enum DiagnosticKind Kind, enum DiagnosticSeverity Severity, const char *PassName, const Function &Fn, const DiagnosticLocation &Loc, const Twine &Msg)
Legacy interface.
Definition: DiagnosticInfo.h:664
Optional.h
llvm::DiagnosticInfoIgnoringInvalidDebugMetadata::print
void print(DiagnosticPrinter &DP) const override
Definition: DiagnosticInfo.cpp:82
llvm::DiagnosticInfoDebugMetadataVersion::getModule
const Module & getModule() const
Definition: DiagnosticInfo.h:252
llvm::DiagnosticInfoUnsupported
Diagnostic information for unsupported feature in backend.
Definition: DiagnosticInfo.h:1004
llvm::SIInstrFlags::DS
@ DS
Definition: SIDefines.h:59
llvm::DiagnosticInfoIROptimization::DiagnosticInfoIROptimization
DiagnosticInfoIROptimization(const char *PassName, StringRef Prepend, const DiagnosticInfoIROptimization &Orig)
This is ctor variant allows a pass to build an optimization remark from an existing remark.
Definition: DiagnosticInfo.h:646
llvm::ElementCount
Definition: TypeSize.h:386
llvm::OptimizationRemarkAnalysisAliasing
Diagnostic information for optimization analysis remarks related to pointer aliasing.
Definition: DiagnosticInfo.h:891
llvm::DiagnosticInfoDebugMetadataVersion::classof
static bool classof(const DiagnosticInfo *DI)
Definition: DiagnosticInfo.h:258
llvm::DiagnosticInfoSampleProfile::getFileName
StringRef getFileName() const
Definition: DiagnosticInfo.h:308
llvm::DiagnosticInfoOptimizationBase::Argument::Loc
DiagnosticLocation Loc
Definition: DiagnosticInfo.h:426
llvm::DiagnosticInfoOptimizationBase::setHotness
void setHotness(Optional< uint64_t > H)
Definition: DiagnosticInfo.h:479
llvm::DK_MachineOptimizationRemarkMissed
@ DK_MachineOptimizationRemarkMissed
Definition: DiagnosticInfo.h:75
llvm::Function
Definition: Function.h:62
Note
We currently emits eax Perhaps this is what we really should generate is Is imull three or four cycles Note
Definition: README.txt:239
StringRef.h
llvm::DiagnosticInfoWithLocationBase::getLocation
DiagnosticLocation getLocation() const
Definition: DiagnosticInfo.h:397
llvm::DK_PGOProfile
@ DK_PGOProfile
Definition: DiagnosticInfo.h:80
TypeSize.h
llvm::SmallVector
This is a 'vector' (really, a variable-sized array), optimized for the case when the array is small.
Definition: SmallVector.h:1168
Types.h
llvm::DiagnosticInfoOptimizationBase::PassName
const char * PassName
Name of the pass that triggers this report.
Definition: DiagnosticInfo.h:511
llvm::DiagnosticInfoOptimizationBase::insert
void insert(StringRef S)
Definition: DiagnosticInfo.cpp:373
llvm::DiagnosticInfoOptimizationBase::getPassName
StringRef getPassName() const
Definition: DiagnosticInfo.h:475
llvm::DiagnosticInfoMIRParser::getDiagnostic
const SMDiagnostic & getDiagnostic() const
Definition: DiagnosticInfo.h:940
llvm::DiagnosticInfoPGOProfile::getMsg
const Twine & getMsg() const
Definition: DiagnosticInfo.h:339
llvm::DiagnosticInfoStackSize::DiagnosticInfoStackSize
DiagnosticInfoStackSize(const Function &Fn, uint64_t StackSize, uint64_t StackLimit, DiagnosticSeverity Severity=DS_Warning)
Definition: DiagnosticInfo.h:221
llvm::DK_DontCall
@ DK_DontCall
Definition: DiagnosticInfo.h:83
llvm::DiagnosticInfoUnsupported::getMessage
const Twine & getMessage() const
Definition: DiagnosticInfo.h:1026
llvm::DiagnosticInfoInlineAsm::getLocCookie
uint64_t getLocCookie() const
Definition: DiagnosticInfo.h:167
llvm::DiagnosticInfoSampleProfile::print
void print(DiagnosticPrinter &DP) const override
Definition: DiagnosticInfo.cpp:87
llvm::DiagnosticInfoSrcMgr::isInlineAsmDiag
bool isInlineAsmDiag() const
Definition: DiagnosticInfo.h:1064
llvm::DiagnosticInfo::getKind
int getKind() const
Definition: DiagnosticInfo.h:117
llvm::DiagnosticInfo::print
virtual void print(DiagnosticPrinter &DP) const =0
Print using the given DP a user-friendly message.
llvm::DiagnosticInfoOptimizationBase::Argument::Argument
Argument(StringRef Str="")
Definition: DiagnosticInfo.h:428
llvm::DK_OptimizationRemarkAnalysisFPCommute
@ DK_OptimizationRemarkAnalysisFPCommute
Definition: DiagnosticInfo.h:69
llvm::DiagnosticInfoResourceLimit::getResourceName
const char * getResourceName() const
Definition: DiagnosticInfo.h:206
llvm::OptimizationRemarkMissed::OptimizationRemarkMissed
OptimizationRemarkMissed(const char *PassName, StringRef RemarkName, const DiagnosticLocation &Loc, const Value *CodeRegion)
PassName is the name of the pass emitting this diagnostic.
Definition: DiagnosticInfo.cpp:275
llvm::DK_Linker
@ DK_Linker
Definition: DiagnosticInfo.h:60
llvm::DiagnosticInfoUnsupported::print
void print(DiagnosticPrinter &DP) const override
Print using the given DP a user-friendly message.
Definition: DiagnosticInfo.cpp:359
llvm::DiagnosticInfoOptimizationBase::isMissed
bool isMissed() const
Definition: DiagnosticInfo.h:497
llvm::Type
The instances of the Type class are immutable: once they are created, they are never changed.
Definition: Type.h:45
llvm::diagnoseDontCall
void diagnoseDontCall(const CallInst &CI)
Definition: DiagnosticInfo.cpp:403
llvm::DiagnosticInfoResourceLimit::classof
static bool classof(const DiagnosticInfo *DI)
Definition: DiagnosticInfo.h:213
llvm::DiagnosticInfoOptimizationBase::isPassed
bool isPassed() const
Definition: DiagnosticInfo.h:492
llvm::DiagnosticInfoOptimizationBase::RemarkName
StringRef RemarkName
Textual identifier for the remark (single-word, camel-case).
Definition: DiagnosticInfo.h:516
llvm::Optional< uint64_t >
llvm::DK_FirstRemark
@ DK_FirstRemark
Definition: DiagnosticInfo.h:72
llvm::DiagnosticInfoISelFallback::print
void print(DiagnosticPrinter &DP) const override
Print using the given DP a user-friendly message.
Definition: DiagnosticInfo.cpp:369
llvm::DiagnosticInfoOptimizationBase::getRemarkName
StringRef getRemarkName() const
Definition: DiagnosticInfo.h:476
CBindingWrapping.h
llvm::DiagnosticInfoResourceLimit::print
void print(DiagnosticPrinter &DP) const override
Definition: DiagnosticInfo.cpp:72
llvm::DiagnosticInfoIROptimization
Common features for diagnostics dealing with optimization remarks that are used by IR passes.
Definition: DiagnosticInfo.h:618
llvm::DiagnosticInfoInlineAsm::DiagnosticInfoInlineAsm
DiagnosticInfoInlineAsm(const Twine &MsgStr, DiagnosticSeverity Severity=DS_Error)
MsgStr is the message to be reported to the frontend.
Definition: DiagnosticInfo.h:146
llvm::SourceMgr::DK_Note
@ DK_Note
Definition: SourceMgr.h:37
llvm::DK_DebugMetadataVersion
@ DK_DebugMetadataVersion
Definition: DiagnosticInfo.h:62
llvm::DiagnosticInfoOptimizationBase
Common features for diagnostics dealing with optimization remarks that are used by both IR and MIR pa...
Definition: DiagnosticInfo.h:409
llvm::DK_SampleProfile
@ DK_SampleProfile
Definition: DiagnosticInfo.h:65
llvm::DiagnosticInfoPGOProfile::classof
static bool classof(const DiagnosticInfo *DI)
Definition: DiagnosticInfo.h:334
llvm::DiagnosticInfoISelFallback::classof
static bool classof(const DiagnosticInfo *DI)
Definition: DiagnosticInfo.h:963
llvm::DiagnosticInfoIROptimization::getCodeRegion
const Value * getCodeRegion() const
Definition: DiagnosticInfo.h:672
llvm::DiagnosticKind
DiagnosticKind
Defines the different supported kind of a diagnostic.
Definition: DiagnosticInfo.h:56
F
#define F(x, y, z)
Definition: MD5.cpp:56
llvm::SourceMgr::DK_Remark
@ DK_Remark
Definition: SourceMgr.h:36
DEFINE_SIMPLE_CONVERSION_FUNCTIONS
#define DEFINE_SIMPLE_CONVERSION_FUNCTIONS(ty, ref)
Definition: CBindingWrapping.h:19
llvm::DiagnosticInfoUnsupported::DiagnosticInfoUnsupported
DiagnosticInfoUnsupported(const Function &Fn, const Twine &Msg, const DiagnosticLocation &Loc=DiagnosticLocation(), DiagnosticSeverity Severity=DS_Error)
Fn is the function where the diagnostic is being emitted.
Definition: DiagnosticInfo.h:1015
llvm::DiagnosticLocation::getRelativePath
StringRef getRelativePath() const
Return the file name relative to the compilation directory.
Definition: DiagnosticInfo.cpp:125
llvm::OptimizationRemark::isEnabled
bool isEnabled() const override
Definition: DiagnosticInfo.cpp:269
llvm::DK_MachineOptimizationRemark
@ DK_MachineOptimizationRemark
Definition: DiagnosticInfo.h:74
llvm::DiagnosticInfoPGOProfile::print
void print(DiagnosticPrinter &DP) const override
Definition: DiagnosticInfo.cpp:97
llvm::OptimizationRemarkAnalysis::classof
static bool classof(const DiagnosticInfo *DI)
Definition: DiagnosticInfo.h:809
llvm::OptimizationRemarkAnalysis::OptimizationRemarkAnalysis
OptimizationRemarkAnalysis(const char *PassName, StringRef RemarkName, const DiagnosticLocation &Loc, const Value *CodeRegion)
PassName is the name of the pass emitting this diagnostic.
Definition: DiagnosticInfo.cpp:303
llvm::DiagnosticInfoUnsupported::classof
static bool classof(const DiagnosticInfo *DI)
Definition: DiagnosticInfo.h:1022
llvm::DK_MachineOptimizationRemarkAnalysis
@ DK_MachineOptimizationRemarkAnalysis
Definition: DiagnosticInfo.h:76
llvm::DS_Warning
@ DS_Warning
Definition: DiagnosticInfo.h:47
llvm::DiagnosticInfoISelFallback::DiagnosticInfoISelFallback
DiagnosticInfoISelFallback(const Function &Fn, DiagnosticSeverity Severity=DS_Warning)
Definition: DiagnosticInfo.h:955
llvm::DiagnosticInfoMIRParser::print
void print(DiagnosticPrinter &DP) const override
Print using the given DP a user-friendly message.
Definition: DiagnosticInfo.cpp:339
llvm::DiagnosticInfoOptimizationBase::getHotness
Optional< uint64_t > getHotness() const
Definition: DiagnosticInfo.h:478
C
(vector float) vec_cmpeq(*A, *B) C
Definition: README_ALTIVEC.txt:86
Twine.h
llvm::DiagnosticInfoOptimizationBase::Argument::Argument
Argument(StringRef Key, const char *S)
Definition: DiagnosticInfo.h:432
llvm::DiagnosticInfoSampleProfile::getLineNum
unsigned getLineNum() const
Definition: DiagnosticInfo.h:309
llvm::DK_MIRParser
@ DK_MIRParser
Definition: DiagnosticInfo.h:79
llvm::SMDiagnostic
Instances of this class encapsulate one diagnostic report, allowing printing to a raw_ostream as a ca...
Definition: SourceMgr.h:251
llvm::DiagnosticInfoStackSize::getStackLimit
uint64_t getStackLimit() const
Definition: DiagnosticInfo.h:228
llvm::OptimizationRemarkAnalysisFPCommute::classof
static bool classof(const DiagnosticInfo *DI)
Definition: DiagnosticInfo.h:866
llvm::DiagnosticInfoSampleProfile::DiagnosticInfoSampleProfile
DiagnosticInfoSampleProfile(StringRef FileName, const Twine &Msg, DiagnosticSeverity Severity=DS_Error)
Definition: DiagnosticInfo.h:293
llvm::DiagnosticInfoResourceLimit
Diagnostic information for stack size etc.
Definition: DiagnosticInfo.h:181
llvm::OptimizationRemarkMissed::classof
static bool classof(const DiagnosticInfo *DI)
Definition: DiagnosticInfo.h:752
llvm::DiagnosticInfoWithLocationBase::getFunction
const Function & getFunction() const
Definition: DiagnosticInfo.h:396
B
static GCRegistry::Add< OcamlGC > B("ocaml", "ocaml 3.10-compatible GC")
llvm::DK_OptimizationRemarkAnalysis
@ DK_OptimizationRemarkAnalysis
Definition: DiagnosticInfo.h:68
llvm::DiagnosticHandlerFunction
std::function< void(const DiagnosticInfo &)> DiagnosticHandlerFunction
Definition: DiagnosticInfo.h:129
llvm::Instruction
Definition: Instruction.h:45
llvm::DiagnosticInfoDebugMetadataVersion::DiagnosticInfoDebugMetadataVersion
DiagnosticInfoDebugMetadataVersion(const Module &M, unsigned MetadataVersion, DiagnosticSeverity Severity=DS_Warning)
The module that is concerned by this debug metadata version diagnostic.
Definition: DiagnosticInfo.h:247
llvm::DiagnosticSeverity
DiagnosticSeverity
Defines the different supported severity of a diagnostic.
Definition: DiagnosticInfo.h:45
LLVMDiagnosticInfoRef
struct LLVMOpaqueDiagnosticInfo * LLVMDiagnosticInfoRef
Definition: Types.h:148
llvm::operator<<
raw_ostream & operator<<(raw_ostream &OS, const APFixedPoint &FX)
Definition: APFixedPoint.h:230
llvm::DiagnosticInfoOptimizationFailure::classof
static bool classof(const DiagnosticInfo *DI)
Definition: DiagnosticInfo.h:995
llvm::DK_OptimizationRemarkMissed
@ DK_OptimizationRemarkMissed
Definition: DiagnosticInfo.h:67
llvm::DiagnosticInfo::getSeverity
DiagnosticSeverity getSeverity() const
Definition: DiagnosticInfo.h:118
llvm::DiagnosticInfoOptimizationBase::Argument::Argument
Argument(StringRef Key, bool B)
Definition: DiagnosticInfo.h:441
DebugLoc.h
llvm::DK_LastRemark
@ DK_LastRemark
Definition: DiagnosticInfo.h:73
llvm::DiagnosticInfoSampleProfile::classof
static bool classof(const DiagnosticInfo *DI)
Definition: DiagnosticInfo.h:304
llvm::DiagnosticInfo
This is the base abstract class for diagnostic reporting in the backend.
Definition: DiagnosticInfo.h:103
llvm::DiagnosticInfoSrcMgr::DiagnosticInfoSrcMgr
DiagnosticInfoSrcMgr(const SMDiagnostic &Diagnostic, bool InlineAsmDiag=true, unsigned LocCookie=0)
Definition: DiagnosticInfo.h:1058
llvm::DiagnosticInfoDontCall::getFunctionName
StringRef getFunctionName() const
Definition: DiagnosticInfo.h:1086
llvm::DiagnosticPrinter
Interface for custom diagnostic printing.
Definition: DiagnosticPrinter.h:31
llvm::OptimizationRemarkMissed::isEnabled
bool isEnabled() const override
Definition: DiagnosticInfo.cpp:297
llvm::DiagnosticInfoMIRParser::classof
static bool classof(const DiagnosticInfo *DI)
Definition: DiagnosticInfo.h:944
llvm::OptimizationRemark::OptimizationRemark
OptimizationRemark(const char *PassName, StringRef RemarkName, const DiagnosticLocation &Loc, const Value *CodeRegion)
PassName is the name of the pass emitting this diagnostic.
Definition: DiagnosticInfo.cpp:243
llvm::DiagnosticInfoOptimizationBase::Hotness
Optional< uint64_t > Hotness
If profile information is available, this is the number of times the corresponding code was executed ...
Definition: DiagnosticInfo.h:520
llvm::DK_ResourceLimit
@ DK_ResourceLimit
Definition: DiagnosticInfo.h:58
llvm::DiagnosticInfoSrcMgr::classof
static bool classof(const DiagnosticInfo *DI)
Definition: DiagnosticInfo.h:1069
llvm::Twine::str
std::string str() const
Return the twine contents as a std::string.
Definition: Twine.cpp:17
llvm::DiagnosticInfoOptimizationBase::Args
SmallVector< Argument, 4 > Args
Arguments collected via the streaming interface.
Definition: DiagnosticInfo.h:523
llvm::DiagnosticInfoInlineAsm
Diagnostic information for inline asm reporting.
Definition: DiagnosticInfo.h:133
llvm::DiagnosticInfoResourceLimit::DiagnosticInfoResourceLimit
DiagnosticInfoResourceLimit(const Function &Fn, const char *ResourceName, uint64_t ResourceSize, uint64_t ResourceLimit, DiagnosticSeverity Severity=DS_Warning, DiagnosticKind Kind=DK_ResourceLimit)
The function that is concerned by this stack size diagnostic.
Definition: DiagnosticInfo.h:198
llvm::DK_InlineAsm
@ DK_InlineAsm
Definition: DiagnosticInfo.h:57
llvm::DiagnosticInfoWithLocationBase::getLocationStr
std::string getLocationStr() const
Return a string with the location information for this diagnostic in the format "file:line:col".
Definition: DiagnosticInfo.cpp:151
llvm::DiagnosticInfoOptimizationBase::Argument
Used in the streaming interface as the general argument type.
Definition: DiagnosticInfo.h:422
llvm::DiagnosticInfoWithLocationBase::isLocationAvailable
bool isLocationAvailable() const
Return true if location information is available for this diagnostic.
Definition: DiagnosticInfo.h:381
llvm::DiagnosticInfoPGOProfile::getFileName
const char * getFileName() const
Definition: DiagnosticInfo.h:338
uint64_t
llvm::DiagnosticInfoResourceLimit::getFunction
const Function & getFunction() const
Definition: DiagnosticInfo.h:205
llvm::SourceMgr::DK_Warning
@ DK_Warning
Definition: SourceMgr.h:35
llvm::DS_Remark
@ DS_Remark
Definition: DiagnosticInfo.h:48
llvm::DiagnosticInfoIROptimization::DiagnosticInfoIROptimization
DiagnosticInfoIROptimization(enum DiagnosticKind Kind, enum DiagnosticSeverity Severity, const char *PassName, StringRef RemarkName, const Function &Fn, const DiagnosticLocation &Loc, const Value *CodeRegion=nullptr)
PassName is the name of the pass emitting this diagnostic.
Definition: DiagnosticInfo.h:629
llvm::DK_ISelFallback
@ DK_ISelFallback
Definition: DiagnosticInfo.h:64
llvm::DiagnosticInfoWithLocationBase::getAbsolutePath
std::string getAbsolutePath() const
Return the absolute path tot the file.
Definition: DiagnosticInfo.cpp:139
llvm::DiagnosticInfoSampleProfile::DiagnosticInfoSampleProfile
DiagnosticInfoSampleProfile(const Twine &Msg, DiagnosticSeverity Severity=DS_Error)
Definition: DiagnosticInfo.h:297
I
#define I(x, y, z)
Definition: MD5.cpp:59
llvm::DiagnosticInfoOptimizationBase::FirstExtraArgIndex
int FirstExtraArgIndex
If positive, the index of the first argument that only appear in the optimization records and not in ...
Definition: DiagnosticInfo.h:531
llvm::DK_SrcMgr
@ DK_SrcMgr
Definition: DiagnosticInfo.h:82
llvm::DiagnosticInfoDontCall::DiagnosticInfoDontCall
DiagnosticInfoDontCall(StringRef CalleeName, StringRef Note, DiagnosticSeverity DS, unsigned LocCookie)
Definition: DiagnosticInfo.h:1082
llvm::DiagnosticInfoPGOProfile
Diagnostic information for the PGO profiler.
Definition: DiagnosticInfo.h:325
llvm::DiagnosticInfoResourceLimit::getResourceSize
uint64_t getResourceSize() const
Definition: DiagnosticInfo.h:207
llvm::DiagnosticLocation::isValid
bool isValid() const
Definition: DiagnosticInfo.h:359
llvm::DiagnosticInfoOptimizationBase::Argument::Key
std::string Key
Definition: DiagnosticInfo.h:423
llvm::DiagnosticInfoIROptimization::classof
static bool classof(const DiagnosticInfo *DI)
Definition: DiagnosticInfo.h:674
function
print Print MemDeps of function
Definition: MemDepPrinter.cpp:83
llvm::DiagnosticInfoOptimizationBase::setExtraArgs
When an instance of this is inserted into the stream, the arguments following will not appear in the ...
Definition: DiagnosticInfo.h:418
llvm::Module
A Module instance is used to store all the information related to an LLVM module.
Definition: Module.h:67
llvm::DiagnosticInfoDebugMetadataVersion::getMetadataVersion
unsigned getMetadataVersion() const
Definition: DiagnosticInfo.h:253
llvm::DK_OptimizationRemarkAnalysisAliasing
@ DK_OptimizationRemarkAnalysisAliasing
Definition: DiagnosticInfo.h:70
llvm::DK_Unsupported
@ DK_Unsupported
Definition: DiagnosticInfo.h:81
llvm::DiagnosticInfoSampleProfile
Diagnostic information for the sample profiler.
Definition: DiagnosticInfo.h:286
YAMLTraits.h
llvm::DiagnosticInfoOptimizationBase::classof
static bool classof(const DiagnosticInfo *DI)
Definition: DiagnosticInfo.h:485
llvm::DK_StackSize
@ DK_StackSize
Definition: DiagnosticInfo.h:59
llvm::DiagnosticInfo::~DiagnosticInfo
virtual ~DiagnosticInfo()=default
llvm::ReplayInlineScope::Function
@ Function
llvm::DiagnosticInfoSrcMgr::getSMDiag
const SMDiagnostic & getSMDiag() const
Definition: DiagnosticInfo.h:1065
llvm::ArrayRef
ArrayRef - Represent a constant reference to an array (0 or more elements consecutively in memory),...
Definition: APInt.h:32
llvm::StringRef
StringRef - Represent a constant reference to a string, i.e.
Definition: StringRef.h:58
llvm::DiagnosticInfoIgnoringInvalidDebugMetadata
Diagnostic information for stripping invalid debug metadata.
Definition: DiagnosticInfo.h:264
llvm::DiagnosticInfoStackSize::getStackSize
uint64_t getStackSize() const
Definition: DiagnosticInfo.h:227
llvm::DK_OptimizationFailure
@ DK_OptimizationFailure
Definition: DiagnosticInfo.h:71
llvm_unreachable
#define llvm_unreachable(msg)
Marks that the current location is not supposed to be reachable.
Definition: ErrorHandling.h:134
llvm::DiagnosticLocation
Definition: DiagnosticInfo.h:349
DL
MachineBasicBlock MachineBasicBlock::iterator DebugLoc DL
Definition: AArch64SLSHardening.cpp:76
llvm::OptimizationRemarkAnalysisAliasing::OptimizationRemarkAnalysisAliasing
OptimizationRemarkAnalysisAliasing(const char *PassName, StringRef RemarkName, const DiagnosticLocation &Loc, const Value *CodeRegion)
PassName is the name of the pass emitting this diagnostic.
Definition: DiagnosticInfo.h:901
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::DiagnosticInfoInlineAsm::print
void print(DiagnosticPrinter &DP) const override
Definition: DiagnosticInfo.cpp:66
Module
Machine Check Debug Module
Definition: MachineCheckDebugify.cpp:122
llvm::DiagnosticInfoStackSize
Definition: DiagnosticInfo.h:218
llvm::DiagnosticInfoDebugMetadataVersion::print
void print(DiagnosticPrinter &DP) const override
Definition: DiagnosticInfo.cpp:77
llvm::DiagnosticInfoInlineAsm::DiagnosticInfoInlineAsm
DiagnosticInfoInlineAsm(uint64_t LocCookie, const Twine &MsgStr, DiagnosticSeverity Severity=DS_Error)
LocCookie if non-zero gives the line number for this report.
Definition: DiagnosticInfo.h:154
llvm::DiagnosticInfoDontCall::print
void print(DiagnosticPrinter &DP) const override
Print using the given DP a user-friendly message.
Definition: DiagnosticInfo.cpp:425
llvm::OptimizationRemarkAnalysis
Diagnostic information for optimization analysis remarks.
Definition: DiagnosticInfo.h:776
llvm::DiagnosticInfoISelFallback::getFunction
const Function & getFunction() const
Definition: DiagnosticInfo.h:959
llvm::OptimizationRemarkAnalysis::OptimizationRemarkAnalysis
OptimizationRemarkAnalysis(const char *PassName, StringRef Prepend, const OptimizationRemarkAnalysis &Orig)
This is ctor variant allows a pass to build an optimization remark from an existing remark.
Definition: DiagnosticInfo.h:795
llvm::DiagnosticInfoStackSize::classof
static bool classof(const DiagnosticInfo *DI)
Definition: DiagnosticInfo.h:230
llvm::DiagnosticInfoDontCall::classof
static bool classof(const DiagnosticInfo *DI)
Definition: DiagnosticInfo.h:1090
llvm::OptimizationRemarkAnalysis::shouldAlwaysPrint
bool shouldAlwaysPrint() const
Definition: DiagnosticInfo.h:818
llvm::SourceMgr::DiagKind
DiagKind
Definition: SourceMgr.h:33
llvm::DK_FirstMachineRemark
@ DK_FirstMachineRemark
Definition: DiagnosticInfo.h:77
llvm::Twine
Twine - A lightweight data structure for efficiently representing the concatenation of temporary valu...
Definition: Twine.h:83
H
#define H(x, y, z)
Definition: MD5.cpp:58
llvm::DiagnosticInfoOptimizationBase::getMsg
std::string getMsg() const
Definition: DiagnosticInfo.cpp:389
llvm::ore::setExtraArgs
DiagnosticInfoOptimizationBase::setExtraArgs setExtraArgs
Definition: OptimizationRemarkEmitter.h:138
llvm::DiagnosticInfoDontCall
Definition: DiagnosticInfo.h:1076
llvm::DK_LastMachineRemark
@ DK_LastMachineRemark
Definition: DiagnosticInfo.h:78
llvm::DiagnosticInfoSrcMgr
Diagnostic information for SMDiagnostic reporting.
Definition: DiagnosticInfo.h:1050
llvm::DiagnosticInfoOptimizationBase::isVerbose
bool isVerbose() const
Definition: DiagnosticInfo.h:481
llvm::DiagnosticInfoDontCall::getNote
StringRef getNote() const
Definition: DiagnosticInfo.h:1087
llvm::DK_OptimizationRemark
@ DK_OptimizationRemark
Definition: DiagnosticInfo.h:66
llvm::OptimizationRemarkAnalysisAliasing::classof
static bool classof(const DiagnosticInfo *DI)
Definition: DiagnosticInfo.h:907
llvm::DiagnosticInfo::DiagnosticInfo
DiagnosticInfo(int Kind, DiagnosticSeverity Severity)
Definition: DiagnosticInfo.h:112
llvm::DiagnosticInfoOptimizationFailure
Diagnostic information for optimization failures.
Definition: DiagnosticInfo.h:972
llvm::getDiagnosticSeverity
static DiagnosticSeverity getDiagnosticSeverity(SourceMgr::DiagKind DK)
Definition: DiagnosticInfo.h:1031
llvm::SourceMgr::DK_Error
@ DK_Error
Definition: SourceMgr.h:34
DP
So we should use XX3Form_Rcr to implement instrinsic Convert DP outs ins xscvdpsp No builtin are required Round &Convert QP DP(dword[1] is set to zero) No builtin are required Round to Quad Precision because you need to assign rounding mode in instruction Provide builtin(set f128:$vT,(int_ppc_vsx_xsrqpi f128:$vB))(set f128 yields< n x< ty > >< result > yields< ty >< result > No builtin are required Load Store load store see def memrix16 in PPCInstrInfo td Load Store Vector load store outs ins lxsdx set load store with conversion from to DP
Definition: README_P9.txt:520
llvm::OptimizationRemarkAnalysis::AlwaysPrint
static const char * AlwaysPrint
Definition: DiagnosticInfo.h:816
llvm::DiagnosticInfoIgnoringInvalidDebugMetadata::getModule
const Module & getModule() const
Definition: DiagnosticInfo.h:275
llvm::DiagnosticInfoWithLocationBase::DiagnosticInfoWithLocationBase
DiagnosticInfoWithLocationBase(enum DiagnosticKind Kind, enum DiagnosticSeverity Severity, const Function &Fn, const DiagnosticLocation &Loc)
Fn is the function where the diagnostic is being emitted.
Definition: DiagnosticInfo.h:374
llvm::DiagnosticInfoSrcMgr::getLocCookie
unsigned getLocCookie() const
Definition: DiagnosticInfo.h:1066
llvm::OptimizationRemark
Diagnostic information for applied optimization remarks.
Definition: DiagnosticInfo.h:685
llvm::OptimizationRemarkAnalysis::OptimizationRemarkAnalysis
OptimizationRemarkAnalysis(enum DiagnosticKind Kind, const char *PassName, const Function &Fn, const DiagnosticLocation &Loc, const Twine &Msg)
Definition: DiagnosticInfo.h:821
SmallVector.h
llvm::OptimizationRemark::classof
static bool classof(const DiagnosticInfo *DI)
Definition: DiagnosticInfo.h:706
N
#define N
llvm::DiagnosticLocation::getAbsolutePath
std::string getAbsolutePath() const
Return the full path to the file.
Definition: DiagnosticInfo.cpp:129
llvm::getNextAvailablePluginDiagnosticKind
int getNextAvailablePluginDiagnosticKind()
Get the next available kind ID for a plugin diagnostic.
Definition: DiagnosticInfo.cpp:47
llvm::DiagnosticInfoWithLocationBase
Common features for diagnostics with an associated location.
Definition: DiagnosticInfo.h:369
llvm::DiagnosticInfoInlineAsm::getInstruction
const Instruction * getInstruction() const
Definition: DiagnosticInfo.h:169
llvm::DISubprogram
Subprogram description.
Definition: DebugInfoMetadata.h:1820
llvm::DiagnosticLocation::getColumn
unsigned getColumn() const
Definition: DiagnosticInfo.h:365
llvm::DiagnosticInfoInlineAsm::getMsgStr
const Twine & getMsgStr() const
Definition: DiagnosticInfo.h:168
llvm::DiagnosticInfoDebugMetadataVersion
Diagnostic information for debug metadata version reporting.
Definition: DiagnosticInfo.h:237
llvm::DiagnosticInfoOptimizationBase::IsVerbose
bool IsVerbose
The remark is expected to be noisy.
Definition: DiagnosticInfo.h:526
llvm::DiagnosticInfoDontCall::getLocCookie
unsigned getLocCookie() const
Definition: DiagnosticInfo.h:1088
llvm::DiagnosticInfoSampleProfile::getMsg
const Twine & getMsg() const
Definition: DiagnosticInfo.h:310
llvm::OptimizationRemarkAnalysisFPCommute
Diagnostic information for optimization analysis remarks related to floating-point non-commutativity.
Definition: DiagnosticInfo.h:849
llvm::DebugLoc
A debug info location.
Definition: DebugLoc.h:33
llvm::DiagnosticInfoPGOProfile::DiagnosticInfoPGOProfile
DiagnosticInfoPGOProfile(const char *FileName, const Twine &Msg, DiagnosticSeverity Severity=DS_Error)
Definition: DiagnosticInfo.h:327
llvm::DiagnosticInfoSrcMgr::print
void print(DiagnosticPrinter &DP) const override
Print using the given DP a user-friendly message.
Definition: DiagnosticInfo.cpp:343
llvm::DiagnosticInfoResourceLimit::getResourceLimit
uint64_t getResourceLimit() const
Definition: DiagnosticInfo.h:208
copy
we should consider alternate ways to model stack dependencies Lots of things could be done in WebAssemblyTargetTransformInfo cpp there are numerous optimization related hooks that can be overridden in WebAssemblyTargetLowering Instead of the OptimizeReturned which should consider preserving the returned attribute through to MachineInstrs and extending the MemIntrinsicResults pass to do this optimization on calls too That would also let the WebAssemblyPeephole pass clean up dead defs for such as it does for stores Consider implementing and or getMachineCombinerPatterns Find a clean way to fix the problem which leads to the Shrink Wrapping pass being run after the WebAssembly PEI pass When setting multiple variables to the same we currently get code like const It could be done with a smaller encoding like local tee $pop5 local copy
Definition: README.txt:101
llvm::DK_DebugMetadataInvalid
@ DK_DebugMetadataInvalid
Definition: DiagnosticInfo.h:63
llvm::OptimizationRemarkAnalysis::isEnabled
bool isEnabled() const override
Definition: DiagnosticInfo.cpp:332
llvm::DiagnosticInfoOptimizationBase::isAnalysis
bool isAnalysis() const
Definition: DiagnosticInfo.h:502
llvm::DiagnosticInfoMIRParser
Diagnostic information for machine IR parser.
Definition: DiagnosticInfo.h:932
llvm::DiagnosticInfoOptimizationFailure::DiagnosticInfoOptimizationFailure
DiagnosticInfoOptimizationFailure(const Function &Fn, const DiagnosticLocation &Loc, const Twine &Msg)
Fn is the function where the diagnostic is being emitted.
Definition: DiagnosticInfo.h:980
llvm::Value
LLVM Value Representation.
Definition: Value.h:74
llvm::DiagnosticInfoSampleProfile::DiagnosticInfoSampleProfile
DiagnosticInfoSampleProfile(StringRef FileName, unsigned LineNum, const Twine &Msg, DiagnosticSeverity Severity=DS_Error)
Definition: DiagnosticInfo.h:288
llvm::DiagnosticInfoInlineAsm::classof
static bool classof(const DiagnosticInfo *DI)
Definition: DiagnosticInfo.h:174
llvm::DS_Error
@ DS_Error
Definition: DiagnosticInfo.h:46
llvm::DiagnosticInfoOptimizationBase::getArgs
ArrayRef< Argument > getArgs() const
Definition: DiagnosticInfo.h:483
llvm::DiagnosticInfoOptimizationBase::isEnabled
virtual bool isEnabled() const =0
Return true if this optimization remark is enabled by one of of the LLVM command line flags (-pass-re...
PassName
static const char PassName[]
Definition: X86LowerAMXIntrinsics.cpp:669
llvm::DiagnosticInfoOptimizationBase::DiagnosticInfoOptimizationBase
DiagnosticInfoOptimizationBase(enum DiagnosticKind Kind, enum DiagnosticSeverity Severity, const char *PassName, StringRef RemarkName, const Function &Fn, const DiagnosticLocation &Loc)
PassName is the name of the pass emitting this diagnostic.
Definition: DiagnosticInfo.h:452
llvm::DiagnosticInfoOptimizationBase::setIsVerbose
Used to set IsVerbose via the stream interface.
Definition: DiagnosticInfo.h:412
llvm::DiagnosticLocation::getLine
unsigned getLine() const
Definition: DiagnosticInfo.h:364
llvm::DIFile
File.
Definition: DebugInfoMetadata.h:530
llvm::OptimizationRemarkAnalysisFPCommute::OptimizationRemarkAnalysisFPCommute
OptimizationRemarkAnalysisFPCommute(const char *PassName, StringRef RemarkName, const DiagnosticLocation &Loc, const Value *CodeRegion)
PassName is the name of the pass emitting this diagnostic.
Definition: DiagnosticInfo.h:859
llvm::ore::setIsVerbose
DiagnosticInfoOptimizationBase::setIsVerbose setIsVerbose
Definition: OptimizationRemarkEmitter.h:137
llvm::DiagnosticInfoMIRParser::DiagnosticInfoMIRParser
DiagnosticInfoMIRParser(DiagnosticSeverity Severity, const SMDiagnostic &Diagnostic)
Definition: DiagnosticInfo.h:936
llvm::DS_Note
@ DS_Note
Definition: DiagnosticInfo.h:51