Closed
Description
Bugzilla Link | 52259 |
Version | trunk |
OS | All |
Reporter | LLVM Bugzilla Contributor |
CC | @andykaylor,@davidbolvansky,@jyknight,@RKSimon,@rotateright |
Extended Description
Consider the following code compiled with -Ofast
.
double floatingAbs(double x) {
if (x < 0)
return -x;
else
return x;
}
This should produce a fabs
but the compiler is unable to do produce one because the select instruction in the IR does not have any fast flags.
From my analysis:
SROA -> creates a Phi node without any fast flags.
SimplifyCFG -> converts the Phi to a select and copies the Phi's fast flags,
unfortunately the phi does not have any fast flags to begin with.