[PATCH v3 0/8] Add maskload else operand.

2024-10-31 Thread rdapp . gcc
From: Robin Dapp Hi, Significant changes from v2: - Decide on the else value in the vectorizer and also add the VEC_COND there (instead of during ifcvt). - Simplify aarch64 and i386 changes according to maintainers' comments. - Fixed bugs spotted by the CI. No noteworthy changes to the r

[PATCH v3 3/8] tree-ifcvt: Enforce zero else value after maskload.

2024-10-31 Thread rdapp . gcc
From: Robin Dapp When predicating a load we implicitly assume that the else value is zero. This matters in case the loaded value is padded (like e.g. a Bool) and we must ensure that the padding bytes are zero on targets that don't implicitly zero inactive elements. A former version of this patc

[PATCH v3 6/8] gcn: Add else operand to masked loads.

2024-10-31 Thread rdapp . gcc
From: Robin Dapp This patch adds an undefined else operand to the masked loads. gcc/ChangeLog: * config/gcn/predicates.md (maskload_else_operand): New predicate. * config/gcn/gcn-valu.md: Use new predicate. --- gcc/config/gcn/gcn-valu.md | 14 +- gcc/confi

[PATCH v3 7/8] i386: Add else operand to masked loads.

2024-10-31 Thread rdapp . gcc
From: Robin Dapp This patch adds a zero else operand to masked loads, in particular the masked gather load builtins that are used for gather vectorization. gcc/ChangeLog: * config/i386/i386-expand.cc (ix86_expand_special_args_builtin): Add else-operand handling. (ix86_ex

[PATCH v3 5/8] aarch64: Add masked-load else operands.

2024-10-31 Thread rdapp . gcc
From: Robin Dapp This adds zero else operands to masked loads and their intrinsics. I needed to adjust more than initially thought because we rely on combine for several instructions and a change in a "base" pattern needs to propagate to all those. For the lack of a better idea I used a function

[PATCH v3 4/8] vect: Add maskload else value support.

2024-10-31 Thread rdapp . gcc
From: Robin Dapp This patch adds an else operand to vectorized masked load calls. The current implementation adds else-value arguments to the respective target-querying functions that is used to supply the vectorizer with the proper else value. We query the target for its supported else operand

[PATCH v3 1/8] docs: Document maskload else operand and behavior.

2024-10-31 Thread rdapp . gcc
From: Robin Dapp This patch amends the documentation for masked loads (maskload, vec_mask_load_lanes, and mask_gather_load as well as their len counterparts) with an else operand. gcc/ChangeLog: * doc/md.texi: Document masked load else operand. --- gcc/doc/md.texi | 63

[PATCH v3 8/8] RISC-V: Add else operand to masked loads [PR115336].

2024-10-31 Thread rdapp . gcc
From: Robin Dapp This patch adds else operands to masked loads. Currently the default else operand predicate just accepts "undefined" (i.e. SCRATCH) values. PR middle-end/115336 PR middle-end/116059 gcc/ChangeLog: * config/riscv/autovec.md: Add else operand. *

[PATCH v3 2/8] ifn: Add else-operand handling.

2024-10-31 Thread rdapp . gcc
From: Robin Dapp This patch adds else-operand handling to the internal functions. gcc/ChangeLog: * internal-fn.cc (add_mask_and_len_args): Rename... (add_mask_else_and_len_args): ...to this and add else handling. (expand_partial_load_optab_fn): Use adjusted function.