[PATCH] D21284: Fold fmin(nnan x, inf) -> x, fmax(nnan x, -inf) -> x, fmax(nnan ninf x, -flt_max) -> x and fmin(nnan ninf x, flt_max) -> x
Davide Italiano via llvm-commits
llvm-commits at lists.llvm.org
Sun Jun 19 13:17:26 PDT 2016
- Previous message: [PATCH] D21284: Fold fmin(nnan x, inf) -> x, fmax(nnan x, -inf) -> x, fmax(nnan ninf x, -flt_max) -> x and fmin(nnan ninf x, flt_max) -> x
- Next message: [PATCH] D21284: Fold fmin(nnan x, inf) -> x, fmax(nnan x, -inf) -> x, fmax(nnan ninf x, -flt_max) -> x and fmin(nnan ninf x, flt_max) -> x
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
davide added a subscriber: davide.
================
Comment at: lib/Transforms/InstCombine/InstCombineCalls.cpp:1007-1014
@@ -1006,3 +1006,10 @@
- // TODO: fmin(nnan x, inf) -> x
- // TODO: fmin(nnan ninf x, flt_max) -> x
+ // fmin(nnan x, inf) -> x
+ if (II.hasNoNaNs() && C1 && C1->isInfinity())
+ return Arg0;
+
+ if (Instruction *I = dyn_cast<Instruction>(Arg0)) {
+ if (I->hasNoNaNs() && C1 && C1->isInfinity())
+ return Arg0;
+ }
+
----------------
You should be able to put these where `// fmin(x, -inf) -> -inf` is performed, so that you avoid duplicating the check `C1 && C1->isInfinity()`.
Repository:
rL LLVM
http://reviews.llvm.org/D21284
- Previous message: [PATCH] D21284: Fold fmin(nnan x, inf) -> x, fmax(nnan x, -inf) -> x, fmax(nnan ninf x, -flt_max) -> x and fmin(nnan ninf x, flt_max) -> x
- Next message: [PATCH] D21284: Fold fmin(nnan x, inf) -> x, fmax(nnan x, -inf) -> x, fmax(nnan ninf x, -flt_max) -> x and fmin(nnan ninf x, flt_max) -> x
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
More information about the llvm-commits
mailing list