LLVM  17.0.0git
DiagnosticInfo.cpp
Go to the documentation of this file.
1 //===- llvm/IR/DiagnosticInfo.cpp - Diagnostic Definitions ------*- 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 defines the different classes involved in low level diagnostics.
10 //
11 // Diagnostics reporting is still done as part of the LLVMContext.
12 //===----------------------------------------------------------------------===//
13 
14 #include "llvm/IR/DiagnosticInfo.h"
15 #include "llvm/ADT/StringExtras.h"
16 #include "llvm/ADT/Twine.h"
18 #include "llvm/IR/BasicBlock.h"
19 #include "llvm/IR/Constants.h"
21 #include "llvm/IR/DerivedTypes.h"
23 #include "llvm/IR/Function.h"
24 #include "llvm/IR/GlobalValue.h"
25 #include "llvm/IR/Instruction.h"
26 #include "llvm/IR/Instructions.h"
27 #include "llvm/IR/LLVMContext.h"
28 #include "llvm/IR/Metadata.h"
29 #include "llvm/IR/Module.h"
30 #include "llvm/IR/Type.h"
31 #include "llvm/IR/Value.h"
32 #include "llvm/Support/Casting.h"
35 #include "llvm/Support/Path.h"
38 #include <atomic>
39 #include <string>
40 
41 using namespace llvm;
42 
44  static std::atomic<int> PluginKindID(DK_FirstPluginKind);
45  return ++PluginKindID;
46 }
47 
49 
51  const Twine &MsgStr,
52  DiagnosticSeverity Severity)
53  : DiagnosticInfo(DK_InlineAsm, Severity), MsgStr(MsgStr), Instr(&I) {
54  if (const MDNode *SrcLoc = I.getMetadata("srcloc")) {
55  if (SrcLoc->getNumOperands() != 0)
56  if (const auto *CI =
57  mdconst::dyn_extract<ConstantInt>(SrcLoc->getOperand(0)))
58  LocCookie = CI->getZExtValue();
59  }
60 }
61 
63  DP << getMsgStr();
64  if (getLocCookie())
65  DP << " at line " << getLocCookie();
66 }
67 
69  const Function &Fn, const char *ResourceName, uint64_t ResourceSize,
70  uint64_t ResourceLimit, DiagnosticSeverity Severity, DiagnosticKind Kind)
71  : DiagnosticInfoWithLocationBase(Kind, Severity, Fn, Fn.getSubprogram()),
72  Fn(Fn), ResourceName(ResourceName), ResourceSize(ResourceSize),
73  ResourceLimit(ResourceLimit) {}
74 
76  DP << getLocationStr() << ": " << getResourceName() << " ("
77  << getResourceSize() << ") exceeds limit (" << getResourceLimit()
78  << ") in function '" << getFunction() << '\'';
79 }
80 
82  DP << "ignoring debug info with an invalid version (" << getMetadataVersion()
83  << ") in " << getModule();
84 }
85 
87  DiagnosticPrinter &DP) const {
88  DP << "ignoring invalid debug info in " << getModule().getModuleIdentifier();
89 }
90 
92  if (!FileName.empty()) {
93  DP << getFileName();
94  if (LineNum > 0)
95  DP << ":" << getLineNum();
96  DP << ": ";
97  }
98  DP << getMsg();
99 }
100 
102  if (getFileName())
103  DP << getFileName() << ": ";
104  DP << getMsg();
105 }
106 
107 void DiagnosticInfo::anchor() {}
108 void DiagnosticInfoStackSize::anchor() {}
109 void DiagnosticInfoWithLocationBase::anchor() {}
110 void DiagnosticInfoIROptimization::anchor() {}
111 
113  if (!DL)
114  return;
115  File = DL->getFile();
116  Line = DL->getLine();
117  Column = DL->getColumn();
118 }
119 
121  if (!SP)
122  return;
123 
124  File = SP->getFile();
125  Line = SP->getScopeLine();
126  Column = 0;
127 }
128 
130  return File->getFilename();
131 }
132 
134  StringRef Name = File->getFilename();
135  if (sys::path::is_absolute(Name))
136  return std::string(Name);
137 
138  SmallString<128> Path;
139  sys::path::append(Path, File->getDirectory(), Name);
141 }
142 
144  return Loc.getAbsolutePath();
145 }
146 
148  unsigned &Line,
149  unsigned &Column) const {
150  RelativePath = Loc.getRelativePath();
151  Line = Loc.getLine();
152  Column = Loc.getColumn();
153 }
154 
156  StringRef Filename("<unknown>");
157  unsigned Line = 0;
158  unsigned Column = 0;
159  if (isLocationAvailable())
160  getLocation(Filename, Line, Column);
161  return (Filename + ":" + Twine(Line) + ":" + Twine(Column)).str();
162 }
163 
165  const Value *V)
166  : Key(std::string(Key)) {
167  if (auto *F = dyn_cast<Function>(V)) {
168  if (DISubprogram *SP = F->getSubprogram())
169  Loc = SP;
170  }
171  else if (auto *I = dyn_cast<Instruction>(V))
172  Loc = I->getDebugLoc();
173 
174  // Only include names that correspond to user variables. FIXME: We should use
175  // debug info if available to get the name of the user variable.
176  if (isa<llvm::Argument>(V) || isa<GlobalValue>(V))
177  Val = std::string(GlobalValue::dropLLVMManglingEscape(V->getName()));
178  else if (isa<Constant>(V)) {
180  V->printAsOperand(OS, /*PrintType=*/false);
181  } else if (auto *I = dyn_cast<Instruction>(V))
182  Val = I->getOpcodeName();
183 }
184 
186  : Key(std::string(Key)) {
188  OS << *T;
189 }
190 
192  : Key(std::string(Key)), Val(S.str()) {}
193 
195  : Key(std::string(Key)), Val(itostr(N)) {}
196 
198  : Key(std::string(Key)), Val(llvm::to_string(N)) {}
199 
201  : Key(std::string(Key)), Val(itostr(N)) {}
202 
204  : Key(std::string(Key)), Val(itostr(N)) {}
205 
207  : Key(std::string(Key)), Val(utostr(N)) {}
208 
210  unsigned long N)
211  : Key(std::string(Key)), Val(utostr(N)) {}
212 
214  unsigned long long N)
215  : Key(std::string(Key)), Val(utostr(N)) {}
216 
218  ElementCount EC)
219  : Key(std::string(Key)) {
221  EC.print(OS);
222 }
223 
226  : Key(std::string(Key)) {
228  C.print(OS);
229 }
230 
232  : Key(std::string(Key)), Loc(Loc) {
233  if (Loc) {
234  Val = (Loc->getFilename() + ":" + Twine(Loc.getLine()) + ":" +
235  Twine(Loc.getCol())).str();
236  } else {
237  Val = "<UNKNOWN LOCATION>";
238  }
239 }
240 
242  DP << getLocationStr() << ": " << getMsg();
243  if (Hotness)
244  DP << " (hotness: " << *Hotness << ")";
245 }
246 
249  const DiagnosticLocation &Loc,
250  const Value *CodeRegion)
253  *cast<BasicBlock>(CodeRegion)->getParent(), Loc, CodeRegion) {}
254 
256  StringRef RemarkName,
257  const Instruction *Inst)
259  RemarkName, *Inst->getParent()->getParent(),
260  Inst->getDebugLoc(), Inst->getParent()) {}
261 
262 static const BasicBlock *getFirstFunctionBlock(const Function *Func) {
263  return Func->empty() ? nullptr : &Func->front();
264 }
265 
267  StringRef RemarkName,
268  const Function *Func)
270  RemarkName, *Func, Func->getSubprogram(),
271  getFirstFunctionBlock(Func)) {}
272 
274  const Function &Fn = getFunction();
275  LLVMContext &Ctx = Fn.getContext();
277 }
278 
280  const char *PassName, StringRef RemarkName, const DiagnosticLocation &Loc,
281  const Value *CodeRegion)
284  *cast<BasicBlock>(CodeRegion)->getParent(), Loc, CodeRegion) {}
285 
287  StringRef RemarkName,
288  const Instruction *Inst)
290  PassName, RemarkName,
291  *Inst->getParent()->getParent(),
292  Inst->getDebugLoc(), Inst->getParent()) {}
293 
295  StringRef RemarkName,
296  const Function *Func)
298  DK_OptimizationRemarkMissed, DS_Remark, PassName, RemarkName, *Func,
299  Func->getSubprogram(), getFirstFunctionBlock(Func)) {}
300 
302  const Function &Fn = getFunction();
303  LLVMContext &Ctx = Fn.getContext();
305 }
306 
308  const char *PassName, StringRef RemarkName, const DiagnosticLocation &Loc,
309  const Value *CodeRegion)
312  *cast<BasicBlock>(CodeRegion)->getParent(), Loc, CodeRegion) {}
313 
315  StringRef RemarkName,
316  const Instruction *Inst)
318  PassName, RemarkName,
319  *Inst->getParent()->getParent(),
320  Inst->getDebugLoc(), Inst->getParent()) {}
321 
323  enum DiagnosticKind Kind, const char *PassName, StringRef RemarkName,
324  const DiagnosticLocation &Loc, const Value *CodeRegion)
325  : DiagnosticInfoIROptimization(Kind, DS_Remark, PassName, RemarkName,
326  *cast<BasicBlock>(CodeRegion)->getParent(),
327  Loc, CodeRegion) {}
328 
330  StringRef RemarkName,
331  const Function *Func)
333  DK_OptimizationRemarkAnalysis, DS_Remark, PassName, RemarkName, *Func,
334  Func->getSubprogram(), getFirstFunctionBlock(Func)) {}
335 
337  const Function &Fn = getFunction();
338  LLVMContext &Ctx = Fn.getContext();
341 }
342 
344  DP << Diagnostic;
345 }
346 
348  DP << Diagnostic;
349 }
350 
352  const char *PassName, StringRef RemarkName, const DiagnosticLocation &Loc,
353  const Value *CodeRegion)
356  *cast<BasicBlock>(CodeRegion)->getParent(), Loc, CodeRegion) {}
357 
359  // Only print warnings.
360  return getSeverity() == DS_Warning;
361 }
362 
364  std::string Str;
365  raw_string_ostream OS(Str);
366 
367  OS << getLocationStr() << ": in function " << getFunction().getName() << ' '
368  << *getFunction().getFunctionType() << ": " << Msg << '\n';
369  OS.flush();
370  DP << Str;
371 }
372 
374  DP << "Instruction selection used fallback path for " << getFunction();
375 }
376 
378  Args.emplace_back(S);
379 }
380 
382  Args.push_back(std::move(A));
383 }
384 
386  IsVerbose = true;
387 }
388 
390  FirstExtraArgIndex = Args.size();
391 }
392 
394  std::string Str;
395  raw_string_ostream OS(Str);
397  make_range(Args.begin(), FirstExtraArgIndex == -1
398  ? Args.end()
399  : Args.begin() + FirstExtraArgIndex))
400  OS << Arg.Val;
401  return OS.str();
402 }
403 
405  Twine &Msg)
407  *Inst->getParent()->getParent(),
408  Inst->getDebugLoc()),
409  Msg(Msg) {}
410 
412  DP << getLocationStr() << ": " << getMsg();
413 }
414 
415 void OptimizationRemarkAnalysisFPCommute::anchor() {}
416 void OptimizationRemarkAnalysisAliasing::anchor() {}
417 
419  const auto *F =
420  dyn_cast<Function>(CI.getCalledOperand()->stripPointerCasts());
421 
422  if (!F)
423  return;
424 
425  for (int i = 0; i != 2; ++i) {
426  auto AttrName = i == 0 ? "dontcall-error" : "dontcall-warn";
427  auto Sev = i == 0 ? DS_Error : DS_Warning;
428 
429  if (F->hasFnAttribute(AttrName)) {
430  unsigned LocCookie = 0;
431  auto A = F->getFnAttribute(AttrName);
432  if (MDNode *MD = CI.getMetadata("srcloc"))
433  LocCookie =
434  mdconst::extract<ConstantInt>(MD->getOperand(0))->getZExtValue();
435  DiagnosticInfoDontCall D(F->getName(), A.getValueAsString(), Sev,
436  LocCookie);
437  F->getContext().diagnose(D);
438  }
439  }
440 }
441 
443  DP << "call to " << getFunctionName() << " marked \"dontcall-";
445  DP << "error\"";
446  else
447  DP << "warn\"";
448  if (!getNote().empty())
449  DP << ": " << getNote();
450 }
llvm::DIScope::getFilename
StringRef getFilename() const
Definition: DebugInfoMetadata.h:674
llvm::DK_FirstPluginKind
@ DK_FirstPluginKind
Definition: DiagnosticInfo.h:89
i
i
Definition: README.txt:29
llvm::InstructionCost
Definition: InstructionCost.h:29
llvm::DiagnosticInfoOptimizationBase::Argument::Val
std::string Val
Definition: DiagnosticInfo.h:428
llvm::DiagnosticLocation::DiagnosticLocation
DiagnosticLocation()=default
llvm::DiagnosticInfoOptimizationBase::print
void print(DiagnosticPrinter &DP) const override
Definition: DiagnosticInfo.cpp:241
llvm
This is an optimization pass for GlobalISel generic memory operations.
Definition: AddressRanges.h:18
llvm::make_range
iterator_range< T > make_range(T x, T y)
Convenience function for iterating over sub-ranges.
Definition: iterator_range.h:53
llvm::DiagnosticInfoIgnoringInvalidDebugMetadata::print
void print(DiagnosticPrinter &DP) const override
Definition: DiagnosticInfo.cpp:86
llvm::DiagnosticInfoDebugMetadataVersion::getModule
const Module & getModule() const
Definition: DiagnosticInfo.h:201
Metadata.h
llvm::ElementCount
Definition: TypeSize.h:279
DebugInfoMetadata.h
llvm::DiagnosticInfoSampleProfile::getFileName
StringRef getFileName() const
Definition: DiagnosticInfo.h:257
llvm::DiagnosticInfoOptimizationBase::Argument::Loc
DiagnosticLocation Loc
Definition: DiagnosticInfo.h:430
llvm::GlobalValue::dropLLVMManglingEscape
static StringRef dropLLVMManglingEscape(StringRef Name)
If the given string begins with the GlobalValue name mangling escape character '\1',...
Definition: GlobalValue.h:562
T
llvm::DiagnosticHandler::isMissedOptRemarkEnabled
virtual bool isMissedOptRemarkEnabled(StringRef PassName) const
Return true if missed optimization remarks are enabled, override to provide different implementation.
Definition: DiagnosticHandler.cpp:75
llvm::Function
Definition: Function.h:59
llvm::raw_string_ostream
A raw_ostream that writes to an std::string.
Definition: raw_ostream.h:642
llvm::DiagnosticInfoWithLocationBase::getLocation
DiagnosticLocation getLocation() const
Definition: DiagnosticInfo.h:346
llvm::sys::path::remove_leading_dotslash
StringRef remove_leading_dotslash(StringRef path, Style style=Style::native)
Remove redundant leading "./" pieces and consecutive separators.
Definition: Path.cpp:703
Path.h
llvm::DiagnosticInfoOptimizationBase::PassName
const char * PassName
Name of the pass that triggers this report.
Definition: DiagnosticInfo.h:515
llvm::DiagnosticInfoOptimizationBase::insert
void insert(StringRef S)
Definition: DiagnosticInfo.cpp:377
llvm::sys::path::is_absolute
bool is_absolute(const Twine &path, Style style=Style::native)
Is path absolute?
Definition: Path.cpp:671
llvm::DiagnosticInfoOptimizationBase::getPassName
StringRef getPassName() const
Definition: DiagnosticInfo.h:479
ErrorHandling.h
llvm::DiagnosticInfoPGOProfile::getMsg
const Twine & getMsg() const
Definition: DiagnosticInfo.h:288
llvm::DiagnosticInfoInlineAsm::getLocCookie
uint64_t getLocCookie() const
Definition: DiagnosticInfo.h:172
llvm::DiagnosticInfoSampleProfile::print
void print(DiagnosticPrinter &DP) const override
Definition: DiagnosticInfo.cpp:91
llvm::DiagnosticInfoOptimizationBase::Argument::Argument
Argument(StringRef Str="")
Definition: DiagnosticInfo.h:432
llvm::DiagnosticInfoResourceLimit::getResourceName
const char * getResourceName() const
Definition: DiagnosticInfo.h:381
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:279
llvm::Function::getContext
LLVMContext & getContext() const
getContext - Return a reference to the LLVMContext associated with this function.
Definition: Function.cpp:315
llvm::DiagnosticInfoUnsupported::print
void print(DiagnosticPrinter &DP) const override
Print using the given DP a user-friendly message.
Definition: DiagnosticInfo.cpp:363
llvm::Type
The instances of the Type class are immutable: once they are created, they are never changed.
Definition: Type.h:45
Module.h
llvm::diagnoseDontCall
void diagnoseDontCall(const CallInst &CI)
Definition: DiagnosticInfo.cpp:418
llvm::DiagnosticInfoOptimizationBase::RemarkName
StringRef RemarkName
Textual identifier for the remark (single-word, camel-case).
Definition: DiagnosticInfo.h:520
llvm::DiagnosticInfoISelFallback::print
void print(DiagnosticPrinter &DP) const override
Print using the given DP a user-friendly message.
Definition: DiagnosticInfo.cpp:373
llvm::DiagnosticInfoResourceLimit::print
void print(DiagnosticPrinter &DP) const override
Definition: DiagnosticInfo.cpp:75
llvm::DiagnosticInfoIROptimization
Common features for diagnostics dealing with optimization remarks that are used by IR passes.
Definition: DiagnosticInfo.h:622
llvm::DiagnosticInfoInlineAsm::DiagnosticInfoInlineAsm
DiagnosticInfoInlineAsm(const Twine &MsgStr, DiagnosticSeverity Severity=DS_Error)
MsgStr is the message to be reported to the frontend.
Definition: DiagnosticInfo.h:151
llvm::DiagnosticInfoMisExpect::DiagnosticInfoMisExpect
DiagnosticInfoMisExpect(const Instruction *Inst, Twine &Msg)
Definition: DiagnosticInfo.cpp:404
llvm::DiagnosticKind
DiagnosticKind
Defines the different supported kind of a diagnostic.
Definition: DiagnosticInfo.h:60
F
#define F(x, y, z)
Definition: MD5.cpp:55
llvm::BasicBlock
LLVM Basic Block Representation.
Definition: BasicBlock.h:55
llvm::sys::path::append
void append(SmallVectorImpl< char > &path, const Twine &a, const Twine &b="", const Twine &c="", const Twine &d="")
Append to path.
Definition: Path.cpp:456
Arg
amdgpu Simplify well known AMD library false FunctionCallee Value * Arg
Definition: AMDGPULibCalls.cpp:187
llvm::DiagnosticLocation::getRelativePath
StringRef getRelativePath() const
Return the file name relative to the compilation directory.
Definition: DiagnosticInfo.cpp:129
Instruction.h
llvm::cast
decltype(auto) cast(const From &Val)
cast<X> - Return the argument parameter cast to the specified type.
Definition: Casting.h:566
llvm::OptimizationRemark::isEnabled
bool isEnabled() const override
Definition: DiagnosticInfo.cpp:273
llvm::DiagnosticInfoPGOProfile::print
void print(DiagnosticPrinter &DP) const override
Definition: DiagnosticInfo.cpp:101
GlobalValue.h
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:307
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.cpp:68
Constants.h
llvm::DS_Warning
@ DS_Warning
Definition: DiagnosticInfo.h:51
llvm::DiagnosticInfoMIRParser::print
void print(DiagnosticPrinter &DP) const override
Print using the given DP a user-friendly message.
Definition: DiagnosticInfo.cpp:343
C
(vector float) vec_cmpeq(*A, *B) C
Definition: README_ALTIVEC.txt:86
Twine.h
llvm::DiagnosticInfoSampleProfile::getLineNum
unsigned getLineNum() const
Definition: DiagnosticInfo.h:258
llvm::AMDGPU::PALMD::Key
Key
PAL metadata keys.
Definition: AMDGPUMetadata.h:486
llvm::DiagnosticInfoWithLocationBase::getFunction
const Function & getFunction() const
Definition: DiagnosticInfo.h:345
llvm::DK_OptimizationRemarkAnalysis
@ DK_OptimizationRemarkAnalysis
Definition: DiagnosticInfo.h:72
llvm::Instruction
Definition: Instruction.h:41
llvm::DiagnosticSeverity
DiagnosticSeverity
Defines the different supported severity of a diagnostic.
Definition: DiagnosticInfo.h:49
llvm::raw_ostream::flush
void flush()
Definition: raw_ostream.h:185
llvm::DiagnosticInfoOptimizationFailure::isEnabled
bool isEnabled() const override
Definition: DiagnosticInfo.cpp:358
llvm::DK_OptimizationRemarkMissed
@ DK_OptimizationRemarkMissed
Definition: DiagnosticInfo.h:71
llvm::DiagnosticInfo::getSeverity
DiagnosticSeverity getSeverity() const
Definition: DiagnosticInfo.h:123
llvm::DiagnosticInfo
This is the base abstract class for diagnostic reporting in the backend.
Definition: DiagnosticInfo.h:108
llvm::DiagnosticInfoDontCall::getFunctionName
StringRef getFunctionName() const
Definition: DiagnosticInfo.h:1111
llvm::DiagnosticPrinter
Interface for custom diagnostic printing.
Definition: DiagnosticPrinter.h:31
llvm::OptimizationRemarkMissed::isEnabled
bool isEnabled() const override
Definition: DiagnosticInfo.cpp:301
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:247
Type.h
llvm::Instruction::getMetadata
MDNode * getMetadata(unsigned KindID) const
Get the metadata of given kind attached to this Instruction.
Definition: Instruction.h:275
llvm::SmallString< 128 >
llvm::DiagnosticInfoOptimizationBase::Args
SmallVector< Argument, 4 > Args
Arguments collected via the streaming interface.
Definition: DiagnosticInfo.h:527
llvm::StringRef::empty
constexpr bool empty() const
empty - Check if the string is empty.
Definition: StringRef.h:134
llvm::LLVMContext::getDiagHandlerPtr
const DiagnosticHandler * getDiagHandlerPtr() const
getDiagHandlerPtr - Returns const raw pointer of DiagnosticHandler set by setDiagnosticHandler.
Definition: LLVMContext.cpp:363
llvm::DK_InlineAsm
@ DK_InlineAsm
Definition: DiagnosticInfo.h:61
BasicBlock.h
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:155
llvm::DiagnosticInfoOptimizationBase::Argument
Used in the streaming interface as the general argument type.
Definition: DiagnosticInfo.h:426
llvm::DiagnosticInfoWithLocationBase::isLocationAvailable
bool isLocationAvailable() const
Return true if location information is available for this diagnostic.
Definition: DiagnosticInfo.h:330
llvm::DiagnosticInfoPGOProfile::getFileName
const char * getFileName() const
Definition: DiagnosticInfo.h:287
uint64_t
D
static GCRegistry::Add< StatepointGC > D("statepoint-example", "an example strategy for statepoint")
llvm::DiagnosticInfoResourceLimit::getFunction
const Function & getFunction() const
Definition: DiagnosticInfo.h:380
llvm::DS_Remark
@ DS_Remark
Definition: DiagnosticInfo.h:52
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::DiagnosticInfoWithLocationBase::getAbsolutePath
std::string getAbsolutePath() const
Return the absolute path tot the file.
Definition: DiagnosticInfo.cpp:143
llvm::LLVMContext
This is an important class for using LLVM in a threaded context.
Definition: LLVMContext.h:67
I
#define I(x, y, z)
Definition: MD5.cpp:58
StringExtras.h
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:535
getSubprogram
static DISubprogram * getSubprogram(bool IsDistinct, Ts &&...Args)
Definition: DIBuilder.cpp:842
llvm::DiagnosticInfoResourceLimit::getResourceSize
uint64_t getResourceSize() const
Definition: DiagnosticInfo.h:382
llvm::Module::getModuleIdentifier
const std::string & getModuleIdentifier() const
Get the module identifier which is, essentially, the name of the module.
Definition: Module.h:228
iterator_range.h
llvm::DiagnosticInfoOptimizationBase::setExtraArgs
When an instance of this is inserted into the stream, the arguments following will not appear in the ...
Definition: DiagnosticInfo.h:422
llvm::MDNode
Metadata node.
Definition: Metadata.h:943
llvm::DiagnosticInfoDebugMetadataVersion::getMetadataVersion
unsigned getMetadataVersion() const
Definition: DiagnosticInfo.h:202
llvm::Value::printAsOperand
void printAsOperand(raw_ostream &O, bool PrintType=true, const Module *M=nullptr) const
Print the name of this Value out to the specified raw_ostream.
Definition: AsmWriter.cpp:4778
InstructionCost.h
getDebugLoc
static DebugLoc getDebugLoc(MachineBasicBlock::instr_iterator FirstMI, MachineBasicBlock::instr_iterator LastMI)
Return the first found DebugLoc that has a DILocation, given a range of instructions.
Definition: MachineInstrBundle.cpp:110
llvm::StringRef
StringRef - Represent a constant reference to a string, i.e.
Definition: StringRef.h:50
llvm::DK_OptimizationFailure
@ DK_OptimizationFailure
Definition: DiagnosticInfo.h:75
DP
So we should use XX3Form_Rcr to implement intrinsic 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::DiagnosticLocation
Definition: DiagnosticInfo.h:298
getParent
static const Function * getParent(const Value *V)
Definition: BasicAliasAnalysis.cpp:806
DL
MachineBasicBlock MachineBasicBlock::iterator DebugLoc DL
Definition: AArch64SLSHardening.cpp:76
llvm::DiagnosticHandler::isAnalysisRemarkEnabled
virtual bool isAnalysisRemarkEnabled(StringRef PassName) const
Return true if analysis remarks are enabled, override to provide different implementation.
Definition: DiagnosticHandler.cpp:71
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:62
llvm::DiagnosticInfoDebugMetadataVersion::print
void print(DiagnosticPrinter &DP) const override
Definition: DiagnosticInfo.cpp:81
llvm::DIScope::getDirectory
StringRef getDirectory() const
Definition: DebugInfoMetadata.h:680
llvm::DiagnosticInfoDontCall::print
void print(DiagnosticPrinter &DP) const override
Print using the given DP a user-friendly message.
Definition: DiagnosticInfo.cpp:442
llvm::DiagnosticInfoISelFallback::getFunction
const Function & getFunction() const
Definition: DiagnosticInfo.h:963
llvm::Value::getName
StringRef getName() const
Return a constant reference to the value's name.
Definition: Value.cpp:308
llvm::Value::stripPointerCasts
const Value * stripPointerCasts() const
Strip off pointer casts, all-zero GEPs and address space casts.
Definition: Value.cpp:685
llvm::DiagnosticHandler::isPassedOptRemarkEnabled
virtual bool isPassedOptRemarkEnabled(StringRef PassName) const
Return true if passed optimization remarks are enabled, override to provide different implementation.
Definition: DiagnosticHandler.cpp:79
llvm::AMDGPU::SendMsg::Msg
const CustomOperand< const MCSubtargetInfo & > Msg[]
Definition: AMDGPUAsmUtils.cpp:39
llvm::OptimizationRemarkAnalysis::shouldAlwaysPrint
bool shouldAlwaysPrint() const
Definition: DiagnosticInfo.h:822
getFirstFunctionBlock
static const BasicBlock * getFirstFunctionBlock(const Function *Func)
Definition: DiagnosticInfo.cpp:262
llvm::DiagnosticInfoMisExpect::getMsg
const Twine & getMsg() const
Definition: DiagnosticInfo.h:1047
llvm::Twine
Twine - A lightweight data structure for efficiently representing the concatenation of temporary valu...
Definition: Twine.h:81
std
Definition: BitVector.h:851
llvm::DiagnosticInfoOptimizationBase::getMsg
std::string getMsg() const
Definition: DiagnosticInfo.cpp:393
llvm::DiagnosticInfoDontCall
Definition: DiagnosticInfo.h:1101
Casting.h
llvm::DiagnosticInfoDontCall::getNote
StringRef getNote() const
Definition: DiagnosticInfo.h:1112
DiagnosticInfo.h
Function.h
llvm::DK_OptimizationRemark
@ DK_OptimizationRemark
Definition: DiagnosticInfo.h:70
llvm::Function::getFunctionType
FunctionType * getFunctionType() const
Returns the FunctionType for me.
Definition: Function.h:174
llvm::OptimizationRemarkAnalysis::AlwaysPrint
static const char * AlwaysPrint
Definition: DiagnosticInfo.h:820
llvm::DK_MisExpect
@ DK_MisExpect
Definition: DiagnosticInfo.h:88
llvm::CallBase::getCalledOperand
Value * getCalledOperand() const
Definition: InstrTypes.h:1399
llvm::DiagnosticInfoIgnoringInvalidDebugMetadata::getModule
const Module & getModule() const
Definition: DiagnosticInfo.h:224
Instructions.h
llvm::DiagnosticInfoOptimizationBase::Hotness
std::optional< uint64_t > Hotness
If profile information is available, this is the number of times the corresponding code was executed ...
Definition: DiagnosticInfo.h:524
N
#define N
llvm::DiagnosticLocation::getAbsolutePath
std::string getAbsolutePath() const
Return the full path to the file.
Definition: DiagnosticInfo.cpp:133
llvm::getNextAvailablePluginDiagnosticKind
int getNextAvailablePluginDiagnosticKind()
Get the next available kind ID for a plugin diagnostic.
Definition: DiagnosticInfo.cpp:43
llvm::to_string
std::string to_string(const T &Value)
Definition: ScopedPrinter.h:85
llvm::DiagnosticInfoWithLocationBase
Common features for diagnostics with an associated location.
Definition: DiagnosticInfo.h:318
llvm::DISubprogram
Subprogram description.
Definition: DebugInfoMetadata.h:1851
llvm::DiagnosticLocation::getColumn
unsigned getColumn() const
Definition: DiagnosticInfo.h:314
DerivedTypes.h
llvm::StringRef::str
std::string str() const
str - Get the contents as an std::string.
Definition: StringRef.h:222
llvm::DiagnosticInfoInlineAsm::getMsgStr
const Twine & getMsgStr() const
Definition: DiagnosticInfo.h:173
llvm::CallInst
This class represents a function call, abstracting a target machine's calling convention.
Definition: Instructions.h:1485
llvm::DiagnosticInfoOptimizationBase::IsVerbose
bool IsVerbose
The remark is expected to be noisy.
Definition: DiagnosticInfo.h:530
llvm::DiagnosticInfoSampleProfile::getMsg
const Twine & getMsg() const
Definition: DiagnosticInfo.h:259
LLVMContext.h
llvm::DebugLoc
A debug info location.
Definition: DebugLoc.h:33
raw_ostream.h
llvm::DiagnosticInfoSrcMgr::print
void print(DiagnosticPrinter &DP) const override
Print using the given DP a user-friendly message.
Definition: DiagnosticInfo.cpp:347
llvm::DiagnosticInfoMisExpect::print
void print(DiagnosticPrinter &DP) const override
Definition: DiagnosticInfo.cpp:411
DiagnosticPrinter.h
llvm::DiagnosticInfoResourceLimit::getResourceLimit
uint64_t getResourceLimit() const
Definition: DiagnosticInfo.h:383
Value.h
llvm::raw_string_ostream::str
std::string & str()
Returns the string's reference.
Definition: raw_ostream.h:660
llvm::OptimizationRemarkAnalysis::isEnabled
bool isEnabled() const override
Definition: DiagnosticInfo.cpp:336
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:984
llvm::Value
LLVM Value Representation.
Definition: Value.h:74
llvm::DS_Error
@ DS_Error
Definition: DiagnosticInfo.h:50
PassName
static const char PassName[]
Definition: X86LowerAMXIntrinsics.cpp:671
llvm::DiagnosticInfoOptimizationBase::setIsVerbose
Used to set IsVerbose via the stream interface.
Definition: DiagnosticInfo.h:416
llvm::DiagnosticLocation::getLine
unsigned getLine() const
Definition: DiagnosticInfo.h:313
llvm::DIScope::getFile
DIFile * getFile() const
Definition: DebugInfoMetadata.h:516
SpecialSubKind::string
@ string
ScopedPrinter.h