[llvm-branch-commits] [llvm] InstCombine: Use SimplifyDemandedFPClass epilog helper function for fma (PR #176017)
https://github.com/arsenm updated
https://github.com/llvm/llvm-project/pull/176017
>From 8826dada37b6557a9007d6535d70729218460ee0 Mon Sep 17 00:00:00 2001
From: Matt Arsenault
Date: Wed, 14 Jan 2026 20:37:45 +0100
Subject: [PATCH] InstCombine: Use SimplifyDemandedFPClass epilog helper
function for fma
NFC refactor to use shared code for fold to constant or set fast math
flags.
---
.../InstCombine/InstCombineSimplifyDemanded.cpp | 16 ++--
1 file changed, 2 insertions(+), 14 deletions(-)
diff --git a/llvm/lib/Transforms/InstCombine/InstCombineSimplifyDemanded.cpp
b/llvm/lib/Transforms/InstCombine/InstCombineSimplifyDemanded.cpp
index c4dd361926e60..53386189d36e7 100644
--- a/llvm/lib/Transforms/InstCombine/InstCombineSimplifyDemanded.cpp
+++ b/llvm/lib/Transforms/InstCombine/InstCombineSimplifyDemanded.cpp
@@ -2761,20 +2761,8 @@ Value
*InstCombinerImpl::SimplifyDemandedUseFPClass(Instruction *I,
Known = KnownFPClass::fma(KnownSrc[0], KnownSrc[1], KnownSrc[2], Mode);
}
- FPClassTest ValidResults = DemandedMask & Known.KnownFPClasses;
- if (Constant *SingleVal =
- getFPClassConstant(VTy, ValidResults, /*IsCanonicalizing=*/true))
-return SingleVal;
-
- FastMathFlags InferredFMF =
- inferFastMathValueFlags(FMF, ValidResults, KnownSrc);
- if (InferredFMF != FMF) {
-CI->dropUBImplyingAttrsAndMetadata();
-CI->setFastMathFlags(InferredFMF);
-return I;
- }
-
- break;
+ return simplifyDemandedFPClassResult(CI, FMF, DemandedMask, Known,
+ {KnownSrc});
}
case Intrinsic::maximum:
case Intrinsic::minimum:
___
llvm-branch-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
[llvm-branch-commits] [llvm] InstCombine: Use SimplifyDemandedFPClass epilog helper function for fma (PR #176017)
https://github.com/arsenm updated
https://github.com/llvm/llvm-project/pull/176017
>From 8826dada37b6557a9007d6535d70729218460ee0 Mon Sep 17 00:00:00 2001
From: Matt Arsenault
Date: Wed, 14 Jan 2026 20:37:45 +0100
Subject: [PATCH] InstCombine: Use SimplifyDemandedFPClass epilog helper
function for fma
NFC refactor to use shared code for fold to constant or set fast math
flags.
---
.../InstCombine/InstCombineSimplifyDemanded.cpp | 16 ++--
1 file changed, 2 insertions(+), 14 deletions(-)
diff --git a/llvm/lib/Transforms/InstCombine/InstCombineSimplifyDemanded.cpp
b/llvm/lib/Transforms/InstCombine/InstCombineSimplifyDemanded.cpp
index c4dd361926e60..53386189d36e7 100644
--- a/llvm/lib/Transforms/InstCombine/InstCombineSimplifyDemanded.cpp
+++ b/llvm/lib/Transforms/InstCombine/InstCombineSimplifyDemanded.cpp
@@ -2761,20 +2761,8 @@ Value
*InstCombinerImpl::SimplifyDemandedUseFPClass(Instruction *I,
Known = KnownFPClass::fma(KnownSrc[0], KnownSrc[1], KnownSrc[2], Mode);
}
- FPClassTest ValidResults = DemandedMask & Known.KnownFPClasses;
- if (Constant *SingleVal =
- getFPClassConstant(VTy, ValidResults, /*IsCanonicalizing=*/true))
-return SingleVal;
-
- FastMathFlags InferredFMF =
- inferFastMathValueFlags(FMF, ValidResults, KnownSrc);
- if (InferredFMF != FMF) {
-CI->dropUBImplyingAttrsAndMetadata();
-CI->setFastMathFlags(InferredFMF);
-return I;
- }
-
- break;
+ return simplifyDemandedFPClassResult(CI, FMF, DemandedMask, Known,
+ {KnownSrc});
}
case Intrinsic::maximum:
case Intrinsic::minimum:
___
llvm-branch-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
[llvm-branch-commits] [llvm] InstCombine: Use SimplifyDemandedFPClass epilog helper function for fma (PR #176017)
https://github.com/arsenm updated
https://github.com/llvm/llvm-project/pull/176017
>From fa12daa32da4f9c8cf3ea343217c9b85f54d038a Mon Sep 17 00:00:00 2001
From: Matt Arsenault
Date: Wed, 14 Jan 2026 20:37:45 +0100
Subject: [PATCH] InstCombine: Use SimplifyDemandedFPClass epilog helper
function for fma
NFC refactor to use shared code for fold to constant or set fast math
flags.
---
.../InstCombine/InstCombineSimplifyDemanded.cpp | 16 ++--
1 file changed, 2 insertions(+), 14 deletions(-)
diff --git a/llvm/lib/Transforms/InstCombine/InstCombineSimplifyDemanded.cpp
b/llvm/lib/Transforms/InstCombine/InstCombineSimplifyDemanded.cpp
index ff1df59b54cf4..90f1cad6a724a 100644
--- a/llvm/lib/Transforms/InstCombine/InstCombineSimplifyDemanded.cpp
+++ b/llvm/lib/Transforms/InstCombine/InstCombineSimplifyDemanded.cpp
@@ -2792,20 +2792,8 @@ Value
*InstCombinerImpl::SimplifyDemandedUseFPClass(Instruction *I,
Known = KnownFPClass::fma(KnownSrc[0], KnownSrc[1], KnownSrc[2], Mode);
}
- FPClassTest ValidResults = DemandedMask & Known.KnownFPClasses;
- if (Constant *SingleVal =
- getFPClassConstant(VTy, ValidResults, /*IsCanonicalizing=*/true))
-return SingleVal;
-
- FastMathFlags InferredFMF =
- inferFastMathValueFlags(FMF, ValidResults, KnownSrc);
- if (InferredFMF != FMF) {
-CI->dropUBImplyingAttrsAndMetadata();
-CI->setFastMathFlags(InferredFMF);
-return I;
- }
-
- break;
+ return simplifyDemandedFPClassResult(CI, FMF, DemandedMask, Known,
+ {KnownSrc});
}
case Intrinsic::maximum:
case Intrinsic::minimum:
___
llvm-branch-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
[llvm-branch-commits] [llvm] InstCombine: Use SimplifyDemandedFPClass epilog helper function for fma (PR #176017)
https://github.com/arsenm updated
https://github.com/llvm/llvm-project/pull/176017
>From fa12daa32da4f9c8cf3ea343217c9b85f54d038a Mon Sep 17 00:00:00 2001
From: Matt Arsenault
Date: Wed, 14 Jan 2026 20:37:45 +0100
Subject: [PATCH] InstCombine: Use SimplifyDemandedFPClass epilog helper
function for fma
NFC refactor to use shared code for fold to constant or set fast math
flags.
---
.../InstCombine/InstCombineSimplifyDemanded.cpp | 16 ++--
1 file changed, 2 insertions(+), 14 deletions(-)
diff --git a/llvm/lib/Transforms/InstCombine/InstCombineSimplifyDemanded.cpp
b/llvm/lib/Transforms/InstCombine/InstCombineSimplifyDemanded.cpp
index ff1df59b54cf4..90f1cad6a724a 100644
--- a/llvm/lib/Transforms/InstCombine/InstCombineSimplifyDemanded.cpp
+++ b/llvm/lib/Transforms/InstCombine/InstCombineSimplifyDemanded.cpp
@@ -2792,20 +2792,8 @@ Value
*InstCombinerImpl::SimplifyDemandedUseFPClass(Instruction *I,
Known = KnownFPClass::fma(KnownSrc[0], KnownSrc[1], KnownSrc[2], Mode);
}
- FPClassTest ValidResults = DemandedMask & Known.KnownFPClasses;
- if (Constant *SingleVal =
- getFPClassConstant(VTy, ValidResults, /*IsCanonicalizing=*/true))
-return SingleVal;
-
- FastMathFlags InferredFMF =
- inferFastMathValueFlags(FMF, ValidResults, KnownSrc);
- if (InferredFMF != FMF) {
-CI->dropUBImplyingAttrsAndMetadata();
-CI->setFastMathFlags(InferredFMF);
-return I;
- }
-
- break;
+ return simplifyDemandedFPClassResult(CI, FMF, DemandedMask, Known,
+ {KnownSrc});
}
case Intrinsic::maximum:
case Intrinsic::minimum:
___
llvm-branch-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
[llvm-branch-commits] [llvm] InstCombine: Use SimplifyDemandedFPClass epilog helper function for fma (PR #176017)
https://github.com/arsenm updated
https://github.com/llvm/llvm-project/pull/176017
>From 5db9ef2388f3f044dc3a85c30457dd243d418cf5 Mon Sep 17 00:00:00 2001
From: Matt Arsenault
Date: Wed, 14 Jan 2026 20:37:45 +0100
Subject: [PATCH] InstCombine: Use SimplifyDemandedFPClass epilog helper
function for fma
NFC refactor to use shared code for fold to constant or set fast math
flags.
---
.../InstCombine/InstCombineSimplifyDemanded.cpp | 16 ++--
1 file changed, 2 insertions(+), 14 deletions(-)
diff --git a/llvm/lib/Transforms/InstCombine/InstCombineSimplifyDemanded.cpp
b/llvm/lib/Transforms/InstCombine/InstCombineSimplifyDemanded.cpp
index ff1df59b54cf4..90f1cad6a724a 100644
--- a/llvm/lib/Transforms/InstCombine/InstCombineSimplifyDemanded.cpp
+++ b/llvm/lib/Transforms/InstCombine/InstCombineSimplifyDemanded.cpp
@@ -2792,20 +2792,8 @@ Value
*InstCombinerImpl::SimplifyDemandedUseFPClass(Instruction *I,
Known = KnownFPClass::fma(KnownSrc[0], KnownSrc[1], KnownSrc[2], Mode);
}
- FPClassTest ValidResults = DemandedMask & Known.KnownFPClasses;
- if (Constant *SingleVal =
- getFPClassConstant(VTy, ValidResults, /*IsCanonicalizing=*/true))
-return SingleVal;
-
- FastMathFlags InferredFMF =
- inferFastMathValueFlags(FMF, ValidResults, KnownSrc);
- if (InferredFMF != FMF) {
-CI->dropUBImplyingAttrsAndMetadata();
-CI->setFastMathFlags(InferredFMF);
-return I;
- }
-
- break;
+ return simplifyDemandedFPClassResult(CI, FMF, DemandedMask, Known,
+ {KnownSrc});
}
case Intrinsic::maximum:
case Intrinsic::minimum:
___
llvm-branch-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
[llvm-branch-commits] [llvm] InstCombine: Use SimplifyDemandedFPClass epilog helper function for fma (PR #176017)
https://github.com/arsenm updated
https://github.com/llvm/llvm-project/pull/176017
>From 5db9ef2388f3f044dc3a85c30457dd243d418cf5 Mon Sep 17 00:00:00 2001
From: Matt Arsenault
Date: Wed, 14 Jan 2026 20:37:45 +0100
Subject: [PATCH] InstCombine: Use SimplifyDemandedFPClass epilog helper
function for fma
NFC refactor to use shared code for fold to constant or set fast math
flags.
---
.../InstCombine/InstCombineSimplifyDemanded.cpp | 16 ++--
1 file changed, 2 insertions(+), 14 deletions(-)
diff --git a/llvm/lib/Transforms/InstCombine/InstCombineSimplifyDemanded.cpp
b/llvm/lib/Transforms/InstCombine/InstCombineSimplifyDemanded.cpp
index ff1df59b54cf4..90f1cad6a724a 100644
--- a/llvm/lib/Transforms/InstCombine/InstCombineSimplifyDemanded.cpp
+++ b/llvm/lib/Transforms/InstCombine/InstCombineSimplifyDemanded.cpp
@@ -2792,20 +2792,8 @@ Value
*InstCombinerImpl::SimplifyDemandedUseFPClass(Instruction *I,
Known = KnownFPClass::fma(KnownSrc[0], KnownSrc[1], KnownSrc[2], Mode);
}
- FPClassTest ValidResults = DemandedMask & Known.KnownFPClasses;
- if (Constant *SingleVal =
- getFPClassConstant(VTy, ValidResults, /*IsCanonicalizing=*/true))
-return SingleVal;
-
- FastMathFlags InferredFMF =
- inferFastMathValueFlags(FMF, ValidResults, KnownSrc);
- if (InferredFMF != FMF) {
-CI->dropUBImplyingAttrsAndMetadata();
-CI->setFastMathFlags(InferredFMF);
-return I;
- }
-
- break;
+ return simplifyDemandedFPClassResult(CI, FMF, DemandedMask, Known,
+ {KnownSrc});
}
case Intrinsic::maximum:
case Intrinsic::minimum:
___
llvm-branch-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
[llvm-branch-commits] [llvm] InstCombine: Use SimplifyDemandedFPClass epilog helper function for fma (PR #176017)
https://github.com/arsenm updated
https://github.com/llvm/llvm-project/pull/176017
>From 0fcf4bcfc44bfe7cdd8fd83412fc6ea42cbd920a Mon Sep 17 00:00:00 2001
From: Matt Arsenault
Date: Wed, 14 Jan 2026 20:37:45 +0100
Subject: [PATCH] InstCombine: Use SimplifyDemandedFPClass epilog helper
function for fma
NFC refactor to use shared code for fold to constant or set fast math
flags.
---
.../InstCombine/InstCombineSimplifyDemanded.cpp | 16 ++--
1 file changed, 2 insertions(+), 14 deletions(-)
diff --git a/llvm/lib/Transforms/InstCombine/InstCombineSimplifyDemanded.cpp
b/llvm/lib/Transforms/InstCombine/InstCombineSimplifyDemanded.cpp
index 043896b96921f..85c1803c086d8 100644
--- a/llvm/lib/Transforms/InstCombine/InstCombineSimplifyDemanded.cpp
+++ b/llvm/lib/Transforms/InstCombine/InstCombineSimplifyDemanded.cpp
@@ -2659,20 +2659,8 @@ Value
*InstCombinerImpl::SimplifyDemandedUseFPClass(Instruction *I,
Known = KnownFPClass::fma(KnownSrc[0], KnownSrc[1], KnownSrc[2], Mode);
}
- FPClassTest ValidResults = DemandedMask & Known.KnownFPClasses;
- if (Constant *SingleVal =
- getFPClassConstant(VTy, ValidResults, /*IsCanonicalizing=*/true))
-return SingleVal;
-
- FastMathFlags InferredFMF =
- inferFastMathValueFlags(FMF, ValidResults, KnownSrc);
- if (InferredFMF != FMF) {
-CI->dropUBImplyingAttrsAndMetadata();
-CI->setFastMathFlags(InferredFMF);
-return I;
- }
-
- break;
+ return simplifyDemandedFPClassResult(CI, FMF, DemandedMask, Known,
+ {KnownSrc});
}
case Intrinsic::maximum:
case Intrinsic::minimum:
___
llvm-branch-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
[llvm-branch-commits] [llvm] InstCombine: Use SimplifyDemandedFPClass epilog helper function for fma (PR #176017)
https://github.com/arsenm updated
https://github.com/llvm/llvm-project/pull/176017
>From 0fcf4bcfc44bfe7cdd8fd83412fc6ea42cbd920a Mon Sep 17 00:00:00 2001
From: Matt Arsenault
Date: Wed, 14 Jan 2026 20:37:45 +0100
Subject: [PATCH] InstCombine: Use SimplifyDemandedFPClass epilog helper
function for fma
NFC refactor to use shared code for fold to constant or set fast math
flags.
---
.../InstCombine/InstCombineSimplifyDemanded.cpp | 16 ++--
1 file changed, 2 insertions(+), 14 deletions(-)
diff --git a/llvm/lib/Transforms/InstCombine/InstCombineSimplifyDemanded.cpp
b/llvm/lib/Transforms/InstCombine/InstCombineSimplifyDemanded.cpp
index 043896b96921f..85c1803c086d8 100644
--- a/llvm/lib/Transforms/InstCombine/InstCombineSimplifyDemanded.cpp
+++ b/llvm/lib/Transforms/InstCombine/InstCombineSimplifyDemanded.cpp
@@ -2659,20 +2659,8 @@ Value
*InstCombinerImpl::SimplifyDemandedUseFPClass(Instruction *I,
Known = KnownFPClass::fma(KnownSrc[0], KnownSrc[1], KnownSrc[2], Mode);
}
- FPClassTest ValidResults = DemandedMask & Known.KnownFPClasses;
- if (Constant *SingleVal =
- getFPClassConstant(VTy, ValidResults, /*IsCanonicalizing=*/true))
-return SingleVal;
-
- FastMathFlags InferredFMF =
- inferFastMathValueFlags(FMF, ValidResults, KnownSrc);
- if (InferredFMF != FMF) {
-CI->dropUBImplyingAttrsAndMetadata();
-CI->setFastMathFlags(InferredFMF);
-return I;
- }
-
- break;
+ return simplifyDemandedFPClassResult(CI, FMF, DemandedMask, Known,
+ {KnownSrc});
}
case Intrinsic::maximum:
case Intrinsic::minimum:
___
llvm-branch-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
[llvm-branch-commits] [llvm] InstCombine: Use SimplifyDemandedFPClass epilog helper function for fma (PR #176017)
https://github.com/arsenm updated
https://github.com/llvm/llvm-project/pull/176017
>From 6765f9b820ec8d91e65a400dc6289ab31b527933 Mon Sep 17 00:00:00 2001
From: Matt Arsenault
Date: Wed, 14 Jan 2026 20:37:45 +0100
Subject: [PATCH] InstCombine: Use SimplifyDemandedFPClass epilog helper
function for fma
NFC refactor to use shared code for fold to constant or set fast math
flags.
---
.../InstCombine/InstCombineSimplifyDemanded.cpp | 16 ++--
1 file changed, 2 insertions(+), 14 deletions(-)
diff --git a/llvm/lib/Transforms/InstCombine/InstCombineSimplifyDemanded.cpp
b/llvm/lib/Transforms/InstCombine/InstCombineSimplifyDemanded.cpp
index afab0796edaf0..a0d76d185fe7a 100644
--- a/llvm/lib/Transforms/InstCombine/InstCombineSimplifyDemanded.cpp
+++ b/llvm/lib/Transforms/InstCombine/InstCombineSimplifyDemanded.cpp
@@ -2615,20 +2615,8 @@ Value
*InstCombinerImpl::SimplifyDemandedUseFPClass(Instruction *I,
Known = KnownFPClass::fma(KnownSrc[0], KnownSrc[1], KnownSrc[2], Mode);
}
- FPClassTest ValidResults = DemandedMask & Known.KnownFPClasses;
- if (Constant *SingleVal =
- getFPClassConstant(VTy, ValidResults, /*IsCanonicalizing=*/true))
-return SingleVal;
-
- FastMathFlags InferredFMF =
- inferFastMathValueFlags(FMF, ValidResults, KnownSrc);
- if (InferredFMF != FMF) {
-CI->dropUBImplyingAttrsAndMetadata();
-CI->setFastMathFlags(InferredFMF);
-return I;
- }
-
- break;
+ return simplifyDemandedFPClassResult(CI, FMF, DemandedMask, Known,
+ {KnownSrc});
}
case Intrinsic::maximum:
case Intrinsic::minimum:
___
llvm-branch-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
[llvm-branch-commits] [llvm] InstCombine: Use SimplifyDemandedFPClass epilog helper function for fma (PR #176017)
https://github.com/arsenm updated
https://github.com/llvm/llvm-project/pull/176017
>From 6765f9b820ec8d91e65a400dc6289ab31b527933 Mon Sep 17 00:00:00 2001
From: Matt Arsenault
Date: Wed, 14 Jan 2026 20:37:45 +0100
Subject: [PATCH] InstCombine: Use SimplifyDemandedFPClass epilog helper
function for fma
NFC refactor to use shared code for fold to constant or set fast math
flags.
---
.../InstCombine/InstCombineSimplifyDemanded.cpp | 16 ++--
1 file changed, 2 insertions(+), 14 deletions(-)
diff --git a/llvm/lib/Transforms/InstCombine/InstCombineSimplifyDemanded.cpp
b/llvm/lib/Transforms/InstCombine/InstCombineSimplifyDemanded.cpp
index afab0796edaf0..a0d76d185fe7a 100644
--- a/llvm/lib/Transforms/InstCombine/InstCombineSimplifyDemanded.cpp
+++ b/llvm/lib/Transforms/InstCombine/InstCombineSimplifyDemanded.cpp
@@ -2615,20 +2615,8 @@ Value
*InstCombinerImpl::SimplifyDemandedUseFPClass(Instruction *I,
Known = KnownFPClass::fma(KnownSrc[0], KnownSrc[1], KnownSrc[2], Mode);
}
- FPClassTest ValidResults = DemandedMask & Known.KnownFPClasses;
- if (Constant *SingleVal =
- getFPClassConstant(VTy, ValidResults, /*IsCanonicalizing=*/true))
-return SingleVal;
-
- FastMathFlags InferredFMF =
- inferFastMathValueFlags(FMF, ValidResults, KnownSrc);
- if (InferredFMF != FMF) {
-CI->dropUBImplyingAttrsAndMetadata();
-CI->setFastMathFlags(InferredFMF);
-return I;
- }
-
- break;
+ return simplifyDemandedFPClassResult(CI, FMF, DemandedMask, Known,
+ {KnownSrc});
}
case Intrinsic::maximum:
case Intrinsic::minimum:
___
llvm-branch-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
[llvm-branch-commits] [llvm] InstCombine: Use SimplifyDemandedFPClass epilog helper function for fma (PR #176017)
https://github.com/arsenm updated
https://github.com/llvm/llvm-project/pull/176017
>From e9b9e6c37916e2d1e609ddb8e0211aa300ccaaf4 Mon Sep 17 00:00:00 2001
From: Matt Arsenault
Date: Wed, 14 Jan 2026 20:37:45 +0100
Subject: [PATCH] InstCombine: Use SimplifyDemandedFPClass epilog helper
function for fma
NFC refactor to use shared code for fold to constant or set fast math
flags.
---
.../InstCombine/InstCombineSimplifyDemanded.cpp | 16 ++--
1 file changed, 2 insertions(+), 14 deletions(-)
diff --git a/llvm/lib/Transforms/InstCombine/InstCombineSimplifyDemanded.cpp
b/llvm/lib/Transforms/InstCombine/InstCombineSimplifyDemanded.cpp
index 6e49fcf7e754c..a13a7b77acf82 100644
--- a/llvm/lib/Transforms/InstCombine/InstCombineSimplifyDemanded.cpp
+++ b/llvm/lib/Transforms/InstCombine/InstCombineSimplifyDemanded.cpp
@@ -2618,20 +2618,8 @@ Value
*InstCombinerImpl::SimplifyDemandedUseFPClass(Instruction *I,
Known = KnownFPClass::fma(KnownSrc[0], KnownSrc[1], KnownSrc[2], Mode);
}
- FPClassTest ValidResults = DemandedMask & Known.KnownFPClasses;
- if (Constant *SingleVal =
- getFPClassConstant(VTy, ValidResults, /*IsCanonicalizing=*/true))
-return SingleVal;
-
- FastMathFlags InferredFMF =
- inferFastMathValueFlags(FMF, ValidResults, KnownSrc);
- if (InferredFMF != FMF) {
-CI->dropUBImplyingAttrsAndMetadata();
-CI->setFastMathFlags(InferredFMF);
-return I;
- }
-
- break;
+ return simplifyDemandedFPClassResult(CI, FMF, DemandedMask, Known,
+ {KnownSrc});
}
case Intrinsic::maximum:
case Intrinsic::minimum:
___
llvm-branch-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
[llvm-branch-commits] [llvm] InstCombine: Use SimplifyDemandedFPClass epilog helper function for fma (PR #176017)
https://github.com/arsenm updated
https://github.com/llvm/llvm-project/pull/176017
>From e9b9e6c37916e2d1e609ddb8e0211aa300ccaaf4 Mon Sep 17 00:00:00 2001
From: Matt Arsenault
Date: Wed, 14 Jan 2026 20:37:45 +0100
Subject: [PATCH] InstCombine: Use SimplifyDemandedFPClass epilog helper
function for fma
NFC refactor to use shared code for fold to constant or set fast math
flags.
---
.../InstCombine/InstCombineSimplifyDemanded.cpp | 16 ++--
1 file changed, 2 insertions(+), 14 deletions(-)
diff --git a/llvm/lib/Transforms/InstCombine/InstCombineSimplifyDemanded.cpp
b/llvm/lib/Transforms/InstCombine/InstCombineSimplifyDemanded.cpp
index 6e49fcf7e754c..a13a7b77acf82 100644
--- a/llvm/lib/Transforms/InstCombine/InstCombineSimplifyDemanded.cpp
+++ b/llvm/lib/Transforms/InstCombine/InstCombineSimplifyDemanded.cpp
@@ -2618,20 +2618,8 @@ Value
*InstCombinerImpl::SimplifyDemandedUseFPClass(Instruction *I,
Known = KnownFPClass::fma(KnownSrc[0], KnownSrc[1], KnownSrc[2], Mode);
}
- FPClassTest ValidResults = DemandedMask & Known.KnownFPClasses;
- if (Constant *SingleVal =
- getFPClassConstant(VTy, ValidResults, /*IsCanonicalizing=*/true))
-return SingleVal;
-
- FastMathFlags InferredFMF =
- inferFastMathValueFlags(FMF, ValidResults, KnownSrc);
- if (InferredFMF != FMF) {
-CI->dropUBImplyingAttrsAndMetadata();
-CI->setFastMathFlags(InferredFMF);
-return I;
- }
-
- break;
+ return simplifyDemandedFPClassResult(CI, FMF, DemandedMask, Known,
+ {KnownSrc});
}
case Intrinsic::maximum:
case Intrinsic::minimum:
___
llvm-branch-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
[llvm-branch-commits] [llvm] InstCombine: Use SimplifyDemandedFPClass epilog helper function for fma (PR #176017)
https://github.com/arsenm updated
https://github.com/llvm/llvm-project/pull/176017
>From 562d8ffa1ce37cecbf0ecea3e34bc859851ef505 Mon Sep 17 00:00:00 2001
From: Matt Arsenault
Date: Wed, 14 Jan 2026 20:37:45 +0100
Subject: [PATCH] InstCombine: Use SimplifyDemandedFPClass epilog helper
function for fma
NFC refactor to use shared code for fold to constant or set fast math
flags.
---
.../InstCombine/InstCombineSimplifyDemanded.cpp | 16 ++--
1 file changed, 2 insertions(+), 14 deletions(-)
diff --git a/llvm/lib/Transforms/InstCombine/InstCombineSimplifyDemanded.cpp
b/llvm/lib/Transforms/InstCombine/InstCombineSimplifyDemanded.cpp
index 5fe889df057bf..a678e9419b98c 100644
--- a/llvm/lib/Transforms/InstCombine/InstCombineSimplifyDemanded.cpp
+++ b/llvm/lib/Transforms/InstCombine/InstCombineSimplifyDemanded.cpp
@@ -2582,20 +2582,8 @@ Value
*InstCombinerImpl::SimplifyDemandedUseFPClass(Instruction *I,
Known = KnownFPClass::fma(KnownSrc[0], KnownSrc[1], KnownSrc[2], Mode);
}
- FPClassTest ValidResults = DemandedMask & Known.KnownFPClasses;
- if (Constant *SingleVal =
- getFPClassConstant(VTy, ValidResults, /*IsCanonicalizing=*/true))
-return SingleVal;
-
- FastMathFlags InferredFMF =
- inferFastMathValueFlags(FMF, ValidResults, KnownSrc);
- if (InferredFMF != FMF) {
-CI->dropUBImplyingAttrsAndMetadata();
-CI->setFastMathFlags(InferredFMF);
-return I;
- }
-
- break;
+ return simplifyDemandedFPClassResult(CI, FMF, DemandedMask, Known,
+ {KnownSrc});
}
case Intrinsic::maximum:
case Intrinsic::minimum:
___
llvm-branch-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
[llvm-branch-commits] [llvm] InstCombine: Use SimplifyDemandedFPClass epilog helper function for fma (PR #176017)
https://github.com/arsenm updated
https://github.com/llvm/llvm-project/pull/176017
>From 562d8ffa1ce37cecbf0ecea3e34bc859851ef505 Mon Sep 17 00:00:00 2001
From: Matt Arsenault
Date: Wed, 14 Jan 2026 20:37:45 +0100
Subject: [PATCH] InstCombine: Use SimplifyDemandedFPClass epilog helper
function for fma
NFC refactor to use shared code for fold to constant or set fast math
flags.
---
.../InstCombine/InstCombineSimplifyDemanded.cpp | 16 ++--
1 file changed, 2 insertions(+), 14 deletions(-)
diff --git a/llvm/lib/Transforms/InstCombine/InstCombineSimplifyDemanded.cpp
b/llvm/lib/Transforms/InstCombine/InstCombineSimplifyDemanded.cpp
index 5fe889df057bf..a678e9419b98c 100644
--- a/llvm/lib/Transforms/InstCombine/InstCombineSimplifyDemanded.cpp
+++ b/llvm/lib/Transforms/InstCombine/InstCombineSimplifyDemanded.cpp
@@ -2582,20 +2582,8 @@ Value
*InstCombinerImpl::SimplifyDemandedUseFPClass(Instruction *I,
Known = KnownFPClass::fma(KnownSrc[0], KnownSrc[1], KnownSrc[2], Mode);
}
- FPClassTest ValidResults = DemandedMask & Known.KnownFPClasses;
- if (Constant *SingleVal =
- getFPClassConstant(VTy, ValidResults, /*IsCanonicalizing=*/true))
-return SingleVal;
-
- FastMathFlags InferredFMF =
- inferFastMathValueFlags(FMF, ValidResults, KnownSrc);
- if (InferredFMF != FMF) {
-CI->dropUBImplyingAttrsAndMetadata();
-CI->setFastMathFlags(InferredFMF);
-return I;
- }
-
- break;
+ return simplifyDemandedFPClassResult(CI, FMF, DemandedMask, Known,
+ {KnownSrc});
}
case Intrinsic::maximum:
case Intrinsic::minimum:
___
llvm-branch-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
[llvm-branch-commits] [llvm] InstCombine: Use SimplifyDemandedFPClass epilog helper function for fma (PR #176017)
github-actions[bot] wrote: # :penguin: Linux x64 Test Results * 168132 tests passed * 2991 tests skipped * 2 tests failed ## Failed Tests (click on a test name to see its output) ### LLVM LLVM.CodeGen/PowerPC/peephole-mma-phi-liveness.ll ``` Exit Code: 1 Command Output (stdout): -- # RUN: at line 2 /home/gha/actions-runner/_work/llvm-project/llvm-project/build/bin/llc -verify-machineinstrs -mcpu=ppc -mtriple=powerpc64-ibm-aix < /home/gha/actions-runner/_work/llvm-project/llvm-project/llvm/test/CodeGen/PowerPC/peephole-mma-phi-liveness.ll | /home/gha/actions-runner/_work/llvm-project/llvm-project/build/bin/FileCheck /home/gha/actions-runner/_work/llvm-project/llvm-project/llvm/test/CodeGen/PowerPC/peephole-mma-phi-liveness.ll # executed command: /home/gha/actions-runner/_work/llvm-project/llvm-project/build/bin/llc -verify-machineinstrs -mcpu=ppc -mtriple=powerpc64-ibm-aix # note: command had no output on stdout or stderr # executed command: /home/gha/actions-runner/_work/llvm-project/llvm-project/build/bin/FileCheck /home/gha/actions-runner/_work/llvm-project/llvm-project/llvm/test/CodeGen/PowerPC/peephole-mma-phi-liveness.ll # .---command stderr # | /home/gha/actions-runner/_work/llvm-project/llvm-project/llvm/test/CodeGen/PowerPC/peephole-mma-phi-liveness.ll:22:15: error: CHECK-NEXT: is not on the line after the previous match # | ; CHECK-NEXT: stxv 2, 0(3) # | ^ # | :28:2: note: 'next' match was here # | stxv 2, 0(3) # | ^ # | :25:19: note: previous match ended here # | xvmaddadp 0, 1, 1 # | ^ # | :26:1: note: non-matching line after previous match is here # | xvadddp 2, 2, 1 # | ^ # | # | Input file: # | Check file: /home/gha/actions-runner/_work/llvm-project/llvm-project/llvm/test/CodeGen/PowerPC/peephole-mma-phi-liveness.ll # | # | -dump-input=help explains the following input dump. # | # | Input was: # | << # | . # | . # | . # | 23: xvmuldp 0, 0, 1 # | 24: xvmaddadp 2, 1, 1 # | 25: xvmaddadp 0, 1, 1 # | 26: xvadddp 2, 2, 1 # | 27: xvadddp 0, 0, 1 # | 28: stxv 2, 0(3) # | next:22 !~~~ error: match on wrong line # | 29: stxv 0, 0(3) # | 30: # implicit-def: $acc0 # | 31: bc 12, 20, L..BB0_2 # | 32: # %bb.1: # %bb10 # | 33: xvf64gerpp 0, 34, 0 # | . # | . # | . # | >> # `- # error: command failed with exit status: 1 -- ``` LLVM.Transforms/InstCombine/fabs.ll ``` Exit Code: 1 Command Output (stdout): -- # RUN: at line 2 /home/gha/actions-runner/_work/llvm-project/llvm-project/build/bin/opt -mtriple=x86_64-unknown-linux-gnu < /home/gha/actions-runner/_work/llvm-project/llvm-project/llvm/test/Transforms/InstCombine/fabs.ll -passes=instcombine -S | /home/gha/actions-runner/_work/llvm-project/llvm-project/build/bin/FileCheck /home/gha/actions-runner/_work/llvm-project/llvm-project/llvm/test/Transforms/InstCombine/fabs.ll # executed command: /home/gha/actions-runner/_work/llvm-project/llvm-project/build/bin/opt -mtriple=x86_64-unknown-linux-gnu -passes=instcombine -S # note: command had no output on stdout or stderr # executed command: /home/gha/actions-runner/_work/llvm-project/llvm-project/build/bin/FileCheck /home/gha/actions-runner/_work/llvm-project/llvm-project/llvm/test/Transforms/InstCombine/fabs.ll # .---command stderr # | /home/gha/actions-runner/_work/llvm-project/llvm-project/llvm/test/Transforms/InstCombine/fabs.ll:210:15: error: CHECK-NEXT: expected string not found in input # | ; CHECK-NEXT: ret float [[FMA]] # | ^ # | :125:78: note: scanning from here # | %fma = call nnan float @llvm.fma.f32(float %x, float %x, float 1.00e+00) # | ^ # | :125:78: note: with "FMA" equal to "%fma" # | %fma = call nnan float @llvm.fma.f32(float %x, float %x, float 1.00e+00) # | ^ # | :127:2: note: possible intended match here # | ret float %fabsf # | ^ # | /home/gha/actions-runner/_work/llvm-project/llvm-project/llvm/test/Transforms/InstCombine/fabs.ll:231:15: error: CHECK-NEXT: expected string not found in input # | ; CHECK-NEXT: ret float [[FMULADD]] # | ^ # | :137:86: note: scanning from here # | %fmuladd = call nnan float @llvm.fmuladd.f32(float %x, float %x, float 1.00e+00) # | ^ # | :137:86: note: with "FMULADD" equal to "%fmuladd" # | %fmuladd = call nnan float @llvm.fmuladd.f32(float %x, float %x, float 1.00e+00) # | ^ # | :139:2: note: possible intended match here # | ret float %fabsf # | ^ # | # | Input file: # | Ch
[llvm-branch-commits] [llvm] InstCombine: Use SimplifyDemandedFPClass epilog helper function for fma (PR #176017)
github-actions[bot] wrote: # :window: Windows x64 Test Results * 129520 tests passed * 2866 tests skipped * 2 tests failed ## Failed Tests (click on a test name to see its output) ### LLVM LLVM.CodeGen/PowerPC/peephole-mma-phi-liveness.ll ``` Exit Code: 1 Command Output (stdout): -- # RUN: at line 2 c:\_work\llvm-project\llvm-project\build\bin\llc.exe -verify-machineinstrs -mcpu=ppc -mtriple=powerpc64-ibm-aix < C:\_work\llvm-project\llvm-project\llvm\test\CodeGen\PowerPC\peephole-mma-phi-liveness.ll | c:\_work\llvm-project\llvm-project\build\bin\filecheck.exe C:\_work\llvm-project\llvm-project\llvm\test\CodeGen\PowerPC\peephole-mma-phi-liveness.ll # executed command: 'c:\_work\llvm-project\llvm-project\build\bin\llc.exe' -verify-machineinstrs -mcpu=ppc -mtriple=powerpc64-ibm-aix # note: command had no output on stdout or stderr # executed command: 'c:\_work\llvm-project\llvm-project\build\bin\filecheck.exe' 'C:\_work\llvm-project\llvm-project\llvm\test\CodeGen\PowerPC\peephole-mma-phi-liveness.ll' # .---command stderr # | C:\_work\llvm-project\llvm-project\llvm\test\CodeGen\PowerPC\peephole-mma-phi-liveness.ll:22:15: error: CHECK-NEXT: is not on the line after the previous match # | ; CHECK-NEXT: stxv 2, 0(3) # | ^ # | :28:2: note: 'next' match was here # | stxv 2, 0(3) # | ^ # | :25:19: note: previous match ended here # | xvmaddadp 0, 1, 1 # | ^ # | :26:1: note: non-matching line after previous match is here # | xvadddp 2, 2, 1 # | ^ # | # | Input file: # | Check file: C:\_work\llvm-project\llvm-project\llvm\test\CodeGen\PowerPC\peephole-mma-phi-liveness.ll # | # | -dump-input=help explains the following input dump. # | # | Input was: # | << # | . # | . # | . # | 23: xvmuldp 0, 0, 1 # | 24: xvmaddadp 2, 1, 1 # | 25: xvmaddadp 0, 1, 1 # | 26: xvadddp 2, 2, 1 # | 27: xvadddp 0, 0, 1 # | 28: stxv 2, 0(3) # | next:22 !~~~ error: match on wrong line # | 29: stxv 0, 0(3) # | 30: # implicit-def: $acc0 # | 31: bc 12, 20, L..BB0_2 # | 32: # %bb.1: # %bb10 # | 33: xvf64gerpp 0, 34, 0 # | . # | . # | . # | >> # `- # error: command failed with exit status: 1 -- ``` LLVM.Transforms/InstCombine/fabs.ll ``` Exit Code: 1 Command Output (stdout): -- # RUN: at line 2 c:\_work\llvm-project\llvm-project\build\bin\opt.exe -mtriple=x86_64-unknown-linux-gnu < C:\_work\llvm-project\llvm-project\llvm\test\Transforms\InstCombine\fabs.ll -passes=instcombine -S | c:\_work\llvm-project\llvm-project\build\bin\filecheck.exe C:\_work\llvm-project\llvm-project\llvm\test\Transforms\InstCombine\fabs.ll # executed command: 'c:\_work\llvm-project\llvm-project\build\bin\opt.exe' -mtriple=x86_64-unknown-linux-gnu -passes=instcombine -S # note: command had no output on stdout or stderr # executed command: 'c:\_work\llvm-project\llvm-project\build\bin\filecheck.exe' 'C:\_work\llvm-project\llvm-project\llvm\test\Transforms\InstCombine\fabs.ll' # .---command stderr # | C:\_work\llvm-project\llvm-project\llvm\test\Transforms\InstCombine\fabs.ll:210:15: error: CHECK-NEXT: expected string not found in input # | ; CHECK-NEXT: ret float [[FMA]] # | ^ # | :125:78: note: scanning from here # | %fma = call nnan float @llvm.fma.f32(float %x, float %x, float 1.00e+00) # | ^ # | :125:78: note: with "FMA" equal to "%fma" # | %fma = call nnan float @llvm.fma.f32(float %x, float %x, float 1.00e+00) # | ^ # | :127:2: note: possible intended match here # | ret float %fabsf # | ^ # | C:\_work\llvm-project\llvm-project\llvm\test\Transforms\InstCombine\fabs.ll:231:15: error: CHECK-NEXT: expected string not found in input # | ; CHECK-NEXT: ret float [[FMULADD]] # | ^ # | :137:86: note: scanning from here # | %fmuladd = call nnan float @llvm.fmuladd.f32(float %x, float %x, float 1.00e+00) # | ^ # | :137:86: note: with "FMULADD" equal to "%fmuladd" # | %fmuladd = call nnan float @llvm.fmuladd.f32(float %x, float %x, float 1.00e+00) # | ^ # | :139:2: note: possible intended match here # | ret float %fabsf # | ^ # | # | Input file: # | Check file: C:\_work\llvm-project\llvm-project\llvm\test\Transforms\InstCombine\fabs.ll # | # | -dump-input=help explains the following input dump. # | # | Input was: # | << # | . # | . # | . # | 120: %fabsf = call float @llvm.fabs.f32(float %fma) # | 121: ret float %fabsf # |
[llvm-branch-commits] [llvm] InstCombine: Use SimplifyDemandedFPClass epilog helper function for fma (PR #176017)
https://github.com/arsenm updated
https://github.com/llvm/llvm-project/pull/176017
>From 2e60bec15bd932e8842bd2517a8cd4f890faa21f Mon Sep 17 00:00:00 2001
From: Matt Arsenault
Date: Wed, 14 Jan 2026 20:37:45 +0100
Subject: [PATCH] InstCombine: Use SimplifyDemandedFPClass epilog helper
function for fma
NFC refactor to use shared code for fold to constant or set fast math
flags.
---
.../InstCombine/InstCombineSimplifyDemanded.cpp | 16 ++--
1 file changed, 2 insertions(+), 14 deletions(-)
diff --git a/llvm/lib/Transforms/InstCombine/InstCombineSimplifyDemanded.cpp
b/llvm/lib/Transforms/InstCombine/InstCombineSimplifyDemanded.cpp
index 5fe889df057bf..a678e9419b98c 100644
--- a/llvm/lib/Transforms/InstCombine/InstCombineSimplifyDemanded.cpp
+++ b/llvm/lib/Transforms/InstCombine/InstCombineSimplifyDemanded.cpp
@@ -2582,20 +2582,8 @@ Value
*InstCombinerImpl::SimplifyDemandedUseFPClass(Instruction *I,
Known = KnownFPClass::fma(KnownSrc[0], KnownSrc[1], KnownSrc[2], Mode);
}
- FPClassTest ValidResults = DemandedMask & Known.KnownFPClasses;
- if (Constant *SingleVal =
- getFPClassConstant(VTy, ValidResults, /*IsCanonicalizing=*/true))
-return SingleVal;
-
- FastMathFlags InferredFMF =
- inferFastMathValueFlags(FMF, ValidResults, KnownSrc);
- if (InferredFMF != FMF) {
-CI->dropUBImplyingAttrsAndMetadata();
-CI->setFastMathFlags(InferredFMF);
-return I;
- }
-
- break;
+ return simplifyDemandedFPClassResult(CI, FMF, DemandedMask, Known,
+ {KnownSrc});
}
case Intrinsic::maximum:
case Intrinsic::minimum:
___
llvm-branch-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
[llvm-branch-commits] [llvm] InstCombine: Use SimplifyDemandedFPClass epilog helper function for fma (PR #176017)
https://github.com/arsenm updated
https://github.com/llvm/llvm-project/pull/176017
>From 2e60bec15bd932e8842bd2517a8cd4f890faa21f Mon Sep 17 00:00:00 2001
From: Matt Arsenault
Date: Wed, 14 Jan 2026 20:37:45 +0100
Subject: [PATCH] InstCombine: Use SimplifyDemandedFPClass epilog helper
function for fma
NFC refactor to use shared code for fold to constant or set fast math
flags.
---
.../InstCombine/InstCombineSimplifyDemanded.cpp | 16 ++--
1 file changed, 2 insertions(+), 14 deletions(-)
diff --git a/llvm/lib/Transforms/InstCombine/InstCombineSimplifyDemanded.cpp
b/llvm/lib/Transforms/InstCombine/InstCombineSimplifyDemanded.cpp
index 5fe889df057bf..a678e9419b98c 100644
--- a/llvm/lib/Transforms/InstCombine/InstCombineSimplifyDemanded.cpp
+++ b/llvm/lib/Transforms/InstCombine/InstCombineSimplifyDemanded.cpp
@@ -2582,20 +2582,8 @@ Value
*InstCombinerImpl::SimplifyDemandedUseFPClass(Instruction *I,
Known = KnownFPClass::fma(KnownSrc[0], KnownSrc[1], KnownSrc[2], Mode);
}
- FPClassTest ValidResults = DemandedMask & Known.KnownFPClasses;
- if (Constant *SingleVal =
- getFPClassConstant(VTy, ValidResults, /*IsCanonicalizing=*/true))
-return SingleVal;
-
- FastMathFlags InferredFMF =
- inferFastMathValueFlags(FMF, ValidResults, KnownSrc);
- if (InferredFMF != FMF) {
-CI->dropUBImplyingAttrsAndMetadata();
-CI->setFastMathFlags(InferredFMF);
-return I;
- }
-
- break;
+ return simplifyDemandedFPClassResult(CI, FMF, DemandedMask, Known,
+ {KnownSrc});
}
case Intrinsic::maximum:
case Intrinsic::minimum:
___
llvm-branch-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
[llvm-branch-commits] [llvm] InstCombine: Use SimplifyDemandedFPClass epilog helper function for fma (PR #176017)
https://github.com/dtcxzyw edited https://github.com/llvm/llvm-project/pull/176017 ___ llvm-branch-commits mailing list [email protected] https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
[llvm-branch-commits] [llvm] InstCombine: Use SimplifyDemandedFPClass epilog helper function for fma (PR #176017)
https://github.com/dtcxzyw approved this pull request. LG https://github.com/llvm/llvm-project/pull/176017 ___ llvm-branch-commits mailing list [email protected] https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
[llvm-branch-commits] [llvm] InstCombine: Use SimplifyDemandedFPClass epilog helper function for fma (PR #176017)
llvmbot wrote:
@llvm/pr-subscribers-llvm-support
Author: Matt Arsenault (arsenm)
Changes
NFC refactor to use shared code for fold to constant or set fast math
flags.
---
Full diff: https://github.com/llvm/llvm-project/pull/176017.diff
1 Files Affected:
- (modified) llvm/lib/Transforms/InstCombine/InstCombineSimplifyDemanded.cpp
(+2-14)
``diff
diff --git a/llvm/lib/Transforms/InstCombine/InstCombineSimplifyDemanded.cpp
b/llvm/lib/Transforms/InstCombine/InstCombineSimplifyDemanded.cpp
index b198e5e824f1f..ce9dec699b06f 100644
--- a/llvm/lib/Transforms/InstCombine/InstCombineSimplifyDemanded.cpp
+++ b/llvm/lib/Transforms/InstCombine/InstCombineSimplifyDemanded.cpp
@@ -2582,20 +2582,8 @@ Value
*InstCombinerImpl::SimplifyDemandedUseFPClass(Instruction *I,
Known = KnownFPClass::fma(KnownSrc[0], KnownSrc[1], KnownSrc[2], Mode);
}
- FPClassTest ValidResults = DemandedMask & Known.KnownFPClasses;
- if (Constant *SingleVal =
- getFPClassConstant(VTy, ValidResults, /*IsCanonicalizing=*/true))
-return SingleVal;
-
- FastMathFlags InferredFMF =
- inferFastMathValueFlags(FMF, ValidResults, KnownSrc);
- if (InferredFMF != FMF) {
-CI->dropUBImplyingAttrsAndMetadata();
-CI->setFastMathFlags(InferredFMF);
-return I;
- }
-
- break;
+ return simplifyDemandedFPClassResult(CI, FMF, DemandedMask, Known,
+ {KnownSrc});
}
case Intrinsic::maximum:
case Intrinsic::minimum:
``
https://github.com/llvm/llvm-project/pull/176017
___
llvm-branch-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
[llvm-branch-commits] [llvm] InstCombine: Use SimplifyDemandedFPClass epilog helper function for fma (PR #176017)
arsenm wrote: > [!WARNING] > This pull request is not mergeable via GitHub because a downstack PR is > open. Once all requirements are satisfied, merge this PR as a stack href="https://app.graphite.com/github/pr/llvm/llvm-project/176017?utm_source=stack-comment-downstack-mergeability-warning"; > >on Graphite. > https://graphite.dev/docs/merge-pull-requests";>Learn more * **#176017** https://app.graphite.com/github/pr/llvm/llvm-project/176017?utm_source=stack-comment-icon"; target="_blank">https://static.graphite.dev/graphite-32x32-black.png"; alt="Graphite" width="10px" height="10px"/> 👈 https://app.graphite.com/github/pr/llvm/llvm-project/176017?utm_source=stack-comment-view-in-graphite"; target="_blank">(View in Graphite) * **#176003** https://app.graphite.com/github/pr/llvm/llvm-project/176003?utm_source=stack-comment-icon"; target="_blank">https://static.graphite.dev/graphite-32x32-black.png"; alt="Graphite" width="10px" height="10px"/> * **#175616** https://app.graphite.com/github/pr/llvm/llvm-project/175616?utm_source=stack-comment-icon"; target="_blank">https://static.graphite.dev/graphite-32x32-black.png"; alt="Graphite" width="10px" height="10px"/> * **#175615** https://app.graphite.com/github/pr/llvm/llvm-project/175615?utm_source=stack-comment-icon"; target="_blank">https://static.graphite.dev/graphite-32x32-black.png"; alt="Graphite" width="10px" height="10px"/> * **#175614** https://app.graphite.com/github/pr/llvm/llvm-project/175614?utm_source=stack-comment-icon"; target="_blank">https://static.graphite.dev/graphite-32x32-black.png"; alt="Graphite" width="10px" height="10px"/>: 1 other dependent PR ([#175999](https://github.com/llvm/llvm-project/pull/175999) https://app.graphite.com/github/pr/llvm/llvm-project/175999?utm_source=stack-comment-icon"; target="_blank">https://static.graphite.dev/graphite-32x32-black.png"; alt="Graphite" width="10px" height="10px"/>) * **#175613** https://app.graphite.com/github/pr/llvm/llvm-project/175613?utm_source=stack-comment-icon"; target="_blank">https://static.graphite.dev/graphite-32x32-black.png"; alt="Graphite" width="10px" height="10px"/> * **#174853** https://app.graphite.com/github/pr/llvm/llvm-project/174853?utm_source=stack-comment-icon"; target="_blank">https://static.graphite.dev/graphite-32x32-black.png"; alt="Graphite" width="10px" height="10px"/> * **#174852** https://app.graphite.com/github/pr/llvm/llvm-project/174852?utm_source=stack-comment-icon"; target="_blank">https://static.graphite.dev/graphite-32x32-black.png"; alt="Graphite" width="10px" height="10px"/> * `main` This stack of pull requests is managed by https://graphite.dev?utm-source=stack-comment";>Graphite. Learn more about https://stacking.dev/?utm_source=stack-comment";>stacking. https://github.com/llvm/llvm-project/pull/176017 ___ llvm-branch-commits mailing list [email protected] https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
[llvm-branch-commits] [llvm] InstCombine: Use SimplifyDemandedFPClass epilog helper function for fma (PR #176017)
https://github.com/arsenm ready_for_review https://github.com/llvm/llvm-project/pull/176017 ___ llvm-branch-commits mailing list [email protected] https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
[llvm-branch-commits] [llvm] InstCombine: Use SimplifyDemandedFPClass epilog helper function for fma (PR #176017)
https://github.com/arsenm created
https://github.com/llvm/llvm-project/pull/176017
NFC refactor to use shared code for fold to constant or set fast math
flags.
>From 25760c21d712c64df47169ad5b50acefd6216793 Mon Sep 17 00:00:00 2001
From: Matt Arsenault
Date: Wed, 14 Jan 2026 20:37:45 +0100
Subject: [PATCH] InstCombine: Use SimplifyDemandedFPClass epilog helper
function for fma
NFC refactor to use shared code for fold to constant or set fast math
flags.
---
.../InstCombine/InstCombineSimplifyDemanded.cpp | 16 ++--
1 file changed, 2 insertions(+), 14 deletions(-)
diff --git a/llvm/lib/Transforms/InstCombine/InstCombineSimplifyDemanded.cpp
b/llvm/lib/Transforms/InstCombine/InstCombineSimplifyDemanded.cpp
index b198e5e824f1f..ce9dec699b06f 100644
--- a/llvm/lib/Transforms/InstCombine/InstCombineSimplifyDemanded.cpp
+++ b/llvm/lib/Transforms/InstCombine/InstCombineSimplifyDemanded.cpp
@@ -2582,20 +2582,8 @@ Value
*InstCombinerImpl::SimplifyDemandedUseFPClass(Instruction *I,
Known = KnownFPClass::fma(KnownSrc[0], KnownSrc[1], KnownSrc[2], Mode);
}
- FPClassTest ValidResults = DemandedMask & Known.KnownFPClasses;
- if (Constant *SingleVal =
- getFPClassConstant(VTy, ValidResults, /*IsCanonicalizing=*/true))
-return SingleVal;
-
- FastMathFlags InferredFMF =
- inferFastMathValueFlags(FMF, ValidResults, KnownSrc);
- if (InferredFMF != FMF) {
-CI->dropUBImplyingAttrsAndMetadata();
-CI->setFastMathFlags(InferredFMF);
-return I;
- }
-
- break;
+ return simplifyDemandedFPClassResult(CI, FMF, DemandedMask, Known,
+ {KnownSrc});
}
case Intrinsic::maximum:
case Intrinsic::minimum:
___
llvm-branch-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
