[PATCH] D87571: [DAGCombiner] Fold fmin/fmax with INF
Sanjay Patel via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Sun Sep 13 06:42:51 PDT 2020
spatel accepted this revision.
spatel added a comment.
This revision is now accepted and ready to land.
LGTM. Should we common/integrate the caller functions/switch cases? Ie, we're switching on min/max opcode, but then translating that knowledge into the bool flags and then predicating on those flags instead of the opcodes.
Comparing this to InstSimplify...I think we have 2 problems there:
1. D52766 <https://reviews.llvm.org/D52766> introduced a miscompile for maximum/minimum (need more tests)
2. Optimizations are missing (noted with TODO comments)
There's also another set of potential optimization to include here (based on ninf):
// TODO: minnum(nnan ninf x, flt_max) -> x
// TODO: maxnum(nnan ninf x, -flt_max) -> x
Let me know if you plan to work on those. If not, I can do it.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D87571/new/
https://reviews.llvm.org/D87571
More information about the llvm-commits
mailing list