[llvm-bugs] [Bug 31702] New: Misc incorrect folds with fabs

via llvm-bugs llvm-bugs at lists.llvm.org
Thu Jan 19 17:46:09 PST 2017


https://llvm.org/bugs/show_bug.cgi?id=31702

            Bug ID: 31702
           Summary: Misc incorrect folds with fabs
           Product: libraries
           Version: trunk
          Hardware: PC
                OS: Windows NT
            Status: NEW
          Severity: normal
          Priority: P
         Component: Scalar Optimizations
          Assignee: unassignedbugs at nondot.org
          Reporter: efriedma at codeaurora.org
                CC: justin.lebar at gmail.com, llvm-bugs at lists.llvm.org,
                    Matthew.Arsenault at amd.com
    Classification: Unclassified

Testcase (opt -instcombine):

define double @f1(double %x) local_unnamed_addr #0 {
entry:
  %call = tail call double @llvm.fabs.f64(double %x)
  %add = fadd double %call, 0x7FF8000000000000
  %abs = tail call double @llvm.fabs.f64(double %add)
  ret double %abs
}

define double @f2(double %x) local_unnamed_addr #1 {
entry:
  %call1 = tail call double @llvm.maxnum.f64(double 0x7FF8000000000000, double
%x)
  %call2 = tail call double @llvm.fabs.f64(double %call1)
  ret double %call1
}

define double @f3(double %x, i32 %n) local_unnamed_addr #1 {
entry:
  %call1 = tail call double @llvm.powi.f64(double -0.0, i32 %n)
  %call2 = tail call double @llvm.fabs.f64(double %call1)
  ret double %call1
}

declare double @llvm.maxnum.f64(double, double)
declare double @llvm.fabs.f64(double)
declare double @llvm.powi.f64(double, i32)

instcombine eliminates fabs calls from all of these, so the sign bit could be
wrong.  I think a few others are wrong too.

See https://reviews.llvm.org/D28927.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20170120/020063f0/attachment-0001.html>


More information about the llvm-bugs mailing list