[llvm] r244373 - add a missing regression test for a DAGCombiner FDIV optimization

Sanjay Patel via llvm-commits llvm-commits at lists.llvm.org
Fri Aug 7 16:19:41 PDT 2015


Author: spatel
Date: Fri Aug  7 18:19:41 2015
New Revision: 244373

URL: http://llvm.org/viewvc/llvm-project?rev=244373&view=rev
Log:
add a missing regression test for a DAGCombiner FDIV optimization

There's no test for this transform in any backend. Discovered
while debugging fast-math-flag propagation in the DAG (r244053).

Modified:
    llvm/trunk/test/CodeGen/X86/fdiv.ll

Modified: llvm/trunk/test/CodeGen/X86/fdiv.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/fdiv.ll?rev=244373&r1=244372&r2=244373&view=diff
==============================================================================
--- llvm/trunk/test/CodeGen/X86/fdiv.ll (original)
+++ llvm/trunk/test/CodeGen/X86/fdiv.ll Fri Aug  7 18:19:41 2015
@@ -51,3 +51,18 @@ define double @denormal2(double %x) {
   ret double %div
 }
 
+; Deleting the negates does not require unsafe-fp-math.
+
+define float @double_negative(float %x, float %y) #0 {
+; CHECK-LABEL: double_negative:
+; CHECK:       # BB#0:
+; CHECK-NEXT:    divss %xmm1, %xmm0
+; CHECK-NEXT:    retq
+  %neg1 = fsub float -0.0, %x
+  %neg2 = fsub float -0.0, %y
+  %div = fdiv float %neg1, %neg2
+  ret float %div
+}
+
+attributes #0 = { "unsafe-fp-math"="false" }
+




More information about the llvm-commits mailing list