[all-commits] [llvm/llvm-project] 9ee9fb: [X86] narrowBitOpRMW - add handling for single bit...

Simon Pilgrim via All-commits all-commits at lists.llvm.org
Tue Nov 4 01:37:26 PST 2025


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 9ee9fb0d4090ffb3799ddb731394e403dbda2fb3
      https://github.com/llvm/llvm-project/commit/9ee9fb0d4090ffb3799ddb731394e403dbda2fb3
  Author: Simon Pilgrim <llvm-dev at redking.me.uk>
  Date:   2025-11-04 (Tue, 04 Nov 2025)

  Changed paths:
    M llvm/lib/Target/X86/X86ISelLowering.cpp
    M llvm/test/CodeGen/X86/bittest-big-integer.ll

  Log Message:
  -----------
  [X86] narrowBitOpRMW - add handling for single bit insertion patterns (REAPPLIED) (#166337)

Insertion of a single bit into a large integer is typically
canonicalized to "(X & ~(1 << ShAmt)) | (InsertBit << ShAmt)", which can
be simplified to modify the i32 block as a BTR followed by an
OR((i32)InsertBit << (ShAmt % 32).

We must ensure that the InsertBit is zero apart from the LSB so we can
cheaply truncate it to work with the i32 block like the simpler BT
patterns.

REAPPLIED from #165742 which was reverted as part of a chain of commits
due to a sanitizer regression that should have been fixed by #166160



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