Richard Biener <richard.guent...@gmail.com> writes: > On Thu, Sep 14, 2017 at 1:13 PM, Richard Sandiford > <richard.sandif...@linaro.org> wrote: >> Previously VECTOR_CST_NELTS (t) read the number of elements from >> TYPE_VECTOR_SUBPARTS (TREE_TYPE (t)). There were two ways of handling >> this with variable TYPE_VECTOR_SUBPARTS: either forcibly convert the >> number to a constant (which is doable) or store the number directly >> in the VECTOR_CST. The latter seemed better, since it involves less >> pointer chasing and since the tree_node u field is otherwise unused >> for VECTOR_CST. It would still be easy to switch to the former in >> future if we need to free up the field for someting else. >> >> The patch also changes various bits of VECTOR_CST code to use >> VECTOR_CST_NELTS instead of TYPE_VECTOR_SUBPARTS when iterating >> over VECTOR_CST_ELTs. Also, when the two are checked for equality, >> the patch prefers to read VECTOR_CST_NELTS (which must be constant) >> and check against TYPE_VECTOR_SUBPARTS, instead of the other way >> around. >> >> Tested on aarch64-linux-gnu, x86_64-linux-gnu and powerpc64le-linux-gnu. >> OK to install? > > Ok but I don't see how this helps the variable TYPE_VECTOR_SUBPARTS case? > Are there no VECTOR_CSTs for SVE?
Not for SVE in the normal variable-length case, no. We have different tree codes for building braodcast and step vectors. So it's similar in some ways to the scalar_mode stuff: the fact that we have a VECTOR_CST is "proof" that we have a constant number of elements. Thanks, Richard