summaryrefslogtreecommitdiff
path: root/clang/test/CIR/CodeGen/loop.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-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-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-05-01[CIR] Upstream support for range-based for loops (#138176)Andy Kaylor
This upstreams the code needed to handle CXXForRangeStmt.
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-04[CIR] Upstream support for break and continue statements (#134181)Andy Kaylor
This adds ClangIR support for break and continue statements in loops. Because only loops are currently implemented upstream in CIR, only breaks in loops are supported here, but this same code will work (with minor changes to the verification and cfg flattening) when switch statements are upstreamed.
2025-04-01[CIR] Upstream support for while and do..while loops (#133157)Andy Kaylor
This adds basic support for while and do..while loops. Support for break and continue are left for a subsequent patch.
2025-03-25[CIR] Emit allocas into the proper lexical scope (#132468)Andy Kaylor
Alloca operations were being emitted into the entry block of the current function unconditionally, even if the variable they represented was declared in a different scope. This change upstreams the code for handling insertion of the alloca into the proper lexcial scope. It also adds a CIR-to-CIR transformation to hoist allocas to the function entry block, which is necessary to produce the expected LLVM IR during lowering.
2025-03-21[CIR] Upstream initial for-loop support (#132266)Andy Kaylor
This change adds support for empty for-loops. This will be the infrastructre needed for complete for loops, but that depends on compare operations, which have not been upstreamed yet.