[llvm-bugs] [Bug 26993] New: SimplifyLibCalls (in -instcombine) modifies all basic blocks in all functions in all modules

via llvm-bugs llvm-bugs at lists.llvm.org
Fri Mar 18 18:28:38 PDT 2016


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

            Bug ID: 26993
           Summary: SimplifyLibCalls (in -instcombine) modifies all basic
                    blocks in all functions in all modules
           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

Consider the following code:
--
define double @a() {
  %sin = call double @__sinpi(double 1.0)
  ret double %sin
}
define double @b() {
  %cos = call double @__cospi(double 1.0)
  ret double %cos
}

declare double @__sinpi(double %x) #0
declare double @__cospi(double %x) #0 

attributes #0 = { readnone nounwind }
--

Run -instcombine with r263853:
--
$ opt -instcombine -S -mtriple=x86_64-apple-macosx10.9
Instruction does not dominate all uses!
  %cospi = extractvalue { double, double } %sincospi, 1
  ret double %cospi
LLVM ERROR: Broken function found, compilation aborted!
--

The problem is that LibCallSimplifier::optimizeSinCosPi looks at all uses of
the constant.  This will affect not just other functions, but also all other
modules in the context.

I'm not sure -instcombine is even supposed to modify other basic blocks?

-- 
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/20160319/aa80e504/attachment.html>


More information about the llvm-bugs mailing list