[all-commits] [llvm/llvm-project] b3aa93: [CodeGen] Optimize ctpop expansion using computeKn...
Xu via All-commits
all-commits at lists.llvm.org
Mon Sep 14 07:15:51 PDT 2026
Branch: refs/heads/main
Home: https://github.com/llvm/llvm-project
Commit: b3aa937cf54fe348a550cb6017f825d63af7dd49
https://github.com/llvm/llvm-project/commit/b3aa937cf54fe348a550cb6017f825d63af7dd49
Author: Xu <1483685464 at qq.com>
Date: 2026-09-14 (Mon, 14 Sep 2026)
Changed paths:
M llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp
M llvm/test/CodeGen/AArch64/sve-streaming-mode-fixed-length-bit-counting.ll
M llvm/test/CodeGen/PowerPC/popcnt-zext.ll
M llvm/test/CodeGen/RISCV/ctz_zero_return_test.ll
M llvm/test/CodeGen/RISCV/pr56457.ll
M llvm/test/CodeGen/X86/ctpop-mask.ll
M llvm/test/CodeGen/X86/masked_compressstore.ll
M llvm/test/CodeGen/X86/masked_expandload.ll
M llvm/test/CodeGen/X86/popcnt.ll
Log Message:
-----------
[CodeGen] Optimize ctpop expansion using computeKnownBits (#221671)
The current SWAR popcount implementation always uses the full register
width for the final accumulation step. Even when the input type is much
smaller, such as when counting the bits of an `i8` value, we still use
32-bit operations to extract the result. This patch uses
`computeKnownBits` to determine the minimum number of bits actually
needed to represent the popcount result, and uses this information to
optimize the SWAR popcount expansion.
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