The following ups the limit in fold_view_convert_expr to handle
1024bit vectors as used by GCN and RVV. It also robustifies
the handling in visit_reference_op_load to properly give up when
constants cannot be re-interpreted.
PR tree-optimization/111751
* fold-const.cc (fold_view_convert_expr): Up the buffer size
to 128 bytes.
* tree-ssa-sccvn.cc (visit_reference_op_load): Special case
constants, giving up when re-interpretation to the target type
fails.
static tree
fold_view_convert_expr (tree type, tree expr)
{
- /* We support up to 512-bit values (for V8DFmode). */
- unsigned char buffer[64];
+ /* We support up to 1024-bit values (for GCN/RISC-V V128QImode). */
+ unsigned char buffer[128];
int len;
/* Check that the host and target are sane. */
&& maybe_lt (GET_MODE_PRECISION (TYPE_MODE (TREE_TYPE (result))),
GET_MODE_PRECISION (TYPE_MODE (TREE_TYPE (op)))))
result = NULL_TREE;
+ else if (CONSTANT_CLASS_P (result))
+ result = const_unop (VIEW_CONVERT_EXPR, TREE_TYPE (op), result);
else
{
/* We will be setting the value number of lhs to the value number