RISC-V: Add machine patterns for Zvdota and Zvbdota instructions
New machine patterns and predicates are added for RISC-V Zvdota and Zvbdota instructions.
This commit introduces necessary machine patterns and predicates for the RISC-V Zvdota and Zvbdota instructions, which handle dot-product operations. It includes patterns for vector multiplication and fused multiply-add operations, tailored for these specific instructions. The changes also ensure that dot-product types are correctly handled by the AVL (Approximate Value Propagation) mechanism and exclude them from propagation to avoid incorrect optimizations. New predicates and file definitions are added to support these instructions across various RISC-V configurations.
In Details
This patch adds the core machine patterns and predicates required for the RISC-V Zvdota and Zvbdota extensions. It modifies various .md files (e.g., generic-vector-ooo.md, vector.md, vector-dot.md) to include patterns for dot-product types, ensuring they are recognized and scheduled appropriately. Key changes include the exclusion of dot-product types from AVL propagation in riscv-avlprop.cc due to their reduction nature, and the introduction of a new predicate zvbdota_ci_operand. This work is essential for enabling the compiler to generate efficient code for these new vector inst…
- RISC-V
- An open-standard Instruction Set Architecture (ISA) based on Reduced Instruction Set Computing principles. GCC supports various RISC-V extensions for different architectures.
- Zvdota
- A RISC-V vector extension that provides dot-product instructions for various data types, including integer, BF16, and FP8, enabling efficient vector computations.
- Zvbdota
- A RISC-V vector extension that provides batched dot-product instructions, enabling efficient computation of multiple dot products in a single operation.
- machine patterns
- Internal compiler representations that describe how high-level operations (like arithmetic or memory access) can be translated into specific machine instructions for a target architecture.
- AVL propagation
- Approximate Value Propagation. A compiler optimization technique that propagates approximate values of variables to enable further optimizations. In this context, it's being adapted for vector operations.
- predicate
- A condition or test used in compiler optimization passes to determine whether a particular transformation or code generation rule should be applied.