[llvm-commits] [llvm] r46499 - in /llvm/trunk: lib/Transforms/Scalar/InstructionCombining.cpp test/Transforms/InstCombine/zero-point-zero-add.ll
Nick Lewycky
nicholas at mxc.ca
Mon Jan 28 22:56:40 PST 2008
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.
Nick
More information about the llvm-commits
mailing list