Go to the documentation of this file.
45 return ++PluginKindID;
54 if (
const MDNode *SrcLoc =
I.getMetadata(
"srcloc")) {
55 if (SrcLoc->getNumOperands() != 0)
57 mdconst::dyn_extract<ConstantInt>(SrcLoc->getOperand(0)))
58 LocCookie = CI->getZExtValue();
72 Fn(Fn), ResourceName(ResourceName), ResourceSize(ResourceSize),
73 ResourceLimit(ResourceLimit) {}
92 if (!FileName.
empty()) {
107 void DiagnosticInfo::anchor() {}
108 void DiagnosticInfoStackSize::anchor() {}
109 void DiagnosticInfoWithLocationBase::anchor() {}
110 void DiagnosticInfoIROptimization::anchor() {}
115 File =
DL->getFile();
116 Line =
DL->getLine();
117 Column =
DL->getColumn();
125 Line = SP->getScopeLine();
136 return std::string(Name);
149 unsigned &Column)
const {
161 return (Filename +
":" +
Twine(Line) +
":" +
Twine(Column)).str();
167 if (
auto *
F = dyn_cast<Function>(V)) {
171 else if (
auto *
I = dyn_cast<Instruction>(V))
172 Loc =
I->getDebugLoc();
176 if (isa<llvm::Argument>(V) || isa<GlobalValue>(V))
178 else if (isa<Constant>(V)) {
181 }
else if (
auto *
I = dyn_cast<Instruction>(V))
182 Val =
I->getOpcodeName();
214 unsigned long long N)
237 Val =
"<UNKNOWN LOCATION>";
250 const Value *CodeRegion)
263 return Func->empty() ? nullptr : &Func->front();
281 const Value *CodeRegion)
309 const Value *CodeRegion)
353 const Value *CodeRegion)
374 DP <<
"Instruction selection used fallback path for " <<
getFunction();
378 Args.emplace_back(
S);
415 void OptimizationRemarkAnalysisFPCommute::anchor() {}
416 void OptimizationRemarkAnalysisAliasing::anchor() {}
425 for (
int i = 0;
i != 2; ++
i) {
426 auto AttrName =
i == 0 ?
"dontcall-error" :
"dontcall-warn";
429 if (
F->hasFnAttribute(AttrName)) {
430 unsigned LocCookie = 0;
431 auto A =
F->getFnAttribute(AttrName);
434 mdconst::extract<ConstantInt>(MD->getOperand(0))->getZExtValue();
437 F->getContext().diagnose(
D);
StringRef getFilename() const
DiagnosticLocation()=default
void print(DiagnosticPrinter &DP) const override
This is an optimization pass for GlobalISel generic memory operations.
iterator_range< T > make_range(T x, T y)
Convenience function for iterating over sub-ranges.
StringRef getFileName() const
static StringRef dropLLVMManglingEscape(StringRef Name)
If the given string begins with the GlobalValue name mangling escape character '\1',...
virtual bool isMissedOptRemarkEnabled(StringRef PassName) const
Return true if missed optimization remarks are enabled, override to provide different implementation.
A raw_ostream that writes to an std::string.
DiagnosticLocation getLocation() const
StringRef remove_leading_dotslash(StringRef path, Style style=Style::native)
Remove redundant leading "./" pieces and consecutive separators.
const char * PassName
Name of the pass that triggers this report.
bool is_absolute(const Twine &path, Style style=Style::native)
Is path absolute?
StringRef getPassName() const
const Twine & getMsg() const
uint64_t getLocCookie() const
void print(DiagnosticPrinter &DP) const override
Argument(StringRef Str="")
const char * getResourceName() const
LLVMContext & getContext() const
getContext - Return a reference to the LLVMContext associated with this function.
void print(DiagnosticPrinter &DP) const override
Print using the given DP a user-friendly message.
The instances of the Type class are immutable: once they are created, they are never changed.
void diagnoseDontCall(const CallInst &CI)
StringRef RemarkName
Textual identifier for the remark (single-word, camel-case).
void print(DiagnosticPrinter &DP) const override
Print using the given DP a user-friendly message.
void print(DiagnosticPrinter &DP) const override
Common features for diagnostics dealing with optimization remarks that are used by IR passes.
DiagnosticInfoInlineAsm(const Twine &MsgStr, DiagnosticSeverity Severity=DS_Error)
MsgStr is the message to be reported to the frontend.
DiagnosticInfoMisExpect(const Instruction *Inst, Twine &Msg)
DiagnosticKind
Defines the different supported kind of a diagnostic.
LLVM Basic Block Representation.
void append(SmallVectorImpl< char > &path, const Twine &a, const Twine &b="", const Twine &c="", const Twine &d="")
Append to path.
amdgpu Simplify well known AMD library false FunctionCallee Value * Arg
StringRef getRelativePath() const
Return the file name relative to the compilation directory.
decltype(auto) cast(const From &Val)
cast<X> - Return the argument parameter cast to the specified type.
void print(DiagnosticPrinter &DP) const override
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.
void print(DiagnosticPrinter &DP) const override
Print using the given DP a user-friendly message.
(vector float) vec_cmpeq(*A, *B) C
unsigned getLineNum() const
const Function & getFunction() const
@ DK_OptimizationRemarkAnalysis
DiagnosticSeverity
Defines the different supported severity of a diagnostic.
bool isEnabled() const override
@ DK_OptimizationRemarkMissed
DiagnosticSeverity getSeverity() const
This is the base abstract class for diagnostic reporting in the backend.
StringRef getFunctionName() const
Interface for custom diagnostic printing.
MDNode * getMetadata(unsigned KindID) const
Get the metadata of given kind attached to this Instruction.
SmallVector< Argument, 4 > Args
Arguments collected via the streaming interface.
constexpr bool empty() const
empty - Check if the string is empty.
const DiagnosticHandler * getDiagHandlerPtr() const
getDiagHandlerPtr - Returns const raw pointer of DiagnosticHandler set by setDiagnosticHandler.
std::string getLocationStr() const
Return a string with the location information for this diagnostic in the format "file:line:col".
Used in the streaming interface as the general argument type.
bool isLocationAvailable() const
Return true if location information is available for this diagnostic.
const char * getFileName() const
static GCRegistry::Add< StatepointGC > D("statepoint-example", "an example strategy for statepoint")
const Function & getFunction() const
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
std::string getAbsolutePath() const
Return the absolute path tot the file.
This is an important class for using LLVM in a threaded context.
int FirstExtraArgIndex
If positive, the index of the first argument that only appear in the optimization records and not in ...
static DISubprogram * getSubprogram(bool IsDistinct, Ts &&...Args)
uint64_t getResourceSize() const
const std::string & getModuleIdentifier() const
Get the module identifier which is, essentially, the name of the module.
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.
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.
StringRef - Represent a constant reference to a string, i.e.
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
static const Function * getParent(const Value *V)
MachineBasicBlock MachineBasicBlock::iterator DebugLoc DL
virtual bool isAnalysisRemarkEnabled(StringRef PassName) const
Return true if analysis remarks are enabled, override to provide different implementation.
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
void print(DiagnosticPrinter &DP) const override
StringRef getDirectory() const
void print(DiagnosticPrinter &DP) const override
Print using the given DP a user-friendly message.
const Function & getFunction() const
StringRef getName() const
Return a constant reference to the value's name.
const Value * stripPointerCasts() const
Strip off pointer casts, all-zero GEPs and address space casts.
virtual bool isPassedOptRemarkEnabled(StringRef PassName) const
Return true if passed optimization remarks are enabled, override to provide different implementation.
const CustomOperand< const MCSubtargetInfo & > Msg[]
static const BasicBlock * getFirstFunctionBlock(const Function *Func)
const Twine & getMsg() const
Twine - A lightweight data structure for efficiently representing the concatenation of temporary valu...
std::string getMsg() const
StringRef getNote() const
FunctionType * getFunctionType() const
Returns the FunctionType for me.
Value * getCalledOperand() const
std::optional< uint64_t > Hotness
If profile information is available, this is the number of times the corresponding code was executed ...
std::string getAbsolutePath() const
Return the full path to the file.
int getNextAvailablePluginDiagnosticKind()
Get the next available kind ID for a plugin diagnostic.
std::string to_string(const T &Value)
Common features for diagnostics with an associated location.
unsigned getColumn() const
std::string str() const
str - Get the contents as an std::string.
const Twine & getMsgStr() const
This class represents a function call, abstracting a target machine's calling convention.
bool IsVerbose
The remark is expected to be noisy.
const Twine & getMsg() const
void print(DiagnosticPrinter &DP) const override
Print using the given DP a user-friendly message.
void print(DiagnosticPrinter &DP) const override
uint64_t getResourceLimit() const
std::string & str()
Returns the string's reference.
DiagnosticInfoOptimizationFailure(const Function &Fn, const DiagnosticLocation &Loc, const Twine &Msg)
Fn is the function where the diagnostic is being emitted.
LLVM Value Representation.
static const char PassName[]
Used to set IsVerbose via the stream interface.