[llvm] [VPlan] Fix WideIVStep wrap-flags (PR #191284)

Ramkumar Ramachandra via llvm-commits llvm-commits at lists.llvm.org
Thu Apr 16 12:13:48 PDT 2026


================
@@ -182,20 +182,22 @@ void UnrollState::unrollWidenInductionByUF(
   auto &ID = IV->getInductionDescriptor();
   FastMathFlags FMF;
   VPIRFlags::WrapFlagsTy WrapFlags(false, false);
+  VPIRFlags Flags;
   if (auto *IntOrFPInd = dyn_cast<VPWidenIntOrFpInductionRecipe>(IV)) {
     if (IntOrFPInd->hasFastMathFlags())
       FMF = IntOrFPInd->getFastMathFlags();
     if (IntOrFPInd->hasNoWrapFlags())
       WrapFlags = IntOrFPInd->getNoWrapFlags();
+    Flags = *IntOrFPInd;
----------------
artagnon wrote:

Not sure what we can do: we could of course get optional FMF and WrapFlags from Flags, but I'm not sure if that'd be much of an improvement? How do we do better with a union? One idea is to "hide" the ugliness is by introducing VPRecipeBase::{getNoWrapFlags,getFlags,getFMF} the downcasts to VPIRFlags?

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


More information about the llvm-commits mailing list