[all-commits] [llvm/llvm-project] 48fb65: [X86] Remove combineAndLoadToBZHI (#221025)

Chris Kennelly via All-commits all-commits at lists.llvm.org
Wed Sep 23 11:18:21 PDT 2026


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 48fb6577caa15e8e90c76a40a4cbd5dfe3cb1387
      https://github.com/llvm/llvm-project/commit/48fb6577caa15e8e90c76a40a4cbd5dfe3cb1387
  Author: Chris Kennelly <ckennelly at ckennelly.com>
  Date:   2026-09-23 (Wed, 23 Sep 2026)

  Changed paths:
    M llvm/lib/Target/X86/X86ISelLowering.cpp
    M llvm/test/CodeGen/X86/replace-load-and-with-bzhi.ll

  Log Message:
  -----------
  [X86] Remove combineAndLoadToBZHI (#221025)

The low-bits mask table recognition it performed is now done in the
target-independent AggressiveInstCombine (394c8dd14933), which rewrites
`x & tbl[i]` to `x & ((1 << i) - 1)`; the X86 backend already lowers
that arithmetic to `bzhi` via `matchBitExtract`. Removing the DAG fold
also retires its unchecked matching of scaled indices, folded constant
offsets and extending loads, which could miscompile under the static
relocation model (the original subject of this PR).

`replace-load-and-with-bzhi.ll` is repurposed as an end-to-end pipeline
test (`opt | llc`) covering the cases the DAG fold handled, PIC, which it
could not handle, and the index shapes it miscompiled.

Assisted-by: Claude Code



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