[PATCH] Fold fcmp in cases where value is provably non-negative.
Arch D. Robison
arch.robison at intel.com
Wed Jan 14 11:37:34 PST 2015
Hi reames, hfinkel,
This patch folds fcmp in some cases of interest in Julia. The patch adds a function CannotBeOrderedLessThanZero that returns true if a value is provably not less than zero. I.e. the function returns true if the value is provably -0, +0, positive, or a NaN. The patch extends InstructionSimplify.cpp to fold instances of fcmp where:
- the predicate is olt or uge
- the first operand is provably not less than zero
- the second operand is zero
The motivation for handling these cases optimizing away domain checks for sqrt in Julia for common idioms such as sqrt(x*x+y*y)..
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 5928 bytes
Desc: not available
More information about the llvm-commits