This does not require -ffast-math, and it gives CSE/GVN more options to
eliminate duplicate expressions in, e.g.:
return ((x + 0.1234 * y) * (x - 0.1234 * y));
Paths
| Differential D4904
Reassociate x + -0.1234 * y into x - 0.1234 * y ClosedPublic Authored by erikjv on Aug 14 2014, 4:36 AM.
Details Summary This does not require -ffast-math, and it gives CSE/GVN more options to return ((x + 0.1234 * y) * (x - 0.1234 * y));
Diff Detail Event Timelineerikjv updated this object. Comment Actions Hi Erik, Upload the revised patch and I'll review and approve. Regards, Chad
Comment Actions Hi Chad, I merged in your patch. I also got rid of the "only do it for mcrosier edited edge metadata. Comment ActionsLGTM. Let me know if you need me to push the commit. Chad
This revision is now accepted and ready to land.Aug 19 2014, 8:40 AM
Revision Contents
Diff 12543 lib/Target/README.txt
lib/Transforms/Scalar/Reassociate.cpp
test/Transforms/Reassociate/liftsign.ll
|
We can be more generic here:
FAdd(x, FMul(-ConstantFP, y)) -> FSub(x, FMul(ConstantFP, y))
I actually prefer
// Reassociate: x + -ConstantFP * y -> x - ConstantFP * y
but I'll let you decide.