1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-23 11:13:28 +01:00
llvm-mirror/lib
Sanjay Patel 790c02f096 Make the sqrt intrinsic return undef for a negative input.
As discussed here:
http://lists.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20140609/220598.html

And again here:
http://lists.cs.uiuc.edu/pipermail/llvmdev/2014-September/077168.html

The sqrt of a negative number when using the llvm intrinsic is undefined. 
We should return undef rather than 0.0 to match the definition in the LLVM IR lang ref.

This change should not affect any code that isn't using "no-nans-fp-math"; 
ie, no-nans is a requirement for generating the llvm intrinsic in place of a sqrt function call.

Unfortunately, the behavior introduced by this patch will not match current gcc, xlc, icc, and 
possibly other compilers. The current clang/llvm behavior of returning 0.0 doesn't either. 
We knowingly approve of this difference with the other compilers in an attempt to flag code 
that is invoking undefined behavior.

A front-end warning should also try to convince the user that the program will fail:
http://llvm.org/bugs/show_bug.cgi?id=21093

Differential Revision: http://reviews.llvm.org/D5527

llvm-svn: 218803
2014-10-01 20:36:33 +00:00
..
Analysis Make the sqrt intrinsic return undef for a negative input. 2014-10-01 20:36:33 +00:00
AsmParser Make CallingConv::ID an alias of "unsigned". 2014-09-10 18:00:17 +00:00
Bitcode Do not destroy external linkage when deleting function body 2014-09-23 12:54:19 +00:00
CodeGen Move the complex address expression out of DIVariable and into an extra 2014-10-01 18:55:02 +00:00
DebugInfo Store TypeUnits in a SmallVector<DWARFUnitSection> instead of a single DWARFUnitSection. 2014-09-29 13:56:39 +00:00
ExecutionEngine [MCJIT] Turn the getSymbolAddress free function created in r218626 into a static 2014-10-01 04:11:13 +00:00
IR DIBuilder: Encapsulate DIExpression's element type 2014-10-01 20:26:08 +00:00
IRReader Pass a && to getLazyBitcodeModule. 2014-09-03 17:31:46 +00:00
LineEditor
Linker Merge alignment of common GlobalValue. 2014-09-09 17:48:18 +00:00
LTO LTO: Ignore disabled diagnostic remarks 2014-10-01 18:36:03 +00:00
MC Extend C disassembler API to allow specifying target features 2014-09-30 16:31:40 +00:00
Object Object: BSS/virtual sections don't have contents 2014-09-26 22:32:16 +00:00
Option Add an overload of getLastArgNoClaim taking two OptSpecifiers. 2014-09-12 19:42:53 +00:00
ProfileData llvm-cov: Use the number of executed functions for the function coverage metric. 2014-09-30 12:45:13 +00:00
Support Move the complex address expression out of DIVariable and into an extra 2014-10-01 18:55:02 +00:00
TableGen Refactoring: raw pointer -> unique_ptr 2014-09-25 19:55:58 +00:00
Target Don't repeat function/variable name in comment. NFC. 2014-10-01 19:39:32 +00:00
Transforms DIBuilder: Encapsulate DIExpression's element type 2014-10-01 20:26:08 +00:00
CMakeLists.txt
LLVMBuild.txt
Makefile