diff options
Diffstat (limited to 'llvm/include/llvm/IR/Attributes.td')
-rw-r--r-- | llvm/include/llvm/IR/Attributes.td | 34 |
1 files changed, 28 insertions, 6 deletions
diff --git a/llvm/include/llvm/IR/Attributes.td b/llvm/include/llvm/IR/Attributes.td index 5d4a5f6743b7f..395f9dbfb1760 100644 --- a/llvm/include/llvm/IR/Attributes.td +++ b/llvm/include/llvm/IR/Attributes.td @@ -7,18 +7,24 @@ class Attr<string S> { /// Enum attribute. class EnumAttr<string S> : Attr<S>; +/// Int attribute. +class IntAttr<string S> : Attr<S>; + /// StringBool attribute. class StrBoolAttr<string S> : Attr<S>; +/// Type attribute. +class TypeAttr<string S> : Attr<S>; + /// Target-independent enum attributes. /// Alignment of parameter (5 bits) stored as log2 of alignment with +1 bias. /// 0 means unaligned (different from align(1)). -def Alignment : EnumAttr<"align">; +def Alignment : IntAttr<"align">; /// The result of the function is guaranteed to point to a number of bytes that /// we can determine if we know the value of the function's arguments. -def AllocSize : EnumAttr<"allocsize">; +def AllocSize : IntAttr<"allocsize">; /// inline=always. def AlwaysInline : EnumAttr<"alwaysinline">; @@ -31,7 +37,10 @@ def ArgMemOnly : EnumAttr<"argmemonly">; def Builtin : EnumAttr<"builtin">; /// Pass structure by value. -def ByVal : EnumAttr<"byval">; +def ByVal : TypeAttr<"byval">; + +/// Parameter or return value may not contain uninitialized or poison bits. +def NoUndef : EnumAttr<"noundef">; /// Marks function as being in a cold path. def Cold : EnumAttr<"cold">; @@ -40,10 +49,10 @@ def Cold : EnumAttr<"cold">; def Convergent : EnumAttr<"convergent">; /// Pointer is known to be dereferenceable. -def Dereferenceable : EnumAttr<"dereferenceable">; +def Dereferenceable : IntAttr<"dereferenceable">; /// Pointer is either null or dereferenceable. -def DereferenceableOrNull : EnumAttr<"dereferenceable_or_null">; +def DereferenceableOrNull : IntAttr<"dereferenceable_or_null">; /// Function may only access memory that is inaccessible from IR. def InaccessibleMemOnly : EnumAttr<"inaccessiblememonly">; @@ -97,6 +106,9 @@ def NoInline : EnumAttr<"noinline">; /// Function is called early and/or often, so lazy binding isn't worthwhile. def NonLazyBind : EnumAttr<"nonlazybind">; +/// Disable merging for call sites +def NoMerge : EnumAttr<"nomerge">; + /// Pointer is known to be not null. def NonNull : EnumAttr<"nonnull">; @@ -118,6 +130,9 @@ def NoCfCheck : EnumAttr<"nocf_check">; /// Function doesn't unwind stack. def NoUnwind : EnumAttr<"nounwind">; +/// Null pointer in address space zero is valid. +def NullPointerIsValid : EnumAttr<"null_pointer_is_valid">; + /// Select optimizations for best fuzzing signal. def OptForFuzzing : EnumAttr<"optforfuzzing">; @@ -127,6 +142,9 @@ def OptimizeForSize : EnumAttr<"optsize">; /// Function must not be optimized. def OptimizeNone : EnumAttr<"optnone">; +/// Similar to byval but without a copy. +def Preallocated : TypeAttr<"preallocated">; + /// Function does not access memory. def ReadNone : EnumAttr<"readnone">; @@ -153,7 +171,7 @@ def SExt : EnumAttr<"signext">; /// Alignment of stack for function (3 bits) stored as log2 of alignment with /// +1 bias 0 means unaligned (different from alignstack=(1)). -def StackAlignment : EnumAttr<"alignstack">; +def StackAlignment : IntAttr<"alignstack">; /// Function can be speculated. def Speculatable : EnumAttr<"speculatable">; @@ -218,10 +236,12 @@ def ZExt : EnumAttr<"zeroext">; def LessPreciseFPMAD : StrBoolAttr<"less-precise-fpmad">; def NoInfsFPMath : StrBoolAttr<"no-infs-fp-math">; def NoNansFPMath : StrBoolAttr<"no-nans-fp-math">; +def NoSignedZerosFPMath : StrBoolAttr<"no-signed-zeros-fp-math">; def UnsafeFPMath : StrBoolAttr<"unsafe-fp-math">; def NoJumpTables : StrBoolAttr<"no-jump-tables">; def NoInlineLineTables : StrBoolAttr<"no-inline-line-tables">; def ProfileSampleAccurate : StrBoolAttr<"profile-sample-accurate">; +def UseSampleProfile : StrBoolAttr<"use-sample-profile">; class CompatRule<string F> { // The name of the function called to check the attribute of the caller and @@ -240,6 +260,7 @@ def : CompatRule<"isEqual<SanitizeHWAddressAttr>">; def : CompatRule<"isEqual<SanitizeMemTagAttr>">; def : CompatRule<"isEqual<SafeStackAttr>">; def : CompatRule<"isEqual<ShadowCallStackAttr>">; +def : CompatRule<"isEqual<UseSampleProfileAttr>">; class MergeRule<string F> { // The name of the function called to merge the attributes of the caller and @@ -253,6 +274,7 @@ class MergeRule<string F> { def : MergeRule<"setAND<LessPreciseFPMADAttr>">; def : MergeRule<"setAND<NoInfsFPMathAttr>">; def : MergeRule<"setAND<NoNansFPMathAttr>">; +def : MergeRule<"setAND<NoSignedZerosFPMathAttr>">; def : MergeRule<"setAND<UnsafeFPMathAttr>">; def : MergeRule<"setOR<NoImplicitFloatAttr>">; def : MergeRule<"setOR<NoJumpTablesAttr>">; |