ziliangzl wrote: Hi @kuhar, I’ve added the fold pattern `min(min(a, b), b) -> min(a, b)` for maximumf, minimumf, maxnumf, and minnumf. I believe this folding is safe. Could you please take a look and help review/merge it? Thanks! https://github.com/llvm/llvm-project/pull/160224