Go to the documentation of this file.
26 #define DEBUG_TYPE "annotation2metadata"
32 "annotation-remarks"))
35 auto *
Annotations =
M.getGlobalVariable(
"llvm.global.annotations");
37 if (!
C ||
C->getNumOperands() != 1)
40 C = cast<Constant>(
C->getOperand(0));
44 for (
auto &
Op :
C->operands()) {
47 auto *OpC = dyn_cast<ConstantStruct>(&
Op);
48 if (!OpC || OpC->getNumOperands() != 4)
50 auto *StrGEP = dyn_cast<ConstantExpr>(OpC->getOperand(1));
51 if (!StrGEP || StrGEP->getNumOperands() < 2)
53 auto *StrC = dyn_cast<GlobalValue>(StrGEP->getOperand(0));
56 auto *StrData = dyn_cast<ConstantDataSequential>(StrC->getOperand(0));
60 auto *
Bitcast = dyn_cast<ConstantExpr>(OpC->getOperand(0));
63 auto *Fn = dyn_cast<Function>(
Bitcast->getOperand(0));
69 I.addAnnotationMetadata(StrData->getAsCString());
75 struct Annotation2MetadataLegacy :
public ModulePass {
94 "Annotation2Metadata",
false,
false)
99 return new Annotation2MetadataLegacy();
A set of analyses that are preserved following a run of a transformation pass.
This is an optimization pass for GlobalISel generic memory operations.
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
ModulePass class - This class is used to implement unstructured interprocedural optimizations and ana...
@ Bitcast
Perform the operation on a different, but equivalently sized type.
void initializeAnnotation2MetadataLegacyPass(PassRegistry &)
Annotations lets you mark points and ranges inside source code, for tests:
static PassRegistry * getPassRegistry()
getPassRegistry - Access the global registry object, which is automatically initialized at applicatio...
(vector float) vec_cmpeq(*A, *B) C
Represent the analysis usage information of a pass.
unsigned ID
LLVM IR allows to use arbitrary numbers as calling convention identifiers.
#define INITIALIZE_PASS_END(passName, arg, name, cfg, analysis)
inst_range instructions(Function *F)
A Module instance is used to store all the information related to an LLVM module.
void setPreservesAll()
Set by analyses that do not transform their input at all.
static PreservedAnalyses all()
Construct a special preserved set that preserves all passes.
A container for analyses that lazily runs them and caches their results.
ModulePass * createAnnotation2MetadataLegacyPass()