[llvm-bugs] [Bug 26862] New: InstructionSimplify broadens undef when simplifying fdiv

via llvm-bugs llvm-bugs at lists.llvm.org
Sun Mar 6 21:21:33 PST 2016


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

            Bug ID: 26862
           Summary: InstructionSimplify broadens undef when simplifying
                    fdiv
           Product: libraries
           Version: trunk
          Hardware: All
                OS: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: Global Analyses
          Assignee: unassignedbugs at nondot.org
          Reporter: davemm at cs.rutgers.edu
                CC: llvm-bugs at lists.llvm.org,
                    santosh.nagarakatte at gmail.com
    Classification: Unclassified

These optimizations in SimplifyFDivInst, from
lib/Analysis/InstructionSimplify.cpp, potentially introduce new behavior.

  // undef / X -> undef    (the undef could be a snan).
  if (match(Op0, m_Undef()))
    return Op0;

  // X / undef -> undef
  if (match(Op1, m_Undef()))
    return Op1;

In the first optimization, for any value of X, there will be some floating
point values that undef/X cannot produce. For example, if X is 0, the original
code can only evaluate to Infinity, -Infinity, or NaN, but the transformed code
may produce any value.

The second optimization is similar. For example, if X is 0, x/undef is either
0, -0, or NaN.

-- 
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/20160307/3e213c96/attachment-0001.html>


More information about the llvm-bugs mailing list