This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] Fix improper combiner optimization of mixed mode vector/scalar expressions (PR 79365)


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]