[all-commits] [llvm/llvm-project] 92f409: [LLVM][ARM] Add native ct.select support for ARM32...

Julius Alexandre via All-commits all-commits at lists.llvm.org
Sat Dec 6 21:22:58 PST 2025


  Branch: refs/heads/users/wizardengineer/ct-select-arm
  Home:   https://github.com/llvm/llvm-project
  Commit: 92f409d8f122d6267b3749f041bad672a8dd1413
      https://github.com/llvm/llvm-project/commit/92f409d8f122d6267b3749f041bad672a8dd1413
  Author: wizardengineer <juliuswoosebert at gmail.com>
  Date:   2025-12-07 (Sun, 07 Dec 2025)

  Changed paths:
    M llvm/lib/Target/ARM/ARMBaseInstrInfo.cpp
    M llvm/lib/Target/ARM/ARMBaseInstrInfo.h
    M llvm/lib/Target/ARM/ARMISelDAGToDAG.cpp
    M llvm/lib/Target/ARM/ARMISelLowering.cpp
    M llvm/lib/Target/ARM/ARMISelLowering.h
    M llvm/lib/Target/ARM/ARMInstrInfo.td
    M llvm/lib/Target/ARM/ARMTargetMachine.cpp
    A llvm/test/CodeGen/ARM/ctselect-half.ll
    A llvm/test/CodeGen/ARM/ctselect-vector.ll
    A llvm/test/CodeGen/ARM/ctselect.ll

  Log Message:
  -----------
  [LLVM][ARM] Add native ct.select support for ARM32 and Thumb

This patch implements architecture-specific lowering for ct.select on ARM
(both ARM32 and Thumb modes) using conditional move instructions and
bitwise operations for constant-time selection.

Implementation details:
- Uses pseudo-instructions that are expanded Post-RA to bitwise operations
- Post-RA expansion in ARMBaseInstrInfo for BUNDLE pseudo-instructions
- Handles scalar integer types, floating-point, and half-precision types
- Handles vector types with NEON when available
- Support for both ARM and Thumb instruction sets (Thumb1 and Thumb2)
- Special handling for Thumb1 which lacks conditional execution
- Comprehensive test coverage including half-precision and vectors

The implementation includes:
- ISelLowering: Custom lowering to CTSELECT pseudo-instructions
- ISelDAGToDAG: Selection of appropriate pseudo-instructions
- BaseInstrInfo: Post-RA expansion of BUNDLE to bitwise instruction sequences
- InstrInfo.td: Pseudo-instruction definitions for different types
- TargetMachine: Registration of Post-RA expansion pass
- Proper handling of condition codes and register allocation constraints



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list