[llvm-bugs] [Bug 30557] New: LibCallSimplifier::optimizeSinCosPi walks through all users of a ConstantFP

via llvm-bugs llvm-bugs at lists.llvm.org
Wed Sep 28 17:08:31 PDT 2016


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

            Bug ID: 30557
           Summary: LibCallSimplifier::optimizeSinCosPi walks through all
                    users of a ConstantFP
           Product: libraries
           Version: trunk
          Hardware: PC
                OS: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: Transformation Utilities
          Assignee: unassignedbugs at nondot.org
          Reporter: dexonsmith at apple.com
                CC: llvm-bugs at lists.llvm.org
    Classification: Unclassified

Created attachment 17375
  --> https://llvm.org/bugs/attachment.cgi?id=17375&action=edit
Patch to stop optimizing sinpi/cospi of a ConstantFP into sincospi.

LibCallSimplifier::optimizeSinCosPi walks through all users of the arguments in
calls to @llvm.cospi and @llvm.sinpi.  Since these arguments might be
ConstantFP, which is owned by the context, this could take an arbitrarily long
time.

Moreover, this is blocking the removal of use-lists from ConstantData in bug
30513.

There are a few possible solutions:
- Stop performing this optimization on ConstantData (i.e., ConstantFP).  I've
attached a patch that does this, but I doubt it's really what we want.
- Move this optimization to its own pass that walks through the instructions in
a function and keeps a map of the cospi/sinpi calls it has found so far, lazily
replacing them with sincospi when it gets to a matching pair.
- Move this optimization to a similar pass and add this functionality.

-- 
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/20160929/5af26c41/attachment.html>


More information about the llvm-bugs mailing list