[llvm-branch-commits] [llvm] [InstSimplify] Fold nested FP min/max with a shared operand (PR #233365)

Harrison Hao via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Fri Oct 23 01:27:37 PDT 2026


================
@@ -6797,6 +6797,13 @@ static Value *foldMinimumMaximumSharedOp(Intrinsic::ID IID, Value *Op0,
   if (X0 == Op1 || Y0 == Op1)
     return M0;
 
+  // m(m(X, Y), Z) --> m(X, Y) if m(X, Z) == X or m(Y, Z) == Y.
+  if (MaxRecurse--) {
+    if (foldMinimumMaximumSharedOp(IID, X0, Op1, MaxRecurse) ||
----------------
harrisonGPU wrote:

Thanks, updated

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


More information about the llvm-branch-commits mailing list