http://llvm.org/bugs/show_bug.cgi?id=21768
Bug ID: 21768
Summary: reassociate multiplies with fast-math
Product: libraries
Version: trunk
Hardware: PC
OS: All
Status: NEW
Severity: normal
Priority: P
Component: Scalar Optimizations
Assignee: [email protected]
Reporter: [email protected]
CC: [email protected]
Classification: Unclassified
define float @foo(float %f0, float %f1, float %f2, float %f3) {
%mul0 = fmul fast float %f1, %f0
%mul1 = fmul fast float %mul0, %f2
%mul2 = fmul fast float %mul1, %f3
ret float %mul2
}
This should be optimized to:
define float @foo(float %f0, float %f1, float %f2, float %f3) {
%mul0 = fmul fast float %f0, %f1
%mul1 = fmul fast float %f2, %f3
%mul2 = fmul fast float %mul0, %mul1
ret float %mul2
}
Ie, instead of 3 dependent multiplies, we should have 2 independent fmuls
followed by the fmul of those results.
This can be generalized for N fmuls to form the optimal binary tree of
independent ops.
--
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
LLVMbugs mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/llvmbugs