[llvm] [VPlan] Manage instruction medata in VPlan. (PR #135272)
via llvm-commits
llvm-commits at lists.llvm.org
Fri Apr 18 03:11:07 PDT 2025
================
@@ -1190,28 +1190,55 @@ struct VPIRPhi : public VPIRInstruction {
#endif
};
+using MDArrayRef = ArrayRef<std::pair<unsigned, MDNode *>>;
+
+/// Helper to manage IR metadata for recipes. It filters out metadata that
+/// cannot be proagated.
+class VPWithIRMetadata {
----------------
ayalz wrote:
"With" seems redundant here. There are IRFlags and IRMetadata, there are recipes With the former or the latter or both or none. IRFlags are modeled by relevant VPlan recipes using a nameless union which VPRecipeWithIRFlags "has", rather than inherits from. VP[IR]FlagsTy might be an appropriate name for this union, and VP[IR]Flags a name for a base class. VP[IR]Metadata may be a consistent name for a base class wrapping IRMetadata.
`VPRecipeWithMetadata` may serve as a common base class for recipes having metadata but not flags, but according to this patch these currently include only VPWidenMemoryRecipe's, so perhaps currently redundant.
`VPRecipeWithFlagsAndMetadata` may serve as a common base class for recipes having both, which according to this patch currently include { VPWidenRecipe, VPWidenCallRecipe, VPWidenIntrinsicRecipe, VPWidenCastRecipe and VPWidenSelectRecipe }.
`VPRecipeWith[IR]Flags` will then continue to serve the following subclasses of recipes having flags but no metadata: { VPInstruction(?), VPReplicateRecipe(?), VPWidenGEPRecipe, VPScalarIVStepsRecipe, VPVectorPointerRecipe, VPReverseVectorPointerRecipe, }
https://github.com/llvm/llvm-project/pull/135272
More information about the llvm-commits
mailing list