[all-commits] [llvm/llvm-project] d29036: [LLVM][X86] Add native ct.select support for X86 a...

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


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

  Changed paths:
    M llvm/lib/Target/X86/X86.td
    M llvm/lib/Target/X86/X86ISelLowering.cpp
    M llvm/lib/Target/X86/X86ISelLowering.h
    M llvm/lib/Target/X86/X86InstrCMovSetCC.td
    M llvm/lib/Target/X86/X86InstrCompiler.td
    M llvm/lib/Target/X86/X86InstrFragments.td
    M llvm/lib/Target/X86/X86InstrInfo.cpp
    M llvm/lib/Target/X86/X86InstrInfo.h
    M llvm/lib/Target/X86/X86InstrPredicates.td
    M llvm/lib/Target/X86/X86TargetMachine.cpp
    A llvm/test/CodeGen/X86/ctselect-edge-cases.ll
    A llvm/test/CodeGen/X86/ctselect-i386-fp.ll
    A llvm/test/CodeGen/X86/ctselect-i386-mmx.ll
    A llvm/test/CodeGen/X86/ctselect-i386.ll
    A llvm/test/CodeGen/X86/ctselect-optimization.ll
    A llvm/test/CodeGen/X86/ctselect-vector.ll
    M llvm/test/CodeGen/X86/ctselect.ll

  Log Message:
  -----------
  [LLVM][X86] Add native ct.select support for X86 and i386

Add native X86 implementation with CMOV instructions and comprehensive tests:
- X86 ISelLowering with CMOV for x86_64 and i386
- Fallback bitwise operations for i386 targets without CMOV
- Post-RA expansion for pseudo-instructions
- Comprehensive test coverage:
  - Edge cases (zero conditions, large integers)
  - i386-specific tests (FP, MMX, non-CMOV fallback)
  - Vector operations
  - Optimization patterns

The basic test demonstrating fallback is in the core infrastructure PR.


  Commit: b63f49d2967520f57a28e97341f46eeb276b874a
      https://github.com/llvm/llvm-project/commit/b63f49d2967520f57a28e97341f46eeb276b874a
  Author: wizardengineer <juliuswoosebert at gmail.com>
  Date:   2025-12-07 (Sun, 07 Dec 2025)

  Changed paths:
    M llvm/lib/Target/X86/X86ISelLowering.cpp
    M llvm/lib/Target/X86/X86ISelLowering.h
    M llvm/lib/Target/X86/X86InstrInfo.cpp
    M llvm/lib/Target/X86/X86InstrInfo.h
    M llvm/lib/Target/X86/X86TargetMachine.cpp
    M llvm/test/CodeGen/X86/ctselect-i386-fp.ll

  Log Message:
  -----------
  [LLVM][X86] Add f80 support for ct.select

Add special handling for x86_fp80 types in CTSELECT lowering by splitting
them into three 32-bit chunks, performing constant-time selection on each
chunk, and reassembling the result. This fixes crashes when compiling
tests with f80 types.

Also updated ctselect.ll to match current generic fallback implementation.


Compare: https://github.com/llvm/llvm-project/compare/13451f3dd2aa...b63f49d29675

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