[llvm-commits] [llvm] r46499 - in /llvm/trunk: lib/Transforms/Scalar/InstructionCombining.cpp test/Transforms/InstCombine/zero-point-zero-add.ll

Chris Lattner clattner at apple.com
Mon Jan 28 22:58:35 PST 2008


On Jan 28, 2008, at 10:56 PM, Nick Lewycky wrote:

> Chris Lattner wrote:
>> +    if (const IntrinsicInst *II = dyn_cast<IntrinsicInst>(I))
>> +      if (II->getIntrinsicID() == Intrinsic::sqrt)
>> +        return CannotBeNegativeZero(II->getOperand(1));
>
> "Unlike sqrt in libm, however, llvm.sqrt has undefined behavior for
> negative numbers (which allows for better optimization)."
>
> I think you can safely return true here.

I will clarify LangRef: llvm.sqrt is defined for -0.0.  Thanks!

-Chris



More information about the llvm-commits mailing list