summaryrefslogtreecommitdiff
path: root/clang/test/CIR/CodeGen/array.cpp
AgeCommit message (Collapse)Author
2025-11-10[CIR] Re-land: Recognize constant aggregate initialization of auto vars ↵Andy Kaylor
(#167033) This adds code that was previously missing from emitAutoVarAlloca to identify when an aggregate auto var is being emitted with a constant initializer, and the associated code that is called from emitAutoVarInit to store the constant. This allows significantly more efficient initialization. This was previously committed in https://github.com/llvm/llvm-project/pull/166850 but that change contained an unintended modification to an unrelated test.
2025-11-07Revert "[CIR] Recognize constant aggregate initialization of auto vars ↵Aiden Grossman
(#166850)" This reverts commit 5fc1b74af52093cd5229ba0e1c368d41735bb990. This broke premerge (and premerge was failing on the patch itself): 1. https://lab.llvm.org/staging/#/builders/192/builds/10053 2. https://lab.llvm.org/staging/#/builders/21/builds/8268
2025-11-07[CIR] Recognize constant aggregate initialization of auto vars (#166850)Andy Kaylor
This adds code that was previously missing from emitAutoVarAlloca to identify when an aggregate auto var is being emitted with a constant initializer, and the associated code that is called from emitAutoVarInit to store the constant. This allows significantly more efficient initialization.
2025-10-17[CIR] Add inline function attributes (#162866)Morris Hafner
Unlike the incubator, this adds the inline attribute directly to FuncOp instead of adding the ExtraFnAttr dict. This adds three new optional keywords to CIR: inline_always, inline_never and inline_hint. Just like in OGCG -O0 implies inline_never on functions withoutt the C++ `inline` keyword and no other inlining-related attribute. This patch also adapts all tests that use functions so they account for LLVM attributes being attached now.
2025-10-06[CIR] Clean up ptr_stride assembly format (#162138)Henrich Lauko
This mirrors changes from https://github.com/llvm/clangir/pull/1933
2025-10-01[CIR] Refactor cir.cast to use uniform assembly form w/o parens, commas ↵Henrich Lauko
(#161431) This mirrors incubator changes from https://github.com/llvm/clangir/pull/1922
2025-09-23[CIR] Upstream support Agg init with lvalue ComplexType (#159974)Amr Hesham
Upstream the support of Agg init with lvalue ComplexType Issue: https://github.com/llvm/llvm-project/issues/141365
2025-08-19[CIR] Use zero-initializer for partial array fills (#154161)Andy Kaylor
If an array initializer list leaves eight or more elements that require zero fill, we had been generating an individual zero element for every one of them. This change instead follows the behavior of classic codegen, which creates a constant structure with the specified elements followed by a zero-initializer for the trailing zeros.
2025-08-13[CIR] Use a loop for array initialization (#153499)Andy Kaylor
This updates the array initialization loop to use a do..while loop rather than a fully serialized initialization. It also allows the initialization of destructed objects when exception handling is not enabled. Array initialization when exception handling is enabled remains unimplemented, but more precise messages are now emitted.
2025-06-25[CIR] Add support for function linkage and visibility (#145600)Andy Kaylor
This change adds support for function linkage and visibility and related attributes. Most of the test changes are generalizations to allow 'dso_local' to be accepted where we aren't specifically testing for it. Some tests based on CIR inputs have been updated to add 'private' to function declarations where required by newly supported interfaces. The dso-local.c test has been updated to add specific tests for dso_local being set correctly, and a new test, func-linkage.cpp tests other linkage settings. This change sets `comdat` correctly in CIR, but it is not yet applied to functions when lowering to LLVM IR. That will be handled in a later change.
2025-06-13[CIR] Update isSized with upstreamed types (#143960)Amr Hesham
Update `isSized` function with the upstreamed types
2025-05-30[CIR] Add support for global linkage and visibility (#141973)Andy Kaylor
This change adds support for the CIRGlobalValueInterface and attributes for visibility and comdat to GlobalOp. The comdat attribute isn't correctly calculated yet, but it was required for the CIRGlobalValueInterface interface. There are also some cases where dso_local isn't set correctly, but it is better than it was before this change. Those issues will be addressed in a future patch.
2025-05-28[CIR] Defer declarations and tentative definitions (#141700)Andy Kaylor
This change adds code to defer emitting declarations and tentative definitions until they are referenced or trigger by a call to CompleteTentativeDefinition. This is needed to avoid premature handling of declarations and definitions that might not be referenced in the current translation unit. It also avoids incorrectly adding an initializer to external declarations. This change also updates the way the insertion location for globals is chosen so that all globals will be emitted together at the top of the module. This makes no functional difference, but it is very useful for writing sensible tests. Some tests are modified in this change to reorder global variables so that they can be checked in the order in which they will be emitted.
2025-05-23[CIR] Add alignment support for global, store, and load ops (#141163)Andy Kaylor
This adds alignment support for GlobalOp, LoadOp, and StoreOp. Tests which failed because cir.store/cir.load now print alignment were updated with wildcard matches, except where the alignment was relevant to the test. Tests which check for cir.store/cir.load in cases that don't have explicit alignment were not updated. New tests for alignment are alignment.c, align-load.c, and align-store.c.
2025-04-24[CIR] Upstream support for name mangling (#137094)Andy Kaylor
We have been using the default names for global symbols to this point. This change introduces proper name mangling for functions. This requires introducing a CXXABI class in the CIRGenModule. Because only target independent name mangling is handled in this patch, the CXXABI class does not require a target-specific implementation. The general mechanism for selecting an implementation is introduced here, but the actual target-specific subclasses are deferred until needed.
2025-04-15[CIR] Upstream ArraySubscriptExpr from function parameter with pointer base ↵Amr Hesham
(#135493) This change adds an ArraySubscriptExpr from the function parameter with base type as Pointer Issue https://github.com/llvm/llvm-project/issues/130197
2025-04-11[CIR] Make LLVM & OGCG variables match the same pattern (#135427)Amr Hesham
Follow-up patch to improve variable names in LLVM and OGCG in https://github.com/llvm/llvm-project/pull/134536
2025-04-11[CIR] Upstream ArraySubscriptExpr for fixed size array (#134536)Amr Hesham
This change adds ArraySubscriptExpr for fixed size ArrayType Issue #130197
2025-04-03[CIR][Upstream] Local initialization for ArrayType (#132974)Amr Hesham
This change adds local initialization for ArrayType Issue #130197
2025-03-31[CIR] Upstream zero init for global variables (#133100)Amr Hesham
This change adds zero initialization for global variables
2025-03-19[CIR] Upstream support for type aliases (#131912)Andy Kaylor
CIR uses aliases for standard integer types and void. This change adds upstream support for those aliases and updates existing tests.
2025-03-19[CIR] Upstream global initialization for ArrayType (#131657)Amr Hesham
This change adds global initialization for ArrayType Issue #130197
2025-03-13[CIR] Upstream basic support for ArrayType (#130502)Amr Hesham
This change adds the basic support for ArrayType Issue #130197