[all-commits] [llvm/llvm-project] 394c8d: [AggressiveInstCombine] Fold low-bits mask table l...
Chris Kennelly via All-commits
all-commits at lists.llvm.org
Tue Sep 22 03:41:03 PDT 2026
Branch: refs/heads/main
Home: https://github.com/llvm/llvm-project
Commit: 394c8dd1493308cb9add77b18987aee2219a65c1
https://github.com/llvm/llvm-project/commit/394c8dd1493308cb9add77b18987aee2219a65c1
Author: Chris Kennelly <ckennelly at ckennelly.com>
Date: 2026-09-22 (Tue, 22 Sep 2026)
Changed paths:
M llvm/lib/Transforms/AggressiveInstCombine/AggressiveInstCombine.cpp
A llvm/test/Transforms/AggressiveInstCombine/lower-table-based-lowbits-mask-n32.ll
A llvm/test/Transforms/AggressiveInstCombine/lower-table-based-lowbits-mask.ll
Log Message:
-----------
[AggressiveInstCombine] Fold low-bits mask table loads to arithmetic (#222509)
Recognize a load from a constant "low bits mask" table
```
static const uintN_t tbl[K] = { 0, 1, 3, 7, ... }; // tbl[j] == (1 << j) - 1
... x & tbl[i] ...
```
and replace the load with the equivalent arithmetic mask (1 << i) - 1.
This is the target-independent form of the X86 combineAndLoadToBZHI DAG
combine: on X86 with BMI2 the surrounding and still selects to a single
bzhi.
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