aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/CIR
AgeCommit message (Collapse)AuthorFilesLines
20 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
20 hours[CIR] Add atomic exchange operation (#158089)Sirui Mu2-4/+41
This patch adds atomic exchange operation which covers the following C/C++ intrinsic functions: - `__c11_atomic_exchange` - `__atomic_exchange` - `__atomic_exchange_n`
20 hours[CIR][NFC] Fix Missing Decl::OMPGroupPrivate warning (#159631)Amr Hesham1-1/+1
Fix the Missing enum element `Decl::OMPGroupPrivate` warning
32 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.
35 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
36 hours[CIR] Upstream TypeInfo attribute (#159426)Amr Hesham2-4/+32
This change adds support for TypeInfoAttr which is needed later for RTTI in exceptions Issue https://github.com/llvm/llvm-project/issues/154992
2 days[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
3 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
3 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
3 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
3 days[CIR][NFC] Use TableGen to generate LLVM lowering patterns (#159390)Sirui Mu2-875/+7
Most lowering patterns have exactly the same class declaration with different names and different `matchAndRewrite` implementations, yet their declaration occupies near 1000 lines of code in `LowerToLLVM.h`, making this file difficult to read and boring to maintain. In this patch, I migrate their declarations to be generated from `CIROps.td` using `clang-tblgen`. Some extra `CIR_Op` TableGen fields are introduced to help this: - The `CIR_Op` class now defines a `bit` field `hasLLVMLowering` which defaults to `true`. If its value is `true`, `clang-tblgen` would generate an LLVM lowering pattern declaration for the operation. - Some LLVM lowering patterns has bounded recursion. This could be enabled by setting the `isLLVMLoweringRecursive` field in a `CIR_Op` record to `true`. - Some LLVM lowering patterns have defined additional class members. They could be listed in the `extraLLVMLoweringPatternDecl` field. Note that in the incubator we have a similar TableGen code generator that generates LLVM lowering code for CIR builtin ops which has a one-to-one correspondence to LLVM dialect operations. This patch does NOT try to upstream it. Some additional noticeable changes made by this patch: - This patch adds the `dataLayout` member to every LLVM lowering pattern class to make the job easier for a code generator. In the future we might want to add more members to the lowering patterns, and we will need to update the code generator to make such changes.
7 days[CIR][NFC] Remove Covered MissingFeatures flags for Complex (#158425)Amr Hesham2-5/+0
Remove Covered MissingFeatures flags for Complex
8 days[CIR] Upstream FPToFPBuiltin CosOp (#158342)Amr Hesham3-0/+31
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
10 days[CIR] Upstream FPToFPBuiltin ATanOp (#157496)Amr Hesham3-0/+20
Upstream support for FPToFPBuiltin ATanOp
11 days[CIR] Upstream FPToFPBuiltin ASinOp (#157350)Amr Hesham3-0/+20
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 Hafner3-4/+59
This patch adds support for the alloca builtin and extends AllocaOp with a dynamic size argument.
13 days[CIR] Add support for atomic compare-and-swap (#156253)Sirui Mu4-27/+207
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.
13 days[CIR] Fix lowering after 2929a2978cc3bdb0ff12a0e5d0a9236ff221f668Michael Liao1-4/+2
- After 2929a2978cc3bdb0ff12a0e5d0a9236ff221f668, `ConversionPatternRewriter::replaceAllUsesWith` behavior is changed from the previous immediate mode into a delayed fashion. The legacy operation of `replaceAllUsesWith` followed by `eraseOp` is no longer working, replace that sequence with `replaceOp`.
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 Hafner9-23/+710
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 Kaylor2-7/+24
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 Kaylor14-35/+532
This adds the support for implicit VTT arguments in constructors.
2025-09-03[CIR] Emit copy for aggregate initialization (#155697)Andy Kaylor7-12/+182
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 Hesham3-0/+30
Upstream support for FPToFPBuiltin ACosOp
2025-09-02[CIR] Add handling for volatile loads and stores (#156124)Andy Kaylor5-14/+51
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 Kaylor5-16/+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 Hesham9-5/+161
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