[llvm-bugs] [Bug 24603] New: doesNotAccessMemory documentation has wrong example

via llvm-bugs llvm-bugs at lists.llvm.org
Thu Aug 27 12:47:28 PDT 2015


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

            Bug ID: 24603
           Summary: doesNotAccessMemory documentation has wrong example
           Product: libraries
           Version: trunk
          Hardware: All
                OS: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: Global Analyses
          Assignee: unassignedbugs at nondot.org
          Reporter: schnetter at gmail.com
                CC: llvm-bugs at lists.llvm.org
    Classification: Unclassified

The file docs/AliasAnalysis.rst contains these lines:

{{{
The ``doesNotAccessMemory`` and  ``onlyReadsMemory`` methods
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

These methods are used to provide very simple mod/ref information for function
calls.  The ``doesNotAccessMemory`` method returns true for a function if the
analysis can prove that the function never reads or writes to memory, or if the
function only reads from constant memory.  Functions with this property are
side-effect free and only depend on their input arguments, allowing them to be
eliminated if they form common subexpressions or be hoisted out of loops.  Many
common functions behave this way (e.g., ``sin`` and ``cos``) but many others do
not (e.g., ``acos``, which modifies the ``errno`` variable).
}}}

I think the examples {sin} and {cos} are wrong, since they set errno (if the
argument is infinite). Better examples may be {fabs} and {copysign}.

-- 
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/20150827/79af53ff/attachment.html>


More information about the llvm-bugs mailing list