LLVM  16.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  DP << getResourceName() << " (" << getResourceSize() << ") exceeds limit ("
70  << getResourceLimit() << ") in function '" << getFunction() << '\'';
71 }
72 
74  DP << "ignoring debug info with an invalid version (" << getMetadataVersion()
75  << ") in " << getModule();
76 }
77 
79  DiagnosticPrinter &DP) const {
80  DP << "ignoring invalid debug info in " << getModule().getModuleIdentifier();
81 }
82 
84  if (!FileName.empty()) {
85  DP << getFileName();
86  if (LineNum > 0)
87  DP << ":" << getLineNum();
88  DP << ": ";
89  }
90  DP << getMsg();
91 }
92 
94  if (getFileName())
95  DP << getFileName() << ": ";
96  DP << getMsg();
97 }
98 
99 void DiagnosticInfo::anchor() {}
100 void DiagnosticInfoStackSize::anchor() {}
101 void DiagnosticInfoWithLocationBase::anchor() {}
102 void DiagnosticInfoIROptimization::anchor() {}
103 
105  if (!DL)
106  return;
107  File = DL->getFile();
108  Line = DL->getLine();
109  Column = DL->getColumn();
110 }
111 
113  if (!SP)
114  return;
115 
116  File = SP->getFile();
117  Line = SP->getScopeLine();
118  Column = 0;
119 }
120 
122  return File->getFilename();
123 }
124 
126  StringRef Name = File->getFilename();
128  return std::string(Name);
129 
130  SmallString<128> Path;
131  sys::path::append(Path, File->getDirectory(), Name);
133 }
134 
136  return Loc.getAbsolutePath();
137 }
138 
140  unsigned &Line,
141  unsigned &Column) const {
142  RelativePath = Loc.getRelativePath();
143  Line = Loc.getLine();
144  Column = Loc.getColumn();
145 }
146 
148  StringRef Filename("<unknown>");
149  unsigned Line = 0;
150  unsigned Column = 0;
151  if (isLocationAvailable())
152  getLocation(Filename, Line, Column);
153  return (Filename + ":" + Twine(Line) + ":" + Twine(Column)).str();
154 }
155 
157  const Value *V)
158  : Key(std::string(Key)) {
159  if (auto *F = dyn_cast<Function>(V)) {
160  if (DISubprogram *SP = F->getSubprogram())
161  Loc = SP;
162  }
163  else if (auto *I = dyn_cast<Instruction>(V))
164  Loc = I->getDebugLoc();
165 
166  // Only include names that correspond to user variables. FIXME: We should use
167  // debug info if available to get the name of the user variable.
168  if (isa<llvm::Argument>(V) || isa<GlobalValue>(V))
169  Val = std::string(GlobalValue::dropLLVMManglingEscape(V->getName()));
170  else if (isa<Constant>(V)) {
172  V->printAsOperand(OS, /*PrintType=*/false);
173  } else if (auto *I = dyn_cast<Instruction>(V))
174  Val = I->getOpcodeName();
175 }
176 
178  : Key(std::string(Key)) {
180  OS << *T;
181 }
182 
184  : Key(std::string(Key)), Val(S.str()) {}
185 
187  : Key(std::string(Key)), Val(itostr(N)) {}
188 
190  : Key(std::string(Key)), Val(llvm::to_string(N)) {}
191 
193  : Key(std::string(Key)), Val(itostr(N)) {}
194 
196  : Key(std::string(Key)), Val(itostr(N)) {}
197 
199  : Key(std::string(Key)), Val(utostr(N)) {}
200 
202  unsigned long N)
203  : Key(std::string(Key)), Val(utostr(N)) {}
204 
206  unsigned long long N)
207  : Key(std::string(Key)), Val(utostr(N)) {}
208 
210  ElementCount EC)
211  : Key(std::string(Key)) {
213  EC.print(OS);
214 }
215 
218  : Key(std::string(Key)) {
220  C.print(OS);
221 }
222 
224  : Key(std::string(Key)), Loc(Loc) {
225  if (Loc) {
226  Val = (Loc->getFilename() + ":" + Twine(Loc.getLine()) + ":" +
227  Twine(Loc.getCol())).str();
228  } else {
229  Val = "<UNKNOWN LOCATION>";
230  }
231 }
232 
234  DP << getLocationStr() << ": " << getMsg();
235  if (Hotness)
236  DP << " (hotness: " << *Hotness << ")";
237 }
238 
241  const DiagnosticLocation &Loc,
242  const Value *CodeRegion)
245  *cast<BasicBlock>(CodeRegion)->getParent(), Loc, CodeRegion) {}
246 
248  StringRef RemarkName,
249  const Instruction *Inst)
251  RemarkName, *Inst->getParent()->getParent(),
252  Inst->getDebugLoc(), Inst->getParent()) {}
253 
254 static const BasicBlock *getFirstFunctionBlock(const Function *Func) {
255  return Func->empty() ? nullptr : &Func->front();
256 }
257 
259  StringRef RemarkName,
260  const Function *Func)
262  RemarkName, *Func, Func->getSubprogram(),
263  getFirstFunctionBlock(Func)) {}
264 
266  const Function &Fn = getFunction();
267  LLVMContext &Ctx = Fn.getContext();
269 }
270 
272  const char *PassName, StringRef RemarkName, const DiagnosticLocation &Loc,
273  const Value *CodeRegion)
276  *cast<BasicBlock>(CodeRegion)->getParent(), Loc, CodeRegion) {}
277 
279  StringRef RemarkName,
280  const Instruction *Inst)
282  PassName, RemarkName,
283  *Inst->getParent()->getParent(),
284  Inst->getDebugLoc(), Inst->getParent()) {}
285 
287  StringRef RemarkName,
288  const Function *Func)
290  DK_OptimizationRemarkMissed, DS_Remark, PassName, RemarkName, *Func,
291  Func->getSubprogram(), getFirstFunctionBlock(Func)) {}
292 
294  const Function &Fn = getFunction();
295  LLVMContext &Ctx = Fn.getContext();
297 }
298 
300  const char *PassName, StringRef RemarkName, const DiagnosticLocation &Loc,
301  const Value *CodeRegion)
304  *cast<BasicBlock>(CodeRegion)->getParent(), Loc, CodeRegion) {}
305 
307  StringRef RemarkName,
308  const Instruction *Inst)
310  PassName, RemarkName,
311  *Inst->getParent()->getParent(),
312  Inst->getDebugLoc(), Inst->getParent()) {}
313 
315  enum DiagnosticKind Kind, const char *PassName, StringRef RemarkName,
316  const DiagnosticLocation &Loc, const Value *CodeRegion)
318  *cast<BasicBlock>(CodeRegion)->getParent(),
319  Loc, CodeRegion) {}
320 
322  StringRef RemarkName,
323  const Function *Func)
325  DK_OptimizationRemarkAnalysis, DS_Remark, PassName, RemarkName, *Func,
326  Func->getSubprogram(), getFirstFunctionBlock(Func)) {}
327 
329  const Function &Fn = getFunction();
330  LLVMContext &Ctx = Fn.getContext();
333 }
334 
336  DP << Diagnostic;
337 }
338 
340  DP << Diagnostic;
341 }
342 
344  const char *PassName, StringRef RemarkName, const DiagnosticLocation &Loc,
345  const Value *CodeRegion)
348  *cast<BasicBlock>(CodeRegion)->getParent(), Loc, CodeRegion) {}
349 
351  // Only print warnings.
352  return getSeverity() == DS_Warning;
353 }
354 
356  std::string Str;
357  raw_string_ostream OS(Str);
358 
359  OS << getLocationStr() << ": in function " << getFunction().getName() << ' '
360  << *getFunction().getFunctionType() << ": " << Msg << '\n';
361  OS.flush();
362  DP << Str;
363 }
364 
366  DP << "Instruction selection used fallback path for " << getFunction();
367 }
368 
370  Args.emplace_back(S);
371 }
372 
374  Args.push_back(std::move(A));
375 }
376 
378  IsVerbose = true;
379 }
380 
382  FirstExtraArgIndex = Args.size();
383 }
384 
386  std::string Str;
387  raw_string_ostream OS(Str);
389  make_range(Args.begin(), FirstExtraArgIndex == -1
390  ? Args.end()
391  : Args.begin() + FirstExtraArgIndex))
392  OS << Arg.Val;
393  return OS.str();
394 }
395 
397  Twine &Msg)
399  *Inst->getParent()->getParent(),
400  Inst->getDebugLoc()),
401  Msg(Msg) {}
402 
404  DP << getLocationStr() << ": " << getMsg();
405 }
406 
407 void OptimizationRemarkAnalysisFPCommute::anchor() {}
408 void OptimizationRemarkAnalysisAliasing::anchor() {}
409 
411  auto *F = CI.getCalledFunction();
412  if (!F)
413  return;
414 
415  for (int i = 0; i != 2; ++i) {
416  auto AttrName = i == 0 ? "dontcall-error" : "dontcall-warn";
417  auto Sev = i == 0 ? DS_Error : DS_Warning;
418 
419  if (F->hasFnAttribute(AttrName)) {
420  unsigned LocCookie = 0;
421  auto A = F->getFnAttribute(AttrName);
422  if (MDNode *MD = CI.getMetadata("srcloc"))
423  LocCookie =
424  mdconst::extract<ConstantInt>(MD->getOperand(0))->getZExtValue();
425  DiagnosticInfoDontCall D(F->getName(), A.getValueAsString(), Sev,
426  LocCookie);
427  F->getContext().diagnose(D);
428  }
429  }
430 }
431 
433  DP << "call to " << getFunctionName() << " marked \"dontcall-";
435  DP << "error\"";
436  else
437  DP << "warn\"";
438  if (!getNote().empty())
439  DP << ": " << getNote();
440 }
llvm::DIScope::getFilename
StringRef getFilename() const
Definition: DebugInfoMetadata.h:635
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:429
llvm::DiagnosticLocation::DiagnosticLocation
DiagnosticLocation()=default
llvm::DiagnosticInfoOptimizationBase::print
void print(DiagnosticPrinter &DP) const override
Definition: DiagnosticInfo.cpp:233
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:78
llvm::DiagnosticInfoDebugMetadataVersion::getModule
const Module & getModule() const
Definition: DiagnosticInfo.h:257
Metadata.h
llvm::ElementCount
Definition: TypeSize.h:404
DebugInfoMetadata.h
llvm::DiagnosticInfoSampleProfile::getFileName
StringRef getFileName() const
Definition: DiagnosticInfo.h:313
llvm::DiagnosticInfoOptimizationBase::Argument::Loc
DiagnosticLocation Loc
Definition: DiagnosticInfo.h:431
llvm::GlobalValue::dropLLVMManglingEscape
static StringRef dropLLVMManglingEscape(StringRef Name)
If the given string begins with the GlobalValue name mangling escape character '\1',...
Definition: GlobalValue.h:554
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:60
llvm::raw_string_ostream
A raw_ostream that writes to an std::string.
Definition: raw_ostream.h:628
llvm::DiagnosticInfoWithLocationBase::getLocation
DiagnosticLocation getLocation() const
Definition: DiagnosticInfo.h:402
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:516
llvm::DiagnosticInfoOptimizationBase::insert
void insert(StringRef S)
Definition: DiagnosticInfo.cpp:369
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:480
ErrorHandling.h
llvm::DiagnosticInfoPGOProfile::getMsg
const Twine & getMsg() const
Definition: DiagnosticInfo.h:344
llvm::DiagnosticInfoInlineAsm::getLocCookie
uint64_t getLocCookie() const
Definition: DiagnosticInfo.h:172
llvm::DiagnosticInfoSampleProfile::print
void print(DiagnosticPrinter &DP) const override
Definition: DiagnosticInfo.cpp:83
llvm::DiagnosticInfoOptimizationBase::Argument::Argument
Argument(StringRef Str="")
Definition: DiagnosticInfo.h:433
llvm::DiagnosticInfoResourceLimit::getResourceName
const char * getResourceName() const
Definition: DiagnosticInfo.h:211
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:271
llvm::Function::getContext
LLVMContext & getContext() const
getContext - Return a reference to the LLVMContext associated with this function.
Definition: Function.cpp:320
llvm::DiagnosticInfoUnsupported::print
void print(DiagnosticPrinter &DP) const override
Print using the given DP a user-friendly message.
Definition: DiagnosticInfo.cpp:355
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:410
llvm::DiagnosticInfoOptimizationBase::RemarkName
StringRef RemarkName
Textual identifier for the remark (single-word, camel-case).
Definition: DiagnosticInfo.h:521
llvm::DiagnosticInfoISelFallback::print
void print(DiagnosticPrinter &DP) const override
Print using the given DP a user-friendly message.
Definition: DiagnosticInfo.cpp:365
llvm::DiagnosticInfoResourceLimit::print
void print(DiagnosticPrinter &DP) const override
Definition: DiagnosticInfo.cpp:68
llvm::DiagnosticInfoIROptimization
Common features for diagnostics dealing with optimization remarks that are used by IR passes.
Definition: DiagnosticInfo.h:623
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:396
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:186
llvm::DiagnosticLocation::getRelativePath
StringRef getRelativePath() const
Return the file name relative to the compilation directory.
Definition: DiagnosticInfo.cpp:121
Instruction.h
llvm::cast
decltype(auto) cast(const From &Val)
cast<X> - Return the argument parameter cast to the specified type.
Definition: Casting.h:565
llvm::OptimizationRemark::isEnabled
bool isEnabled() const override
Definition: DiagnosticInfo.cpp:265
llvm::DiagnosticInfoPGOProfile::print
void print(DiagnosticPrinter &DP) const override
Definition: DiagnosticInfo.cpp:93
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:299
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:335
C
(vector float) vec_cmpeq(*A, *B) C
Definition: README_ALTIVEC.txt:86
Twine.h
llvm::CallBase::getCalledFunction
Function * getCalledFunction() const
Returns the function called, or null if this is an indirect function invocation or the function signa...
Definition: InstrTypes.h:1396
llvm::DiagnosticInfoSampleProfile::getLineNum
unsigned getLineNum() const
Definition: DiagnosticInfo.h:314
llvm::AMDGPU::PALMD::Key
Key
PAL metadata keys.
Definition: AMDGPUMetadata.h:486
llvm::DiagnosticInfoWithLocationBase::getFunction
const Function & getFunction() const
Definition: DiagnosticInfo.h:401
llvm::DK_OptimizationRemarkAnalysis
@ DK_OptimizationRemarkAnalysis
Definition: DiagnosticInfo.h:72
llvm::Instruction
Definition: Instruction.h:42
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:350
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:1112
llvm::DiagnosticPrinter
Interface for custom diagnostic printing.
Definition: DiagnosticPrinter.h:31
llvm::OptimizationRemarkMissed::isEnabled
bool isEnabled() const override
Definition: DiagnosticInfo.cpp:293
llvm::lltok::Kind
Kind
Definition: LLToken.h:18
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:239
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:525
Type.h
llvm::Instruction::getMetadata
MDNode * getMetadata(unsigned KindID) const
Get the metadata of given kind attached to this Instruction.
Definition: Instruction.h:271
llvm::SmallString< 128 >
llvm::DiagnosticInfoOptimizationBase::Args
SmallVector< Argument, 4 > Args
Arguments collected via the streaming interface.
Definition: DiagnosticInfo.h:528
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:147
llvm::DiagnosticInfoOptimizationBase::Argument
Used in the streaming interface as the general argument type.
Definition: DiagnosticInfo.h:427
llvm::DiagnosticInfoWithLocationBase::isLocationAvailable
bool isLocationAvailable() const
Return true if location information is available for this diagnostic.
Definition: DiagnosticInfo.h:386
llvm::DiagnosticInfoPGOProfile::getFileName
const char * getFileName() const
Definition: DiagnosticInfo.h:343
D
static GCRegistry::Add< StatepointGC > D("statepoint-example", "an example strategy for statepoint")
llvm::DiagnosticInfoResourceLimit::getFunction
const Function & getFunction() const
Definition: DiagnosticInfo.h:210
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:135
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:536
getSubprogram
static DISubprogram * getSubprogram(bool IsDistinct, Ts &&...Args)
Definition: DIBuilder.cpp:838
llvm::DiagnosticInfoResourceLimit::getResourceSize
uint64_t getResourceSize() const
Definition: DiagnosticInfo.h:212
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:423
llvm::MDNode
Metadata node.
Definition: Metadata.h:944
llvm::DiagnosticInfoDebugMetadataVersion::getMetadataVersion
unsigned getMetadataVersion() const
Definition: DiagnosticInfo.h:258
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:4677
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:354
getParent
static const Function * getParent(const Value *V)
Definition: BasicAliasAnalysis.cpp:847
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:73
llvm::DIScope::getDirectory
StringRef getDirectory() const
Definition: DebugInfoMetadata.h:641
llvm::DiagnosticInfoDontCall::print
void print(DiagnosticPrinter &DP) const override
Print using the given DP a user-friendly message.
Definition: DiagnosticInfo.cpp:432
llvm::DiagnosticInfoISelFallback::getFunction
const Function & getFunction() const
Definition: DiagnosticInfo.h:964
llvm::Value::getName
StringRef getName() const
Return a constant reference to the value's name.
Definition: Value.cpp:308
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:823
getFirstFunctionBlock
static const BasicBlock * getFirstFunctionBlock(const Function *Func)
Definition: DiagnosticInfo.cpp:254
llvm::DiagnosticInfoMisExpect::getMsg
const Twine & getMsg() const
Definition: DiagnosticInfo.h:1048
llvm::Twine
Twine - A lightweight data structure for efficiently representing the concatenation of temporary valu...
Definition: Twine.h:81
llvm::empty
constexpr bool empty(const T &RangeOrContainer)
Test whether RangeOrContainer is empty. Similar to C++17 std::empty.
Definition: STLExtras.h:256
llvm::GraphProgram::Name
Name
Definition: GraphWriter.h:50
std
Definition: BitVector.h:851
llvm::DiagnosticInfoOptimizationBase::getMsg
std::string getMsg() const
Definition: DiagnosticInfo.cpp:385
llvm::DiagnosticInfoDontCall
Definition: DiagnosticInfo.h:1102
Casting.h
llvm::DiagnosticInfoDontCall::getNote
StringRef getNote() const
Definition: DiagnosticInfo.h:1113
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:175
llvm::OptimizationRemarkAnalysis::AlwaysPrint
static const char * AlwaysPrint
Definition: DiagnosticInfo.h:821
llvm::DK_MisExpect
@ DK_MisExpect
Definition: DiagnosticInfo.h:88
llvm::DiagnosticInfoIgnoringInvalidDebugMetadata::getModule
const Module & getModule() const
Definition: DiagnosticInfo.h:280
Instructions.h
N
#define N
llvm::DiagnosticLocation::getAbsolutePath
std::string getAbsolutePath() const
Return the full path to the file.
Definition: DiagnosticInfo.cpp:125
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:374
llvm::DISubprogram
Subprogram description.
Definition: DebugInfoMetadata.h:1803
llvm::DiagnosticLocation::getColumn
unsigned getColumn() const
Definition: DiagnosticInfo.h:370
DerivedTypes.h
llvm::StringRef::str
std::string str() const
str - Get the contents as an std::string.
Definition: StringRef.h:221
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:1474
llvm::DiagnosticInfoOptimizationBase::IsVerbose
bool IsVerbose
The remark is expected to be noisy.
Definition: DiagnosticInfo.h:531
llvm::DiagnosticInfoSampleProfile::getMsg
const Twine & getMsg() const
Definition: DiagnosticInfo.h:315
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:339
llvm::DiagnosticInfoMisExpect::print
void print(DiagnosticPrinter &DP) const override
Definition: DiagnosticInfo.cpp:403
DiagnosticPrinter.h
llvm::DiagnosticInfoResourceLimit::getResourceLimit
uint64_t getResourceLimit() const
Definition: DiagnosticInfo.h:213
Value.h
llvm::raw_string_ostream::str
std::string & str()
Returns the string's reference.
Definition: raw_ostream.h:646
llvm::OptimizationRemarkAnalysis::isEnabled
bool isEnabled() const override
Definition: DiagnosticInfo.cpp:328
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:985
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:417
llvm::DiagnosticLocation::getLine
unsigned getLine() const
Definition: DiagnosticInfo.h:369
llvm::DIScope::getFile
DIFile * getFile() const
Definition: DebugInfoMetadata.h:479
SpecialSubKind::string
@ string
ScopedPrinter.h