[llvm] [GlobalISel] Avoid constant folding of different FP types in FCMP (PR #171878)

Joel Fuentes via llvm-commits llvm-commits at lists.llvm.org
Fri Dec 12 07:02:59 PST 2025


================
@@ -74,6 +74,9 @@ bool CombinerHelper::constantFoldFCmp(const GFCmp &FCmp,
   APFloat LHS = LHSCst.getScalarValue();
   APFloat RHS = RHSCst.getScalarValue();
 
+  if (&LHS.getSemantics() != &RHS.getSemantics())
+    return false;
----------------
jfuentes wrote:

I plan to implement it in a follow up PR.

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


More information about the llvm-commits mailing list