[PATCH] tree-optimization: [PR101540] Simplify CONSTRUCTOR for vector(1) to be VCE

Jeff Law jeffreyalaw@gmail.com
Sun Nov 28 20:25:06 GMT 2021

On 11/28/2021 10:56 AM, apinski--- via Gcc-patches wrote:
> From: Andrew Pinski <apinski@marvell.com>
> This just adds a simplification to simplify_vector_constructor for
> vector of 1 element to be VCE which should reduce memory usage in
> the compiler and maybe allow for some more optimizations.
> OK? Bootstrapped and tested on x86_64-linux-gnu with no regressions.
> 	PR tree-optimization/101540
> gcc/ChangeLog:
> 	* tree-ssa-forwprop.c (simplify_vector_constructor):
> 	Simplify constructor of vector of 1 element to just
> gcc/testsuite/ChangeLog:
> 	* gcc.dg/tree-ssa/pr101540-1.c: New test.
So why generate a VCE here if the type conversion is useless?  Why not 
just a NOP_EXPR?  Is there something special about converting between 
the element type and the outer vector type that requires VCE rather than 
NOP_EXR?  Neither an ACK or NAK, just trying to understand it a bit better.


More information about the Gcc-patches mailing list