Age | Commit message (Collapse) | Author | Files | Lines |
|
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.
|
|
This change adds support for Atomic init for ComplexType
Issue: https://github.com/llvm/llvm-project/issues/141365
|
|
Upstream support for FPToFPBuiltin ACosOp
|
|
This fills in the missing pieces to handle volatile loads and stores in
CIR.
This addresses https://github.com/llvm/llvm-project/issues/153280
|
|
Fix the build issue after AST modification
|
|
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.
|
|
(#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
|
|
This adds support for emitting virtual table tables (VTTs) and
construction vtables.
|
|
This change adds support VAArgExpr for ComplexExpr
Issue: https://github.com/llvm/llvm-project/issues/141365
|
|
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.
|
|
This change adds support for Complex unary plus and minus expressions
with promoted type
Issue: https://github.com/llvm/llvm-project/issues/141365
|
|
This change adds support for the throw op without sub expression and
with noreturn
Issue #154992
|
|
|
|
This change adds support for DivOp and CompoundAssignmentDiv between
ComplexType and ScalarType
Issue: https://github.com/llvm/llvm-project/issues/141365
|
|
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.
|
|
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.
|
|
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.
|
|
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`.
|
|
This is a preparatory patch, to be able to provide inline definitions
for `Type` functions which depend on `Decl{,CXX}.h`. As the latter also
depends on `Type.h`, this would not be possible without some
reorganizing.
Splitting this rename into its own patch allows git to track this as a
rename, and preserve all git history, and not force any code
reformatting.
A later NFC patch will reintroduce `Type.h` as redirection to
`TypeBase.h`, rewriting most places back to directly including `Type.h`
instead of `TypeBase.h`, leaving only a handful of places where this is
necessary.
Then yet a later patch will exploit this by making more stuff inline.
|
|
This patch adds support for `__atomic_load_n` and `__atomic_store_n`
that were missed by #153814.
|
|
This adds support for initializing the vptr members in a class that
requires multiple vtables because of multiple inheritence. This still
does not handle virtual bases.
|
|
TagDecls (#155463)
And make use of those.
These changes are split from prior PR #155028, in order to decrease the
size of that PR and facilitate review.
|
|
This adds the definition, verification, and lowering for CIR's
VTTAddrPointOp. This is a bit ahead of the current codegen
implementation, which doesn't yet have support for emitting VTT
definitions, but since this doesn't depend on any of the other work in
progress, it is being upstreamed in advance.
|
|
I realized while messing with other things that I'd written all of the
recipe tests for C++, so this patch adds a bunch of tests for C mode.
The assert wasn't quite accurate (as C default init doesn't really do
anything/have an AST node), so that is corrected. Also, the lack of
cir.copy causes some of the firstprivate tests to be incomplete, so
added TODOs for that as well.
|
|
This changes a bunch of places which use getAs<TagType>, including
derived types, just to obtain the tag definition.
This is preparation for #155028, offloading all the changes that PR used
to introduce which don't depend on any new helpers.
|
|
This change adds support for emitting multiple tables in a global vtable
object to handle the case of multiple-inheritence.
|
|
This change adds support for the division operation between two complex
types
Issue: #141365
|
|
This adds verification for the initializer, if present, of any global
passed to the `cir.vtable.address_point` op.
|
|
The getCIRSourceLanguage wasn't returning a value if the source language
was anything other than C or C++. This change updates that function to
return a std::optional value and only adds the source language attribute
if one was returned.
|
|
This adds a simplified version of the code to emit vtables. It does not
yet handle RTTI or cases that require multiple vtables.
|
|
Add upstream support for handling implicit FunctionToPointerDecay casts
|
|
This adds the #cir.vtable attribute definition and verification.
Generation of the vtable will be implemented in a later change.
|
|
This patch upstreams `SourceLangAttr` and its CodeGen logic in the CGM,
which encodes the source language in CIR.
|
|
This PR upstreams the GotoSolver pass.
It works by walking the function and matching each label to a goto. If a
label is not matched to a goto, it is removed and not lowered.
|
|
|
|
This fixes a warning about having a default case in a fully covered enum
switch statement.
|
|
This patch adds support for atomic loads and stores. Specifically, it
adds support for the following intrinsic calls:
- `__atomic_load` and `__atomic_store`;
- `__c11_atomic_load` and `__c11_atomic_store`.
|
|
|
|
This patch adds the constant attribute to cir.global, the appropriate
lowering to LLVM constant and updates the tests.
---------
Co-authored-by: Andy Kaylor <akaylor@nvidia.com>
|
|
Part of https://github.com/llvm/llvm-project/issues/153286.
Depends on https://github.com/llvm/llvm-project/pull/153819.
This patch adds support for __builtin_va_arg by adding the cir.va.arg
operator. Unlike the incubator it doesn't depend on any target specific
lowering (yet) but maps to llvm.va_arg.
|
|
This patch enables the record layout computation of types that are
derived more than once.
|
|
This change adds support for MemberExpr with VarDecl ComplexType
Issue: https://github.com/llvm/llvm-project/issues/141365
|
|
This PR fixes the access to bitfields inside a union.
Previously, we were using a `getMemberOp` to access the field, but
because it is a union, `getMemberOp` would always use index `0`.
For example, given:
```c
typedef union {
int x;
int y : 4;
int z : 8;
} demo;
```
```mlir
!rec_demo = !cir.record<union "demo" {!s32i, !u8i, !u8i}>
```
In the case of:
```c
d.y = 2;
```
It would generate:
```mlir
cir.get_member %0[0] {name = "y"} : !cir.ptr<!rec_demo> -> !cir.ptr<!s32i>
```
with a return type of `!s32i`, when it should be `!u8i`.
the get_member verifier would detect that the return type does not match
the `y` member.
To fix this, we now use `bitcast` to get the start of the union.
|
|
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.
|
|
This patch fixes a regression introduced by #153819. The evaluation
order of the arguments to `emitVAStart` is unspecified, but the test
requires the arguments to be evaluated in left-to-right order.
It's a bit strange that the pre-merge checks did not catch this. The
tests failed on my local machine, which runs Fedora 42 with gcc 15.2.1 .
|
|
This patch is the last of the 'firstprivate' clause lowering patches. It
takes the already generated 'copy' init from Sema and uses it to
generate the IR for the copy section of the recipe.
However, one thing that this patch had to do, was come up with a way to
hijack the decl registration in CIRGenFunction. Because these decls are
being created in a 'different' place, we need to remove the things we've
added. We could alternatively generate these 'differently', but it seems
worth a little extra effort here to avoid having to re-implement
variable initialization.
|
|
This change adds support for the MemberExpr ComplexType
Issue: https://github.com/llvm/llvm-project/issues/141365
|
|
Depends on #153625
This patch adds support for statement expressions. It also changes
emitCompoundStmt and emitCompoundStmtWithoutScope to accept an Address
that the optional result is written to. This allows the creation of the
alloca ahead of the creation of the scope which saves us from hoisting
the alloca to its parent scope.
|
|
Part of #153286
|
|
operands (#153546)
- Part of #153267
https://github.com/llvm/clangir/blob/main/clang/lib/CIR/CodeGen/CIRAsm.cpp
|