[llvm] [LV][VPlan] Change the inheritance of class VPWidenSelectRecipe to class VPRecipeWithIRFlags, which allows recipe of the select to pass the fastmath flags (PR #121023)

via llvm-commits llvm-commits at lists.llvm.org
Mon Dec 23 19:06:47 PST 2024


llvmbot wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-llvm-transforms

Author: LiqinWeng (LiqinWeng)

<details>
<summary>Changes</summary>

The patch of #<!-- -->119847 will add the fastmath flag to for recipe

---
Full diff: https://github.com/llvm/llvm-project/pull/121023.diff


1 Files Affected:

- (modified) llvm/lib/Transforms/Vectorize/VPlan.h (+2-3) 


``````````diff
diff --git a/llvm/lib/Transforms/Vectorize/VPlan.h b/llvm/lib/Transforms/Vectorize/VPlan.h
index 6486c6745a6800..4f457e9876358b 100644
--- a/llvm/lib/Transforms/Vectorize/VPlan.h
+++ b/llvm/lib/Transforms/Vectorize/VPlan.h
@@ -1813,11 +1813,10 @@ class VPHistogramRecipe : public VPRecipeBase {
 };
 
 /// A recipe for widening select instructions.
-struct VPWidenSelectRecipe : public VPSingleDefRecipe {
+struct VPWidenSelectRecipe : public VPRecipeWithIRFlags {
   template <typename IterT>
   VPWidenSelectRecipe(SelectInst &I, iterator_range<IterT> Operands)
-      : VPSingleDefRecipe(VPDef::VPWidenSelectSC, Operands, &I,
-                          I.getDebugLoc()) {}
+      : VPRecipeWithIRFlags(VPDef::VPWidenSelectSC, Operands, I) {}
 
   ~VPWidenSelectRecipe() override = default;
 

``````````

</details>


https://github.com/llvm/llvm-project/pull/121023


More information about the llvm-commits mailing list