The code for simplify the VEC_CONCAT of two CONST_VECTOR is already
there, but it's guarded by CONST_SCALAR_INT_P || CONST_FIXED_P ||
CONST_DOUBLE_AS_FLOAT_P. I don't think this logic makes sense.
Either we should allow CONST_VECTOR here or we should remove the dead
code handling CONST_VECTOR in this if statement. I cannot see anything
wrong to just allow CONST_VECTOR.
gcc/
* simplify-rtx.cc (simplify_const_binary_operation): Simplify
VEC_CONCAT two constant vectors.
&& code == VEC_CONCAT
&& (CONST_SCALAR_INT_P (op0)
|| CONST_FIXED_P (op0)
- || CONST_DOUBLE_AS_FLOAT_P (op0))
+ || CONST_DOUBLE_AS_FLOAT_P (op0)
+ || CONST_VECTOR_P (op0))
&& (CONST_SCALAR_INT_P (op1)
|| CONST_DOUBLE_AS_FLOAT_P (op1)
- || CONST_FIXED_P (op1)))
+ || CONST_FIXED_P (op1)
+ || CONST_VECTOR_P (op1)))
{
/* Both inputs have a constant number of elements, so the result
must too. */