[llvm] [VPlan] Separate out logic to manage IR flags to VPIRFlags (NFC). (PR #140621)

via llvm-commits llvm-commits at lists.llvm.org
Sun May 25 07:20:37 PDT 2025


================
@@ -2524,11 +2525,12 @@ static void expandVPExtendedReduction(VPExtendedReductionRecipe *ExtRed) {
   // Only ZExt contains non-neg flags.
----------------
ayalz wrote:

Consistency nit: rather than calling two distinct constructors - either w/ or w/o flags, could `Flags` be preset and used consistently, here and below, as in
```suggestion
  // Only ZExt contains non-neg flags.
  VPIRFlags Flags;
  if (ExtRed->isZExt())
    Flags = VPIRFlags(*ExtRed); // or even set to VPIRFlags::NonNegFlagsTy(true/ExtRed->isNonNeg()) ?
  Ext = new VPWidenCastRecipe(ExtRed->getExtOpcode(), ExtRed->getVecOp(),
                              ExtRed->getResultType(), Flags,
                              ExtRed->getDebugLoc());
```
?

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


More information about the llvm-commits mailing list