LLVM 20.0.0git
|
Enumerations | |
enum | AttributeSafetyKind : uint8_t { ASK_SAFE_TO_DROP = 1 , ASK_UNSAFE_TO_DROP = 2 , ASK_ALL = ASK_SAFE_TO_DROP | ASK_UNSAFE_TO_DROP } |
Functions | |
bool | isNoFPClassCompatibleType (Type *Ty) |
Returns true if this is a type legal for the 'nofpclass' attribute. | |
AttributeMask | typeIncompatible (Type *Ty, AttributeSafetyKind ASK=ASK_ALL) |
Which attributes cannot be applied to a type. | |
AttributeMask | getUBImplyingAttributes () |
Get param/return attributes which imply immediate undefined behavior if an invalid value is passed. | |
bool | areInlineCompatible (const Function &Caller, const Function &Callee) |
bool | areOutlineCompatible (const Function &A, const Function &B) |
Checks if there are any incompatible function attributes between A and B . | |
void | mergeAttributesForInlining (Function &Caller, const Function &Callee) |
Merge caller's and callee's attributes. | |
void | mergeAttributesForOutlining (Function &Base, const Function &ToMerge) |
Merges the functions attributes from ToMerge into function Base . | |
void | updateMinLegalVectorWidthAttr (Function &Fn, uint64_t Width) |
Update min-legal-vector-width if it is in Attribute and less than Width. | |
enum llvm::AttributeFuncs::AttributeSafetyKind : uint8_t |
Enumerator | |
---|---|
ASK_SAFE_TO_DROP | |
ASK_UNSAFE_TO_DROP | |
ASK_ALL |
Definition at line 1257 of file Attributes.h.
Definition at line 2393 of file Attributes.cpp.
Referenced by functionsHaveCompatibleAttributes().
Checks if there are any incompatible function attributes between A
and B
.
[in] | A | - The first function to be compared with. |
[in] | B | - The second function to be compared with. |
Definition at line 2398 of file Attributes.cpp.
AttributeMask llvm::AttributeFuncs::getUBImplyingAttributes | ( | ) |
Get param/return attributes which imply immediate undefined behavior if an invalid value is passed.
For example, this includes noundef (where undef implies UB), but not nonnull (where null implies poison). It also does not include attributes like nocapture, which constrain the function implementation rather than the passed value.
Definition at line 2166 of file Attributes.cpp.
References llvm::AttributeMask::addAttribute().
Referenced by llvm::Instruction::dropUBImplyingAttrsAndUnknownMetadata(), and runIPSCCP().
Returns true if this is a type legal for the 'nofpclass' attribute.
This follows the same type rules as FPMathOperator.
This follows the same type rules as FPMathOperator.
TODO: Consider relaxing to any FP type struct fields.
Definition at line 2096 of file Attributes.cpp.
References llvm::Type::isFPOrFPVectorTy().
Referenced by llvm::Attributor::identifyDefaultAbstractAttributes(), typeIncompatible(), and llvm::InstCombinerImpl::visitReturnInst().
void llvm::AttributeFuncs::mergeAttributesForInlining | ( | Function & | Caller, |
const Function & | Callee | ||
) |
Merge caller's and callee's attributes.
Definition at line 2403 of file Attributes.cpp.
Referenced by llvm::InlineFunction().
void llvm::AttributeFuncs::mergeAttributesForOutlining | ( | Function & | Base, |
const Function & | ToMerge | ||
) |
Merges the functions attributes from ToMerge
into function Base
.
[in,out] | Base | - The function being merged into. |
[in] | ToMerge | - The function to merge attributes from. |
Definition at line 2408 of file Attributes.cpp.
References llvm::sampleprof::Base.
AttributeMask llvm::AttributeFuncs::typeIncompatible | ( | Type * | Ty, |
AttributeSafetyKind | ASK = ASK_ALL |
||
) |
Which attributes cannot be applied to a type.
The argument ASK
indicates, if only attributes that are known to be safely droppable are contained in the mask; only attributes that might be unsafe to drop (e.g., ABI-related attributes) are in the mask; or both.
Definition at line 2103 of file Attributes.cpp.
References llvm::AttributeMask::addAttribute(), ASK_SAFE_TO_DROP, ASK_UNSAFE_TO_DROP, llvm::Type::isIntegerTy(), llvm::Type::isIntOrIntVectorTy(), isNoFPClassCompatibleType(), llvm::Type::isPointerTy(), llvm::Type::isPtrOrPtrVectorTy(), and llvm::Type::isVoidTy().
Referenced by llvm::CloneAndPruneIntoFromInst(), llvm::AMDGPULibCalls::fold(), llvm::InlineFunction(), mergeAttributesAndFlags(), llvm::promoteCall(), and llvm::UpgradeFunctionAttributes().
Update min-legal-vector-width if it is in Attribute and less than Width.
Definition at line 2421 of file Attributes.cpp.
References llvm::Function::addFnAttr(), llvm::StringRef::getAsInteger(), llvm::Function::getFnAttribute(), llvm::Attribute::getValueAsString(), and llvm::Attribute::isValid().
Referenced by doPromotion().