GCC Newspaper
JUNE 15, 2026
Date
/
Architectures
Components
Topics
News & Policy
Other
i386 Performance Win

x86: Improve code generation by relaxing predicates in BT splitters.

The x86 backend now allows wider forms of operands for the BT (bit test) instruction, improving code generation and enabling better instruction propagation.

The x86 backend now relaxes predicates in BT splitters, allowing QImode subregs of AND results, and memory operands for the BT base operand. This change increases combine opportunities and enables better insn propagation, resulting in faster code. The register allocator can also reload a memory operand into a register, satisfying BT pattern constraints if needed.

In Details

The x86 backend uses instruction splitting to transform complex instructions into simpler ones. The BT (bit test) instruction is split into smaller operations when the operands don't directly match the instruction's constraints. This commit modifies the predicates used in the BT splitters in i386.md to allow more operand types and memory operands. The goal is to improve code generation by increasing the number of cases where the BT instruction can be used directly, avoiding more complex instruction sequences.

For Context

In the compilation process, instructions are often broken down into simpler forms to optimize code generation for specific architectures. This commit focuses on the x86 architecture and optimizes the 'BT' (bit test) instruction. By relaxing the constraints on the types of data the instruction can operate on (predicates), the compiler can generate more efficient code sequences, potentially eliminating the need for additional instructions to prepare the data.

Filed Under: i386code generationoptimization