aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/CIR/CodeGen
AgeCommit message (Collapse)AuthorFilesLines
17 hours[CIR] Implement Type promotion for VectorType (#158715)Amr Hesham1-5/+4
This change adds support for type promotion for VectorType Issue https://github.com/llvm/llvm-project/issues/136487
18 hours[CIR] Add atomic exchange operation (#158089)Sirui Mu1-4/+30
This patch adds atomic exchange operation which covers the following C/C++ intrinsic functions: - `__c11_atomic_exchange` - `__atomic_exchange` - `__atomic_exchange_n`
18 hours[CIR][NFC] Fix Missing Decl::OMPGroupPrivate warning (#159631)Amr Hesham1-1/+1
Fix the Missing enum element `Decl::OMPGroupPrivate` warning
30 hours[CIR] Fix structors for multidimensional arrrays (#159820)Morris Hafner3-10/+31
This patchs implements array constructors and destructors for multidimensional arrays. This works by bitcasting the pointer to the first element to a one-dimensional array type of the same extent before lowering to a loop.
33 hours[CIR] Implement Logical AND for VectorType (#158696)Amr Hesham1-2/+14
This change adds support for local AND op for VectorType Issue https://github.com/llvm/llvm-project/issues/136487
46 hours[Clang][CIR] fix enumeration value 'OMPGroupPrivate' not handled in switch ↵Maksim Levental1-1/+2
(#159694)
2 days[CIR] Implement Logical OR for VectorType (#158668)Amr Hesham1-3/+15
This change adds support for local OR op for VectorType Issue #136487
2 days[CIR] Support type promotion for Scalar unary plus & minus ops (#158486)Amr Hesham1-13/+32
Support type promotion for Scalar unary plus & minus ops
2 days[CIR] Support type promotion for Scalar unary real & imag ops (#158473)Amr Hesham1-27/+41
This change adds support for type promotion in Scalar unary real & imag ops Issue: https://github.com/llvm/llvm-project/issues/141365
2 days[CIR] Implement OpaqueValueExpr for Complex in C (#158423)Amr Hesham2-5/+3
This change adds support for the OpaqueValueExpr for Complex in C Issue: https://github.com/llvm/llvm-project/issues/141365
8 days[CIR] Upstream FPToFPBuiltin CosOp (#158342)Amr Hesham1-0/+13
Upstream support for FPToFPBuiltin CosOp
8 days[CIR] Upstream VisitOpaqueValueExpr support for Complex & Scalar (#157331)Amr Hesham4-4/+59
This change adds support for the OpaqueValueExpr for Complex & Scalar Issue: https://github.com/llvm/llvm-project/issues/141365
9 days[CIR] Upstream FPToFPBuiltin ATanOp (#157496)Amr Hesham1-0/+2
Upstream support for FPToFPBuiltin ATanOp
10 days[CIR] Upstream FPToFPBuiltin ASinOp (#157350)Amr Hesham1-0/+2
Upstream support for FPToFPBuiltin ASinOp
11 days[CIR] Add support for copy elision (#157713)Andy Kaylor5-13/+65
This adds basic support for eliding copy constructors. In order to make this possible, it also adds support for returning structures. This support does not include setting an NRVO flag when the class whose copy is being elided has a non-trivial destructor.
11 days[CIR][NFC] Fix build warnings after #154142 (#157724)Andy Kaylor1-0/+2
A recent change introduced a new dtor kind, which caused a build warning in the CIR code where this dtor kind wasn't handled in a switch. This fixes the problem.
12 days[CIR] Add support for __builtin_alloca (#157116)Morris Hafner1-0/+51
This patch adds support for the alloca builtin and extends AllocaOp with a dynamic size argument.
12 days[CIR] Add support for atomic compare-and-swap (#156253)Sirui Mu1-7/+137
This patch adds support for atomic compare-and-swap operations, including the following C/C++ instrinsics: - `__atomic_compare_exchange` - `__atomic_compare_exchange_n` - `__c11_atomic_compare_exchange_strong` - `__c11_atomic_compare_exchange_weak`
13 days[CIR] Fix assertion order in 'Address' (#157477)Erich Keane1-3/+3
We are checking the 'type' of 'pointer' before we are checking whether it is null or not! This is clearly incorrect, so this patch reorders the asserts.
2025-09-06[clang] Polymorphic Cleanup type is moved despite not being POD types (#156607)Oliver Hunt1-1/+1
Clang as a number of Cleanup types used in exception handling, these are presumed to be POD types that can be memmoved as needed, however this is not correct by default on platforms with pointer authentication that make vtable pointers address discriminated. This PR mitigates this problem by introducing a LLVM_MOVABLE_POLYMORPHIC_TYPE macro that can be used to annotate polymorphic types that are required to be movable, to override the use of address discrimination of the vtable pointer.
2025-09-05[CIR][NFC] Consildate CIRGenExprCXX.cpp files (#157169)Andy Kaylor3-427/+409
Somewhere in the upstreaming process, we created a file CIRGenCXXExpr.cpp that corresponded to the file CIRGenExprCXX.cpp in the incubator. Later we created a CIRGenExprCXX.cpp file. This change consolidates those files, keeping the name used in the incubator.
2025-09-05[CIR] Implement CXX field default initialization (#157140)Andy Kaylor5-14/+76
This adds the code needed to handle default initialization for fields of various types.
2025-09-05[CIR] Add support for delegating constructors with VTT args (#156970)Andy Kaylor1-3/+2
This adds support for handling delegating constructors with VTT arguments.
2025-09-05[OpenACC][NFCI] Split recipe generation into its own class (#157160)Erich Keane2-308/+347
The recipe generation was dependent on the clause kind, which meant we had all of the recipe generation duplicated in each of clauses. This patch copy/pastes all of them into their own type to do recipe generation, which should reduce clang's size. Additionally, we've moved it off into its own file, which should make readability/organization improvements.
2025-09-05[CIR] Fix Complex emit promotion for Div op (#156963)Amr Hesham1-0/+1
This change fixes emitting promotion type for div op Issue: https://github.com/llvm/llvm-project/issues/141365
2025-09-04[CIR] Add constant record ILE support (#155663)Morris Hafner8-23/+700
This patch adds basic support for constant record initializer list expressions. There's a couple of limitations: * No zero initialized padding bytes in C mode * No bitfields * No designated initializer lists * Record alignments are not calculated, yet * ILEs of derived records don't work, yet * The constant attribute is not propagated to the backend, resulting in non-constants being emitted in the LLVM IR
2025-09-04[CIR] Add support for delegating constructor initialization (#156757)Andy Kaylor1-7/+15
This adds support for zero-initialization during delegating constructor processing. Note, this also adds code to skip emitting constructors that are trivial and default to match the classic codegen behavior. The incubator does not skip these constructors, but I have found a case where this results in a call to a default constructor that is never defined.
2025-09-04[OpenACC][NFCI] Split up the init and decl from OpenACC recipes (#156938)Erich Keane1-4/+23
Expressions/references with 'bounds' are going to need to do initialization significantly differently, so we need to have the initializer and the declaration 'separate' in the future. This patch splits the AST node into two, and normalizes them a bit. Additionally, since this required significant work on the recipe generation, this patch also does a bit of a refactor to improve readability and future expansion, now that we have a good understanding of how these are going to look.
2025-09-04[CIR] Finish record layout for classes with virtual bases (#156770)Andy Kaylor1-2/+3
There was a small piece left unimplemented for classes with a primary virtual base. This adds that implementation.
2025-09-03[CIR] Add support for discrete bit-field (#156085)Andres-Salamanca1-1/+49
This PR adds support for the discrete bit-field layout. It is the same as this PR: https://github.com/llvm/clangir/pull/1860
2025-09-03[CIR] Add support for constructors with VTT parameters (#156521)Andy Kaylor13-33/+531
This adds the support for implicit VTT arguments in constructors.
2025-09-03[CIR] Emit copy for aggregate initialization (#155697)Andy Kaylor3-12/+106
This adds the implementation of aggEmitFinalDestCopy for the case where the destination value is not ignored. This requires adding the cir.copy operation and associated interface code.
2025-09-03[OpenACC] Change lowering signature for 'destroy' (#156716)Erich Keane1-3/+7
Patch #156545 is introducing a different syntax for the 'destroy' section of a recipe, which takes the 'original' value as the first argument, and the one-to-be-destroyed as the 2nd. This patch corrects the lowering to match that signature.
2025-09-03[CIR] Upstream Atomic init for ComplexType (#156518)Amr Hesham1-5/+7
This change adds support for Atomic init for ComplexType Issue: https://github.com/llvm/llvm-project/issues/141365
2025-09-03[CIR] Upstream FPToFPBuiltin ACosOp (#156356)Amr Hesham1-0/+11
Upstream support for FPToFPBuiltin ACosOp
2025-09-02[CIR] Add handling for volatile loads and stores (#156124)Andy Kaylor4-10/+46
This fills in the missing pieces to handle volatile loads and stores in CIR. This addresses https://github.com/llvm/llvm-project/issues/153280
2025-09-02[CIR][NFC] Fix build issue after AST modification (#156493)Amr Hesham1-2/+2
Fix the build issue after AST modification
2025-09-02[OpenACC] Add NYI for pointer/VLA arguments to recipes (#156465)Erich Keane1-0/+14
As mentioned in a previous review, we aren't properly generating init/destroy/copy (combiner will need to be done correctly too!) regions for recipe generation. In the case where these have 'bounds', we can do a much better job of figuring out the type and how much needs to be done, but that is going to be its own engineering effort. For now, add an NYI as a note to come back to this.
2025-09-02[CIR][NFC] Reorder GenExprComplex and add errors for unhandled visitors ↵Amr Hesham1-431/+519
(#156241) - Reorder the CIRGenExprComplex functions to be similar to OCG. - Add errors for unhandled visitors. - Rename the test file to be similar to `complex-mul-div`. Issue: https://github.com/llvm/llvm-project/issues/141365
2025-09-02[CIR] Add support for emitting VTTs and related ojects (#155721)Andy Kaylor4-7/+201
This adds support for emitting virtual table tables (VTTs) and construction vtables.
2025-08-30[CIR] Implement VAArgExpr for ComplexType (#156092)Amr Hesham1-0/+6
This change adds support VAArgExpr for ComplexExpr Issue: https://github.com/llvm/llvm-project/issues/141365
2025-08-29[OpenACC] 'reduction' init lowering for +, |, ^, || (#155924)Erich Keane1-7/+15
These four operators have an initial value of 0, so they are able to use C/C++ 'zero init'. This patch adds the infrastructure to the Sema init calculations to differentiate based on the reduction operator, then enables emission of the inits in CodeGen (which should work for all inits, once generated). The rest of this test is just updating validation to make sure that the inits happen correctly for all 4 operators.
2025-08-29[CIR] Complex Unary plus and minus with promoted type (#155486)Amr Hesham1-8/+4
This change adds support for Complex unary plus and minus expressions with promoted type Issue: https://github.com/llvm/llvm-project/issues/141365
2025-08-29[CIR] Upstream Re-Throw with no return (#154994)Amr Hesham6-1/+92
This change adds support for the throw op without sub expression and with noreturn Issue #154992
2025-08-29[CIR] Add value initialization for scalar types (#156036)Morris Hafner1-5/+14
2025-08-29[CIR] DivOp & CompoundAssignmentDiv between ComplexType and ScalarType (#155167)Amr Hesham1-3/+27
This change adds support for DivOp and CompoundAssignmentDiv between ComplexType and ScalarType Issue: https://github.com/llvm/llvm-project/issues/141365
2025-08-28[OpenACC] Partial Reduction recipe Lowering (#155635)Erich Keane1-13/+139
This patch implements basic reduction recipe lowering, plus adds a bunch of tests for it that should be meaningful later. At the moment, all this does is ensure that we get the init 'alloca' set right (the actual initializer isn't done correctly yet, and will be in a followup), an empty combiner (though the type of certain operations probably has to be different as well, when we get to those), and a full-destruction, as we already have the infrastructure for it.
2025-08-27[CIR] Add initial support for virtual base classes (#155534)Andy Kaylor6-72/+169
This adds support for declaring a class with a virtual base class and initializing the vptr in the constructor. This does not yet handle constructors that require a virtual table table (VTT) implicit argument.
2025-08-27[CIR][NFC] Add errors for unhandled AggExprEmitter visitors (#155469)Andy Kaylor1-0/+199
There are a lot of required handlers in AggExprEmitter that are currently missing. Because the ASTVisitor has fallbacks, this means we just silently ignore whatever expressions are not explicitly handled. This patch adds handlers where we know they will be needed and just issues a diagnostic. This exposed failures in a few tests. In one case, we should have handled constant initialization earlier, which would have avoided going to the AggExprEmitter at all. I added a stub with a missing feature marker to allow that case to work as it had. Another test required us to ignore cast expressions that should be ignored, so I partially implemented the cast visitor. Finally, there's a case where the test was just accepting a bad result. I changed that case to XFAIL until it can be properly fixed.
2025-08-27[clang] NFC: reintroduce clang/include/clang/AST/Type.h (#155050)Matheus Izvekov5-5/+5
This reintroduces `Type.h`, having earlier been renamed to `TypeBase.h`, as a redirection to `TypeBase.h`, and redirects most users to include the former instead. This is a preparatory patch for being able to provide inline definitions for `Type` methods which would otherwise cause a circular dependency with `Decl{,CXX}.h`. Doing these operations into their own NFC patch helps the git rename detection logic work, preserving the history. This patch makes clang just a little slower to build (~0.17%), just because it makes more code indirectly include `DeclCXX.h`.