llvm::makeFollowupLoopID

Create a new loop identifier for a loop created from a loop transformation.

Synopsis

Declared in <llvm/Transforms/Utils/LoopUtils.h>

std::optional<MDNode*>
makeFollowupLoopID(
    MDNode* OrigLoopID,
    ArrayRef<StringRef> FollowupAttrs,
    char const* InheritOptionsAttrsPrefix = "",
    bool AlwaysNew = false);

Return Value

The loop ID for the after-transformation loop. The following values can be returned: std::nullopt : No followup attribute was found; it is up to the transformation to choose attributes that make sense. OrigLoopID The original identifier can be reused. nullptr : The new loop has no attributes. MDNode* : A new unique loop identifier.

Parameters

NameDescription
OrigLoopIDThe loop ID of the loop before the transformation.
FollowupAttrsList of attribute names that contain attributes to be added to the new loop ID.
InheritOptionsAttrsPrefixSelects which attributes should be inherited from the original loop. The following values are considered: nullptr : Inherit all attributes from OrigLoopID. "" : Do not inherit any attribute from OrigLoopID; only use those specified by a followup attribute. "<prefix>": Inherit all attributes except those which start with <prefix>; commonly used to remove metadata for the applied transformation.
AlwaysNewIf true, do not try to reuse OrigLoopID and never return std::nullopt.