This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug middle-end/55027] New: simplify vector multiplication by 1
- From: "glisse at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Mon, 22 Oct 2012 19:05:58 +0000
- Subject: [Bug middle-end/55027] New: simplify vector multiplication by 1
- Auto-submitted: auto-generated
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55027
Bug #: 55027
Summary: simplify vector multiplication by 1
Classification: Unclassified
Product: gcc
Version: 4.8.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: middle-end
AssignedTo: unassigned@gcc.gnu.org
ReportedBy: glisse@gcc.gnu.org
Hello,
vector multiplication by 1 is not simplified at the tree level.
#include <x86intrin.h>
__m128d f(__m128d x){
__m128d y={1,1};
return x*y;
}
Worse, gcc can actually create such multiplies. In this modified version of
PR55016:
#include <math.h>
float v0[1024];
float v1[1024];
void v() {
for(int i=0; i!=1024; ++i)
v0[i] = 1/sqrtf(v1[i]);
}
compiled on x86_64 with gcc -O3 -ffast-math e.c -S -std=gnu99
*.optimized still shows:
vect_var_.9_23 = vect_var_.8_21 * { 1.0e+0, 1.0e+0, 1.0e+0, 1.0e+0 };
The back-end later removes it, but it should also be handled at tree level.