[PATCH V2] RISC-V: Using merge approach to optimize repeating sequence in vec_init
Kito Cheng
kito.cheng@gmail.com
Fri May 12 15:19:58 GMT 2023
two minor comments:
> + void add_ta_policy_operand (enum tail_policy vta)
> + void add_ma_policy_operand (enum mask_policy vma)
You could just named as add_policy_operand since the arugment type is
already sufficient to distinguish.
> @@ -84,40 +92,52 @@ public:
> add_input_operand (gen_int_mode (type, Pmode), Pmode);
> }
>
> - void set_dest_and_mask (rtx mask, rtx dest, machine_mode mask_mode)
> + void set_dest_and_mask (rtx mask, rtx dest, machine_mode mask_mode,
> + bool scalar_move = false, bool merge_op = false)
> {
> dest_mode = GET_MODE (dest);
> has_dest = true;
>
> add_output_operand (dest, dest_mode);
>
> - if (mask)
> - add_input_operand (mask, GET_MODE (mask));
> - else
> - add_all_one_mask_operand (mask_mode);
> + if (!merge_op)
> + {
> + if (mask)
> + add_input_operand (mask, GET_MODE (mask));
> + else
> + {
> + if (scalar_move)
> + add_scalar_move_mask_operand (mask_mode);
> + else
> + add_all_one_mask_operand (mask_mode);
> + }
> + }
I would like to have set_dest_and_mask_merge_op to reduce the
complexity of set_dest_and_mask.
Accroding the code I got is:
- mask and merge_op are mutual exclusion.
- scalar_move will become meanless if merge_op is true.
So I think they mixed those togeter is not good idea.
More information about the Gcc-patches
mailing list