[llvm] [SDag][ARM][RISCV] Allow lowering CTPOP into a libcall (PR #101786)
Nathan Chancellor via llvm-commits
llvm-commits at lists.llvm.org
Wed Apr 23 17:59:31 PDT 2025
nathanchance wrote:
@s-barannikov Thanks for the heads up. Unfortunately, even with 5080a0251fe3352d26560075a9b3b8c9acb13d23, I still see `__popcount` instructions appear with 11a3de7e98785b0df8f2010fb22c10c0590d2707. Testing at ff6a23d65eccba0991244c4127506452e1030393:
```
$ make -skj"$(nproc)" ARCH=arm LLVM=1 mrproper allmodconfig all
ERROR: modpost: "__popcountsi2" [arch/arm/crypto/aes-arm-bs.ko] undefined!
ERROR: modpost: "__popcountsi2" [arch/arm/crypto/aes-arm-ce.ko] undefined!
ERROR: modpost: "__popcountdi2" [fs/ext4/ext4.ko] undefined!
ERROR: modpost: "__popcountsi2" [fs/ext4/ext4.ko] undefined!
ERROR: modpost: "__popcountsi2" [fs/ext2/ext2.ko] undefined!
ERROR: modpost: "__popcountsi2" [fs/jbd2/jbd2.ko] undefined!
ERROR: modpost: "__popcountsi2" [fs/fat/fat.ko] undefined!
ERROR: modpost: "__popcountsi2" [fs/hfsplus/hfsplus.ko] undefined!
ERROR: modpost: "__popcountsi2" [fs/hfs/hfs.ko] undefined!
ERROR: modpost: "__popcountsi2" [fs/nfs/nfs.ko] undefined!
WARNING: modpost: suppressed 203 unresolved symbol warnings because there were too many)
...
$ make -skj"$(nproc)" ARCH=riscv LLVM=1 mrproper defconfig all
ld.lld: error: undefined symbol: __popcountdi2
>>> referenced by hweight.c
>>> lib/hweight.o:(__sw_hweight64) in archive vmlinux.a
>>> referenced by div64.c
>>> lib/math/div64.o:(mul_u64_u64_div_u64) in archive vmlinux.a
>>> referenced by div64.c
>>> lib/math/div64.o:(mul_u64_u64_div_u64) in archive vmlinux.a
>>> referenced 1 more times
...
$ make -skj"$(nproc)" ARCH=riscv LLVM=1 mrproper allmodconfig all
ERROR: modpost: "__popcountdi2" [fs/ext4/ext4.ko] undefined!
ERROR: modpost: "__popcountdi2" [fs/jbd2/jbd2.ko] undefined!
ERROR: modpost: "__popcountdi2" [fs/exfat/exfat.ko] undefined!
ERROR: modpost: "__popcountdi2" [fs/nfs/nfs.ko] undefined!
ERROR: modpost: "__popcountdi2" [fs/nfs/nfsv4.ko] undefined!
ERROR: modpost: "__popcountdi2" [fs/nfs/flexfilelayout/nfs_layout_flexfiles.ko] undefined!
ERROR: modpost: "__popcountdi2" [fs/ntfs3/ntfs3.ko] undefined!
ERROR: modpost: "__popcountdi2" [fs/ubifs/ubifs.ko] undefined!
ERROR: modpost: "__popcountdi2" [fs/xfs/xfs.ko] undefined!
ERROR: modpost: "__popcountdi2" [fs/btrfs/btrfs.ko] undefined!
WARNING: modpost: suppressed 73 unresolved symbol warnings because there were too many)
...
```
I will try to reduce something out tonight or tomorrow.
https://github.com/llvm/llvm-project/pull/101786
More information about the llvm-commits
mailing list