Add POWER10 wide-immediate fusion patterns
Improves POWER10 performance by enabling instruction fusion for addis+addi pairs.
This commit introduces new instruction patterns for the POWER10 architecture to enable fusion of addis and addi instruction pairs. On POWER10, these pairs can be fused for performance, but the scheduler previously broke them apart. The new ‘fake’ instructions represent the fused pair as a single pattern, preventing the scheduler from reordering them while still generating the correct two-instruction sequence. This preserves the fusion benefit without altering the generated code.
In Details
For the rs6000 backend targeting POWER10, this patch introduces new 'fake' instruction definitions in rs6000.md to represent fused addis + addi operations. These patterns, such as largetocp10 and largetocp10_plus, are designed to circumvent the scheduler's tendency to break apart these naturally fusable instruction pairs for dependency chain optimization. By defining them as single patterns, the scheduler is guided to emit the correct two-instruction sequence without losing the potential hardware fusion benefit. Existing patterns are guarded to prevent conflicts.
- rs6000
- The GCC target backend for IBM POWER processors (historically code-named 'Whiskey Creek' and later 'POWER').
- POWER10
- The tenth generation of IBM's POWER microarchitecture, featuring enhanced performance and new instruction capabilities.
- instruction fusion
- A processor feature where two or more simple instructions are combined into a single, more complex micro-operation or a single instruction during execution, potentially improving performance.
- scheduler
- A component of the compiler's backend responsible for ordering instructions to optimize for pipeline usage, register allocation, and memory access patterns.
- addis
- An assembly instruction on PowerPC/POWER architectures that adds an immediate value to the high 16 bits of a register, often used for setting up large constants.
- addi
- An assembly instruction on PowerPC/POWER architectures that adds an immediate value to a register.