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();
84 if (!FileName.
empty()) {
99 void DiagnosticInfo::anchor() {}
100 void DiagnosticInfoStackSize::anchor() {}
101 void DiagnosticInfoWithLocationBase::anchor() {}
102 void DiagnosticInfoIROptimization::anchor() {}
107 File =
DL->getFile();
108 Line =
DL->getLine();
109 Column =
DL->getColumn();
117 Line = SP->getScopeLine();
128 return std::string(
Name);
141 unsigned &Column)
const {
153 return (Filename +
":" +
Twine(Line) +
":" +
Twine(Column)).str();
159 if (
auto *
F = dyn_cast<Function>(V)) {
163 else if (
auto *
I = dyn_cast<Instruction>(V))
164 Loc =
I->getDebugLoc();
168 if (isa<llvm::Argument>(V) || isa<GlobalValue>(V))
170 else if (isa<Constant>(V)) {
173 }
else if (
auto *
I = dyn_cast<Instruction>(V))
174 Val =
I->getOpcodeName();
206 unsigned long long N)
229 Val =
"<UNKNOWN LOCATION>";
242 const Value *CodeRegion)
255 return Func->empty() ? nullptr : &Func->front();
273 const Value *CodeRegion)
301 const Value *CodeRegion)
345 const Value *CodeRegion)
366 DP <<
"Instruction selection used fallback path for " <<
getFunction();
370 Args.emplace_back(
S);
407 void OptimizationRemarkAnalysisFPCommute::anchor() {}
408 void OptimizationRemarkAnalysisAliasing::anchor() {}
415 for (
int i = 0;
i != 2; ++
i) {
416 auto AttrName =
i == 0 ?
"dontcall-error" :
"dontcall-warn";
419 if (
F->hasFnAttribute(AttrName)) {
420 unsigned LocCookie = 0;
421 auto A =
F->getFnAttribute(AttrName);
424 mdconst::extract<ConstantInt>(MD->getOperand(0))->getZExtValue();
427 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.
decltype(auto) LLVM_NODISCARD cast(const From &Val)
cast<X> - Return the argument parameter cast to the specified type.
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.
void print(DiagnosticPrinter &DP) const override
void print(DiagnosticPrinter &DP) const override
Print using the given DP a user-friendly message.
(vector float) vec_cmpeq(*A, *B) C
Function * getCalledFunction() const
Returns the function called, or null if this is an indirect function invocation or the function signa...
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.
LLVM_NODISCARD std::string str() const
str - Get the contents as an std::string.
Optional< uint64_t > Hotness
If profile information is available, this is the number of times the corresponding code was executed ...
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.
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
constexpr LLVM_NODISCARD bool empty() const
empty - Check if the string is empty.
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.
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...
constexpr bool empty(const T &RangeOrContainer)
Test whether RangeOrContainer is empty. Similar to C++17 std::empty.
std::string getMsg() const
StringRef getNote() const
FunctionType * getFunctionType() const
Returns the FunctionType for me.
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
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.