[llvm] 6239a74 - [VPlan] Use getFastMathFlagsOrNone in VPIRFlags::applyFlags (NFC) (#231036)

via llvm-commits llvm-commits at lists.llvm.org
Sun Oct 11 15:13:35 PDT 2026


Author: Florian Hahn
Date: 2026-10-11T22:13:30Z
New Revision: 6239a74feeda70ec82aee1cb767818c4b130835c

URL: https://github.com/llvm/llvm-project/commit/6239a74feeda70ec82aee1cb767818c4b130835c
DIFF: https://github.com/llvm/llvm-project/commit/6239a74feeda70ec82aee1cb767818c4b130835c.diff

LOG: [VPlan] Use getFastMathFlagsOrNone in VPIRFlags::applyFlags (NFC) (#231036)

applyFlags hand-rolled the same field-by-field FastMathFlagsTy to
FastMathFlags conversion as getFastMathFlagsOrNone. Use the latter
together with copyFastMathFlags.

Added: 
    

Modified: 
    llvm/lib/Transforms/Vectorize/VPlan.h

Removed: 
    


################################################################################
diff  --git a/llvm/lib/Transforms/Vectorize/VPlan.h b/llvm/lib/Transforms/Vectorize/VPlan.h
index 2137f576233d5..8ce144addefa0 100644
--- a/llvm/lib/Transforms/Vectorize/VPlan.h
+++ b/llvm/lib/Transforms/Vectorize/VPlan.h
@@ -944,17 +944,9 @@ class VPIRFlags {
           GEPNoWrapFlags::fromRaw(GEPFlagsStorage));
       break;
     case OperationType::FPMathOp:
-    case OperationType::FCmp: {
-      const FastMathFlagsTy &F = getFMFsRef();
-      I.setHasAllowReassoc(F.AllowReassoc);
-      I.setHasNoNaNs(F.NoNaNs);
-      I.setHasNoInfs(F.NoInfs);
-      I.setHasNoSignedZeros(F.NoSignedZeros);
-      I.setHasAllowReciprocal(F.AllowReciprocal);
-      I.setHasAllowContract(F.AllowContract);
-      I.setHasApproxFunc(F.ApproxFunc);
+    case OperationType::FCmp:
+      I.copyFastMathFlags(getFastMathFlagsOrNone());
       break;
-    }
     case OperationType::NonNegOp:
       I.setNonNeg(NonNegFlags.NonNeg);
       break;


        


More information about the llvm-commits mailing list