LLVM
llvm.org › docs › LangRef.html
LLVM Language Reference Manual — LLVM 23.0.0git documentation
May 12, 2026 - LLVM function definitions consist ... a return type, an optional parameter attribute for the return type, a function name, a (possibly empty) argument list ......
LLVM
llvm.org › docs › HowToUseAttributes.html
How To Use Attributes — LLVM 23.0.0git documentation
A function’s attributes are at index AttributeList::FunctionIndex; the return type’s attributes are at index AttributeList::ReturnIndex; and the function’s parameters’ attributes are at indices 1, …, n (where ‘n’ is the number of parameters).
LLVM
llvm.org › doxygen › classllvm_1_1Function.html
LLVM: llvm::Function Class Reference
Referenced by llvm::Attributor::checkForAllCallSites(), createMergedFunction(), createSwitchStatement(), llvm::OpenMPIRBuilder::createTargetInit(), llvm::OpenMPIRBuilder::createTeams(), llvm::OpenMPIRBuilder::emitUserDefinedMapper(), findOrCreatePHIInBlock(), llvm::IRPosition::getArg(), llvm::IRPosition::getAssociatedArgument(), llvm::SITargetLowering::LowerFormalArguments(), lowerFunnelShifts(), populateReductionFunction(), replaceArgumentUses(), replaceCalledFunction(), replaceConstants(), llvm::instrumentor::FunctionIO::setArguments(), unpackFromRegLoc(), unpackFromRegLoc(), and upgradeNVVMIntrinsicCall(). ... Definition at line 749 of file Function.cpp. ... Definition at line 754 of file Function.cpp. Return the attribute list for this Function.
Yossarian.net
blog.yossarian.net › 2021 › 11 › 29 › LLVM-internals-part-4-attributes-and-attribute-groups
LLVM internals, part 4: attributes and attribute groups
November 29, 2021 - The other half of the attributes equation is the PARAMATTR_BLOCK block, which is documented by LLVM as follows: The PARAMATTR_BLOCK block (id 9) contains a table of entries describing the attributes of function parameters. These entries are referenced by 1-based index in the paramattr field of module block FUNCTION records, or within the attr field of function block INST_INVOKE and INST_CALL records. Entries within PARAMATTR_BLOCK are constructed to ensure that each is unique (i.e., no two indices represent equivalent attribute lists).
LLVM
llvm.org › doxygen › classllvm_1_1Attribute.html
LLVM: llvm::Attribute Class Reference
Functions, function parameters, and return types can have attributes to indicate how they should be treated by optimizations and code generation. This class represents one of those attributes. It's light-weight and should be passed around by-value. Definition at line 105 of file Attributes.h. This enumeration lists the attributes that can be associated with parameters, function results, or the function itself.
LLVM
llvm.org › devmtg › 2016-11 › Slides › Finkel-IntrinsicsMetadataAttributes.pdf pdf
Intrinsics, Metadata, and Attributes: The story continues!
We can hoist the load of *c out of this loop! ... You can guess... The 'inaccessible memory' concept allows us to preserve ordering dependencies (i.e. side effects) while · not being overly-conservative about potential pointer aliasing. ... Balance in the Force has been restored! ... ●Clang will add this attribute on some “this return” functions known to return the this pointer.
GitHub
gist.github.com › colematt › b440ba3bd610585d6ce1311f706d10e8
[Adding Attributes to LLVM] #llvm · GitHub
Careful: there's a lot of them! ... Build the entire LLVM project. Complete changes to the Clang Front End. Complete changes to the LLVM Back End. Rebuild the entire LLVM project using your build system (e.g. make all, cmake --build ., etc.) $(CLANG_SRC)/include/clang/Basic/Attr.td Add the new front-end attribute definition. $(CLANG_SRC)/lib/AST/ASTContext.cpp Add your function attribute to ASTContext::DeclMustBeEmitted().
LLVM
releases.llvm.org › 7.0.0 › tools › clang › docs › AttributeReference.html
Attributes in Clang — Clang 7 documentation
This page lists the attributes currently supported by Clang. The declare simd construct can be applied to a function to enable the creation of one or more versions that can process multiple arguments using SIMD instructions from a single invocation in a SIMD loop.
Vu
few.vu.nl › ~lsc300 › LLVM › doxygen › classllvm_1_1Attribute.html
LLVM: llvm::Attribute Class Reference
llvm · Attribute · Public Types ... <Attributes.h> Definition at line 45 of file Attributes.h. This enumeration lists the attributes that can be associated with parameters, function results, or the function itself....
Google Groups
groups.google.com › g › llvm-dev › c › 1ptivB6H6_c › m › XNFPzxRrAAAJ
[llvm-dev] Function attributes for memory side-effects
The Attributor does internally derive more "locations", basically any combination of: local memory constant memory internal global memory external global memory argument memory inaccessible memory malloced memory (returned by a function with the `noalias` return attribute) unknown memory I want to add some/all of these as attributes but didn't find the time yet. ... > > HTH > > > _______________________________________________ > LLVM Developers mailing list > llvm...@lists.llvm.org > https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev
Google Groups
groups.google.com › g › llvm-dev › c › C9TSp3u9MxI › m › XFcLLReF_oYJ
[LLVMdev] Adding function attributes
Any help is much appreciated Code ==== virtual bool runOnModule(Module& m) { Module* module = &m; for (Module::iterator functionIter = module->begin(); functionIter != module->end(); functionIter++) functionIter->addFnAttr(llvm::Attributes::AlwaysInline); return true; } Command line =========== clang -O0 -S -emit-llvm -o test.S test.c && opt -S -mem2reg -load <path to lib> -mypass < test.S > test_opt.S ... Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message ... > I am coding a ModulePass in which I want to add an AlwaysInline attribute to > every function so that they can be later inlined by the -always-inline pass.
LLVM
releases.llvm.org › 9.0.1 › docs › HowToUseAttributes.html
How To Use Attributes — LLVM 9 documentation
A function’s attributes are at index AttributeList::FunctionIndex; the return type’s attributes are at index AttributeList::ReturnIndex; and the function’s parameters’ attributes are at indices 1, …, n (where ‘n’ is the number of parameters).
LLVM
releases.llvm.org › 9.0.0 › tools › clang › docs › AttributeReference.html
Attributes in Clang — Clang 9 documentation
This page lists the attributes currently supported by Clang. The declare simd construct can be applied to a function to enable the creation of one or more versions that can process multiple arguments using SIMD instructions from a single invocation in a SIMD loop.
Carnegie Mellon University
cs.cmu.edu › ~seth › llvm › llvmannotation.html
Adding an annotation that gets to the backend
def YourAttributeDocs : Documentation { let Category = DocCatFunction; let Heading = "Your Heading"; let Content = [{ Clang supports the GNU style ``__attribute__((yourAttribute))`` attribute on functions which can invoked as blah blah. }]; } add attribute to Attributes.td so it can get passed to llvm ... In Attributes.cpp add the code to turn the attribute into a string for the llvm file in getAsString. if (hasAttribute(Attribute::YourAttribute)) return "yourAttribute"; in Verifier.cpp add Attribute::YourAttribute to the list of attributes that are function only attributes in the predicate isFuncOnlyAttr.
LLVM
releases.llvm.org › 10.0.0 › docs › LangRef.html
LLVM Language Reference Manual — LLVM 10 documentation
March 24, 2020 - LLVM function definitions consist of the “define” keyword, an optional linkage type, an optional runtime preemption specifier, an optional visibility style, an optional DLL storage class, an optional calling convention, an optional unnamed_addr attribute, a return type, an optional parameter attribute for the return type, a function name, a (possibly empty) argument list (each with optional parameter attributes), optional function attributes, an optional address space, an optional section, an optional alignment, an optional comdat, an optional garbage collector name, an optional prefix, an optional prologue, an optional personality, an optional list of attached metadata, an opening curly brace, a list of basic blocks, and a closing curly brace.
LLVM
llvm.org › doxygen › Attributes_8h_source.html
LLVM: include/llvm/IR/Attributes.h Source File
Return true if this attribute set belongs to the LLVMContext. ... Remove the specified attributes from this set. ... Return the attribute object. ... AttributeSet is a trivially copyable value type. ... Return the number of attributes in this set. ... Add an argument attribute. ... Functions, ...
LLVM
llvm.org › doxygen › group__LLVMCCoreValueFunctionParameters.html
LLVM: Function Parameters
Definition at line 2734 of file Core.cpp. References I, llvm::unwrap(), and llvm::wrap(). ... Obtain the last parameter to a function.
LLVM
llvm.org › doxygen › Attributes_8cpp_source.html
LLVM: lib/IR/Attributes.cpp Source File
1621 "Misordered Attributes list!"); 1622 assert(llvm::none_of(Attrs, 1623 [](const std::pair<unsigned, AttributeSet> &Pair) { 1624 return !Pair.second.hasAttributes(); 1625 }) && 1626 "Pointless attribute!"); 1627 · 1628 unsigned MaxIndex = Attrs.back().first; 1629 // If the MaxIndex is FunctionIndex and there are other indices in front ·
LLVM
releases.llvm.org › 3.8.1 › docs › LangRef.html
LLVM Language Reference Manual — LLVM 3.8 documentation
July 11, 2016 - LLVM function declarations consist of the “declare” keyword, an optional linkage type, an optional visibility style, an optional DLL storage class, an optional calling convention, an optional unnamed_addr attribute, a return type, an optional parameter attribute for the return type, a function name, a possibly empty list of arguments, an optional alignment, an optional garbage collector name, an optional prefix, and an optional prologue.
Hdoc
docs.hdoc.io › hdoc › llvm-project › rADBA2A8E0906EC47.html
class Function: LLVM/Clang 15.x documentation
Set the attribute list for this Function. ... Set the entry count for this function. Entry count is the number of times this function was executed based on pgo data. \p Imports points to a set of GUIDs that needs to be imported by the function for sample PGO, to enable the same inlines as the profiled optimized binary. ... Set the section prefix for this function. ... Set the attached subprogram. Calls \a setMetadata() with \a LLVMContext...