[SDAG][x86] check for relaxed math when matching an FP reduction
If the last step in an FP add reduction allows reassociation and doesn't care about -0.0, then we are free to recognize that computation as a reduction that may reorder the intermediate steps. This is requested directly by PR42705: https://bugs.llvm.org/show_bug.cgi?id=42705 and solves PR42947 (if horizontal math instructions are actually faster than the alternative): https://bugs.llvm.org/show_bug.cgi?id=42947 Differential Revision: https://reviews.llvm.org/D66236 llvm-svn: 368995
Showing
- llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp 15 additions, 2 deletionsllvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
- llvm/lib/Target/X86/X86ISelLowering.cpp 2 additions, 2 deletionsllvm/lib/Target/X86/X86ISelLowering.cpp
- llvm/test/CodeGen/X86/haddsub.ll 13 additions, 15 deletionsllvm/test/CodeGen/X86/haddsub.ll
- llvm/test/CodeGen/X86/vector-reduce-fadd-fast.ll 12 additions, 18 deletionsllvm/test/CodeGen/X86/vector-reduce-fadd-fast.ll
Loading
Please register or sign in to comment