llvm-project/llvm/lib/CodeGen/SelectionDAG
Sanjay Patel 657e5d8d41 [DAGCombiner] filter out denorm inputs when calculating sqrt estimate (PR34994)
As shown in the example in PR34994:
https://bugs.llvm.org/show_bug.cgi?id=34994
...we can return a very wrong answer (inf instead of 0.0) for square root when 
using a reciprocal square root estimate instruction.

Here, I've conditionalized the filtering out of denorms based on the function 
having "denormal-fp-math"="ieee" in its attributes. The other options for this 
attribute are 'preserve-sign' and 'positive-zero'.

So we don't generate this extra code by default with just '-ffast-math' (because 
then there's no denormal attribute string at all), but it works if you specify 
'-ffast-math -fdenormal-fp-math=ieee' from clang. 

As noted in the review, there may be other problems in clang that affect the 
results depending on platform (Linux x86 at least), but this should allow 
creating the desired codegen.

Differential Revision: https://reviews.llvm.org/D42323

llvm-svn: 323981
2018-02-01 16:57:18 +00:00
..
CMakeLists.txt Remove trailing whitespace to trigger re-cmaking 2017-10-02 21:54:38 +00:00
DAGCombiner.cpp [DAGCombiner] filter out denorm inputs when calculating sqrt estimate (PR34994) 2018-02-01 16:57:18 +00:00
FastISel.cpp [XRay][compiler-rt+llvm] Update XRay register stashing semantics 2018-02-01 02:21:54 +00:00
FunctionLoweringInfo.cpp Use phi ranges to simplify code. No functionality change intended. 2017-12-30 15:27:33 +00:00
InstrEmitter.cpp Fix a bunch more layering of CodeGen headers that are in Target 2017-11-17 01:07:10 +00:00
InstrEmitter.h
LLVMBuild.txt
LegalizeDAG.cpp DAG: Fix not truncating when promoting bswap/bitreverse 2018-01-31 23:54:16 +00:00
LegalizeFloatTypes.cpp [SelectionDAG][X86] Don't use ->getValueType(0) after a call to getOperand to get the type of the operand. 2017-12-23 02:54:50 +00:00
LegalizeIntegerTypes.cpp [SelectionDAG] Make DAGTypeLegalizer::PromoteSetCCOperands handle SETEQ/SETNE correctly for vector types. 2018-01-27 08:41:03 +00:00
LegalizeTypes.cpp Add optional SelectionDAG* parameter to SValue::dump and SDValue::dumpr 2017-12-20 15:15:04 +00:00
LegalizeTypes.h [SelectionDAG] Don't promote mask operand when widening mstore and mscatter. 2017-12-05 23:08:30 +00:00
LegalizeTypesGeneric.cpp [SelectionDAG] Replace a std::vector<SDValue> with a SmallVector. 2018-01-26 07:15:22 +00:00
LegalizeVectorOps.cpp [SelectionDAG] Fix codegen of vector stores with non byte-sized elements. 2018-01-20 16:05:10 +00:00
LegalizeVectorTypes.cpp [NFC] fix trivial typos in comments and documents 2018-01-26 08:15:29 +00:00
ResourcePriorityQueue.cpp Silence a bunch of implicit fallthrough warnings 2017-12-19 22:05:25 +00:00
SDNodeDbgValue.h Doxygenify comments. 2017-10-24 17:23:40 +00:00
ScheduleDAGFast.cpp Fix a bunch more layering of CodeGen headers that are in Target 2017-11-17 01:07:10 +00:00
ScheduleDAGRRList.cpp [ARM] Allow the scheduler to clone a node with glue to avoid a copy CPSR ↔ GPR. 2018-01-31 09:23:43 +00:00
ScheduleDAGSDNodes.cpp Fix a bunch more layering of CodeGen headers that are in Target 2017-11-17 01:07:10 +00:00
ScheduleDAGSDNodes.h [Target] Fix some Clang-tidy modernize and Include What You Use warnings; other minor fixes (NFC). 2017-01-11 01:45:03 +00:00
ScheduleDAGVLIW.cpp [CodeGen] Unify MBB reference format in both MIR and debug output 2017-12-04 17:18:51 +00:00
SelectionDAG.cpp [SelectionDAG] Teach computeKnownBits about ATOMIC_CMP_SWAP_WITH_SUCCESS boolean return value 2018-01-19 20:47:14 +00:00
SelectionDAGAddressAnalysis.cpp [DAG] Teach findBaseOffset to interpret indexes of indexed memory operations 2018-01-26 16:51:27 +00:00
SelectionDAGBuilder.cpp [SelectionDAG]: Ignore "returned" in the presence of an implicit sret. 2018-01-30 00:14:40 +00:00
SelectionDAGBuilder.h Fix a bunch more layering of CodeGen headers that are in Target 2017-11-17 01:07:10 +00:00
SelectionDAGDumper.cpp [CodeGen] Rename functions PrintReg* to printReg* 2017-11-28 12:42:37 +00:00
SelectionDAGISel.cpp [SelectionDAG] Fix UpdateChains handling of TokenFactors 2018-02-01 16:11:59 +00:00
SelectionDAGPrinter.cpp Remove redundant includes from lib/CodeGen. 2017-12-13 21:30:47 +00:00
SelectionDAGTargetInfo.cpp [CodeGen] Fix some Clang-tidy modernize and Include What You Use warnings; other minor fixes (NFC). 2017-09-13 21:15:20 +00:00
StatepointLowering.cpp Use getStoreSize() in various places instead of 'BitSize >> 3'. 2017-11-28 14:44:32 +00:00
StatepointLowering.h [CodeGen] Fix some Clang-tidy modernize-use-default-member-init and Include What You Use warnings; other minor fixes (NFC). 2017-09-27 23:26:01 +00:00
TargetLowering.cpp [TargetLowering] Teach TargetLowering::SimplifySetCC to simplify setcc of vXi1 vectors into logic ops. 2018-01-27 09:10:58 +00:00