[llvm-commits] [llvm] r171922 - in /llvm/trunk: include/llvm/IR/Constant.h include/llvm/IR/InstrTypes.h lib/IR/Constants.cpp lib/IR/Instructions.cpp lib/Transforms/InstCombine/InstCombine.h lib/Transforms/InstCombine/InstructionCombining.cpp test/Transforms/InstCombine/fast-math.ll

Eric Christopher echristo at gmail.com
Tue Jan 8 16:28:22 PST 2013


Making no claims about this:

Consider expression "0.0 - X" as the negation of X if
>   - this expression is explicitly marked no-signed-zero, or
>   - no-signed-zero of this expression can be derived from some context.
>
>
since I haven't reviewed that part. However,


>
> +  /// Return true if the value is negative zero or null value.
> +  bool isZeroValue() const;
> +
>

The naming of this routine is really odd given the function just above it
in the file and


> +bool Constant::isZeroValue() const {
> +  // Floating point values have an explicit -0.0 value.
> +  if (const ConstantFP *CFP = dyn_cast<ConstantFP>(this))
> +    return CFP->isZero();
> +
> +  // Otherwise, just use +0.0.
> +  return isNullValue();
> +}
> +
>

and the implementation. Can you explain a bit more?

-eric
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20130108/dba5257d/attachment.html>


More information about the llvm-commits mailing list