This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug tree-optimization/86829] New: Missing sin(atan(x)) and cos(atan(x)) optimizations
- From: "giuliano.belinassi at usp dot br" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Thu, 02 Aug 2018 11:38:13 +0000
- Subject: [Bug tree-optimization/86829] New: Missing sin(atan(x)) and cos(atan(x)) optimizations
- Auto-submitted: auto-generated
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86829
Bug ID: 86829
Summary: Missing sin(atan(x)) and cos(atan(x)) optimizations
Product: gcc
Version: unknown
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: tree-optimization
Assignee: unassigned at gcc dot gnu.org
Reporter: giuliano.belinassi at usp dot br
Target Milestone: ---
Created attachment 44486
--> https://gcc.gnu.org/bugzilla/attachment.cgi?id=44486&action=edit
add sin(atan(x)) and cos(atan(x)) substitutions rules.
The file named 'match.pd' does not contain the following simplifications rules:
sin(atan(x)) -> x / sqrt(x*x + 1) and cos(atan(x)) -> 1 / sqrt(x*x + 1).
According to the simple brenchmark I made, these substitutions can provide a
10x speedup in the code. I wrote a patch to add these optimizations.
link to the perf test: https://pastebin.com/5ujSRmhq
assembly dump of the perftest: https://pastebin.com/gLJeWHY8
The code I wrote add an instruction 'CVTSS2SD'. I don't know why it happens.