This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] Fix improper combiner optimization of mixed mode vector/scalar expressions (PR 79365)
- From: Walter Lee <walt at mellanox dot com>
- To: <gcc-patches at gcc dot gnu dot org>
- Cc: <segher at kernel dot crashing dot org>, <guybe at mellanox dot com>
- Date: Fri, 3 Feb 2017 15:15:41 -0500
- Subject: Re: [PATCH] Fix improper combiner optimization of mixed mode vector/scalar expressions (PR 79365)
- Authentication-results: sourceware.org; auth=none
- Authentication-results: spf=none (sender IP is ) smtp.mailfrom=walt at mellanox dot com;
- References: <265085ca-a7c3-7c65-eca8-8a2df49b8b8c@mellanox.com>
- Spamdiagnosticmetadata: NSPM
- Spamdiagnosticoutput: 1:99
On 2/3/2017 3:03 PM, Walter Lee wrote:
Hi,
In looking at PR 79365 I found that the problem is actually in the
combiner. The combiner sometimes applies scalar optimizations to
vector context where they are invalid. i.e. (a > b) >> 1 can optimize
to 0 if ">" is a scalar op but not if it is a vector op. The reason
this shows up on tile* and not other architectures is because tile*
uses the same register file for both scalars and vectors, so the
combiner sees these mixed mode expressions on tile* that would go
through memory on other architectures.
I have found two places where this improper optimization occurs.
Patch below.
Ok to commit?
I forgot to mention this fix has been validated on TILEPro/TILE-Gx. I also sanity checked it against x86.
Thanks,
Walter