[all-commits] [llvm/llvm-project] 2382ab: [CIR] Implement lowering for BitInt that needs to ...
Erich Keane via All-commits
all-commits at lists.llvm.org
Tue Sep 22 17:15:26 PDT 2026
Branch: refs/heads/main
Home: https://github.com/llvm/llvm-project
Commit: 2382abc88740a62ecc2f81769b2a3f2e92cbc75a
https://github.com/llvm/llvm-project/commit/2382abc88740a62ecc2f81769b2a3f2e92cbc75a
Author: Erich Keane <ekeane at nvidia.com>
Date: 2026-09-22 (Tue, 22 Sep 2026)
Changed paths:
M clang/include/clang/CIR/LoweringHelpers.h
M clang/lib/CIR/Dialect/Transforms/LoweringPrepare.cpp
M clang/lib/CIR/Lowering/DirectToLLVM/LowerToLLVM.cpp
M clang/lib/CIR/Lowering/LoweringHelpers.cpp
M clang/test/CIR/CodeGen/agg-init-constexpr.cpp
M clang/test/CIR/CodeGen/array.cpp
R clang/test/CIR/CodeGen/bitint-split-storage-nyi.c
A clang/test/CIR/CodeGen/bitint-wide.c
A clang/test/CIR/CodeGen/global-const-alignment.cpp
M clang/test/CIR/CodeGen/local-const-aggregate-name-clash.cpp
M clang/test/CIR/CodeGen/loop.cpp
M clang/test/CIR/CodeGenCXX/sizeof-pack.cpp
Log Message:
-----------
[CIR] Implement lowering for BitInt that needs to be an array (#225470)
On bitint types that are not powers of 2, we have to represent them as
an array. This patch modifies 'convertTypeForMemory' to do that.
However, that ends up causing a couple of problems, that this also ends
up fixing:
First: constant init needs to also lower to this type/get that correct,
so this introduces 'getBitIntStorageAttr' to manage that
Second: The 'copy' op lowering was getting its layout from the lowered
type, which is no longer correct. Since this is suposed to be the same
as what we get from CIR, this is jsut switched to use that instead.
Third: this ran into an issue with cir.copy in LoweringPrepare where we
didn't properly copy the alignment over. The result was our copy
operation didn't get alignment correct. This patch fixes that too.
Fourth: Load/Store/VecMaskedLoad all had to change how they got the type
for their lowering. Since what they care about is actually the effecitve
'type' itself and not the actual type of the memory the case of the
array-lowering, this patch introduces convertTypeForLoadStore, which is
the effective memory type(no cast required, since LLVM-IR doesn't
care!), rather than the array type.
ALL the above matches classic codegen.
AI Disclosure: I went back and forth with analysis with Claude on this
one, and it wrote most of the tests, but I did every single check-line
:)
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