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: unassignedb...@nondot.org
          Reporter: efrie...@codeaurora.org
                CC: justin.le...@gmail.com, llvm-bugs@lists.llvm.org,
                    matthew.arsena...@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.
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to