[llvm] [LV] Make having flags (FMFs etc) not require inheriting VPSingleDefRecipe (PR #114972)
Benjamin Maxwell via llvm-commits
llvm-commits at lists.llvm.org
Wed Nov 6 04:10:06 PST 2024
================
@@ -803,6 +805,13 @@ class VPRecipeBase : public ilist_node_with_parent<VPRecipeBase, VPBasicBlock>,
/// Returns the debug location of the recipe.
DebugLoc getDebugLoc() const { return DL; }
+ /// Returns the IR flags for the recipe.
+ virtual const VPRecipeIRFlags *getIRFlags() const { return nullptr; }
----------------
MacDue wrote:
I'll see... :thinking: I'm not convinced that would be a better solution. It makes it required for recipes to inherit from `VPRecipeIRFlags` (so `VPRecipeBase*` is castable to `VPRecipeIRFlags*`), and add the additional maintenance keeping the list of classes in the `classof` -- without a `getIRFlags()` on the base).
Given there's only one place that did a VPValue -> IRFlags cast before (the rest easily replaced with `.getIRFlags()`), it does not seem like a critical feature.
https://github.com/llvm/llvm-project/pull/114972
More information about the llvm-commits
mailing list