[all-commits] [llvm/llvm-project] 90a1ee: [CIR] Lower pointer const_array globals without in...
adams381 via All-commits
all-commits at lists.llvm.org
Wed Jun 10 14:25:57 PDT 2026
Branch: refs/heads/main
Home: https://github.com/llvm/llvm-project
Commit: 90a1eeb0446f258567c8aa99748cb417a20dfe5b
https://github.com/llvm/llvm-project/commit/90a1eeb0446f258567c8aa99748cb417a20dfe5b
Author: adams381 <adams at nvidia.com>
Date: 2026-06-10 (Wed, 10 Jun 2026)
Changed paths:
M clang/include/clang/CIR/LoweringHelpers.h
M clang/include/clang/CIR/MissingFeatures.h
M clang/lib/CIR/Lowering/DirectToLLVM/LowerToLLVM.cpp
M clang/lib/CIR/Lowering/LoweringHelpers.cpp
A clang/test/CIR/CodeGen/global-pointer-array-fast-lowering.cpp
A clang/test/CIR/Lowering/const-array-bulk-lowering-fallbacks.cir
A clang/test/CIR/Lowering/const-array-of-pointers.cir
Log Message:
-----------
[CIR] Lower pointer const_array globals without insertvalue chains (#198427)
`cir.global` initializers that are `const_array` of `global_view` (no
indices) or null pointers were lowered through an initializer region
full of `llvm.insertvalue` ops even though the elements are all
attribute-representable. That forced the O(N²) MLIR-to-LLVM IR path
on large tables (SPEC CPU 2026 `gcc/insn-automata.cc`).
When `lowerConstArrayAttr` can build the whole initializer, emit the
global with one aggregate attribute instead. String literals with
`trailing_zeros` are padded into `DenseElementsAttr` so C string tables
take the same bulk path. Indexed `global_view`, `#cir.zero` arrays, and
other non-bulk cases still use the insertvalue path.
MLIR prerequisite
[#198424](https://github.com/llvm/llvm-project/pull/198424) is merged on
`main`; this branch is rebased and CIR-only.
---------
Co-authored-by: Claude Sonnet 4.6 <noreply at anthropic.com>
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