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: [email protected]
Reporter: [email protected]
CC: [email protected]
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.
_______________________________________________
llvm-bugs mailing list
[email protected]
http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs