<feed xmlns='http://www.w3.org/2005/Atom'>
<title>llvm-project.git/clang/lib/CIR/CodeGen/CIRGenModule.cpp, branch users/chapuni/cov/single/condop</title>
<subtitle>Unnamed repository; edit this file 'description' to name the repository.
</subtitle>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/'/>
<entry>
<title>[CIR] Upstream initial attribute support (#121069)</title>
<updated>2024-12-28T22:02:15+00:00</updated>
<author>
<name>David Olsen</name>
<email>dolsen@nvidia.com</email>
</author>
<published>2024-12-28T22:02:15+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=8e329593313bb792592529ee825a52683108df99'/>
<id>8e329593313bb792592529ee825a52683108df99</id>
<content type='text'>
Upstream several ClangIR-specific MLIR attributes, in particular
attributes for integer, floating-point, and null pointer constants.
These are the first ClangIR attributes to be upstreamed, so
infrastructure changes are included, such as the table-gen file
`CIRAttrs.td`.

Attributes can be used as the initial values for global variables. The
existing automated test global-var-simple.cpp includes initial values
for some of the global variables in the test.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Upstream several ClangIR-specific MLIR attributes, in particular
attributes for integer, floating-point, and null pointer constants.
These are the first ClangIR attributes to be upstreamed, so
infrastructure changes are included, such as the table-gen file
`CIRAttrs.td`.

Attributes can be used as the initial values for global variables. The
existing automated test global-var-simple.cpp includes initial values
for some of the global variables in the test.</pre>
</div>
</content>
</entry>
<entry>
<title>[CIR] floating-point, pointer, and function types (#120484)</title>
<updated>2024-12-20T20:22:25+00:00</updated>
<author>
<name>David Olsen</name>
<email>dolsen@nvidia.com</email>
</author>
<published>2024-12-20T20:22:25+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=8ae8a905855ca1b07a72059d8225ab1f9cae65dc'/>
<id>8ae8a905855ca1b07a72059d8225ab1f9cae65dc</id>
<content type='text'>
Upstream ClangIR support for `void` type, floating-point types, pointer
types, and function types.

Floating-point support is missing the IBM double-double format, because
that hasn't been implemented in the incubator project yet.

Pointer types do not yet support address spaces.

Function type support includes only the return type and the parameter
types. The many other properties and attributes of function types will
be upstreamed later.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Upstream ClangIR support for `void` type, floating-point types, pointer
types, and function types.

Floating-point support is missing the IBM double-double format, because
that hasn't been implemented in the incubator project yet.

Pointer types do not yet support address spaces.

Function type support includes only the return type and the parameter
types. The many other properties and attributes of function types will
be upstreamed later.</pre>
</div>
</content>
</entry>
<entry>
<title>[CIR] Cleanup: mlirContext and astContext (#119450)</title>
<updated>2024-12-10T21:46:07+00:00</updated>
<author>
<name>David Olsen</name>
<email>dolsen@nvidia.com</email>
</author>
<published>2024-12-10T21:46:07+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=7eb73b95cb336cde14d5c755a09cd880bd3d5df9'/>
<id>7eb73b95cb336cde14d5c755a09cd880bd3d5df9</id>
<content type='text'>
ClangIR CodeGen code uses both `mlir::MLIRContext` and
`clang::ASTContext` objects extensively. Refering to either of those as
just "context" can be confusing.

Change the names of all variables, parameters, and fields in
`clang/lib/CIR/CodeGen` that refer to `MLIRContext` or an `ASTContext`
to be either `mlirContext` or `astContext`.

This change is only the renaming of variables/parameters/fields. There
are no behavior changes. So there are no new tests or changes to
existing tests. This change mimics a recent change in the ClangIR
incubator repository.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
ClangIR CodeGen code uses both `mlir::MLIRContext` and
`clang::ASTContext` objects extensively. Refering to either of those as
just "context" can be confusing.

Change the names of all variables, parameters, and fields in
`clang/lib/CIR/CodeGen` that refer to `MLIRContext` or an `ASTContext`
to be either `mlirContext` or `astContext`.

This change is only the renaming of variables/parameters/fields. There
are no behavior changes. So there are no new tests or changes to
existing tests. This change mimics a recent change in the ClangIR
incubator repository.</pre>
</div>
</content>
</entry>
<entry>
<title>[CIR] Infrastructure: class CIRGenBuilderTy; cache CIR types (#119037)</title>
<updated>2024-12-10T19:29:48+00:00</updated>
<author>
<name>David Olsen</name>
<email>dolsen@nvidia.com</email>
</author>
<published>2024-12-10T19:29:48+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=ffb19f4018e38ba7ff034b78914d5a8d2890a603'/>
<id>ffb19f4018e38ba7ff034b78914d5a8d2890a603</id>
<content type='text'>
Small infrastructure and background changes to ClangIR.

Create class `CIRGenBuilderTy` and its base class `CIRBaseBuilderTy`.
These are mostly empty for now, except for what is inherited from
`mlir::OpBuilder`. But they will fill up quickly as more ClangIR code
gen is upstreamed. `CIRGenModule` and `CIRGenTypes` are changed to use
`CIRGenBuilderTy`.

Add cached types to struct `CIRGenTypeCache` for the integral types that
are currently supported. Initialize those cached types in the
`CIRGenModule` constructor. The first uses of those types (well, one of
them) is in `CIRGenTypes::convertType`.

Have `CIRGenTypes::convertType` cache its results in a map from
`clang::Type` to `mlir::Type`, saving it from having to convert the same
type again and again.

There are no new tests or changed tests in this commit. There are no
changes to behavior, just improvements to how the existing behavior is
implemented.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Small infrastructure and background changes to ClangIR.

Create class `CIRGenBuilderTy` and its base class `CIRBaseBuilderTy`.
These are mostly empty for now, except for what is inherited from
`mlir::OpBuilder`. But they will fill up quickly as more ClangIR code
gen is upstreamed. `CIRGenModule` and `CIRGenTypes` are changed to use
`CIRGenBuilderTy`.

Add cached types to struct `CIRGenTypeCache` for the integral types that
are currently supported. Initialize those cached types in the
`CIRGenModule` constructor. The first uses of those types (well, one of
them) is in `CIRGenTypes::convertType`.

Have `CIRGenTypes::convertType` cache its results in a map from
`clang::Type` to `mlir::Type`, saving it from having to convert the same
type again and again.

There are no new tests or changed tests in this commit. There are no
changes to behavior, just improvements to how the existing behavior is
implemented.</pre>
</div>
</content>
</entry>
<entry>
<title>[CIR] Integral types; simple global variables (#118743)</title>
<updated>2024-12-06T15:01:09+00:00</updated>
<author>
<name>David Olsen</name>
<email>dolsen@nvidia.com</email>
</author>
<published>2024-12-06T15:01:09+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=a43b2e13f9cc69ec7077ea9c74a972e178a2d8f7'/>
<id>a43b2e13f9cc69ec7077ea9c74a972e178a2d8f7</id>
<content type='text'>
Add integral types to ClangIR. These are the first ClangIR types, so the
change includes some infrastructure for managing ClangIR types.

So that the integral types can be used somewhere, generate ClangIR for
global variables using the new `cir.global` op. As with the current
support for functions, global variables are just a stub at the moment.
The only properties that global variables have are a name and a type.

Add a new ClangIR code gen test global-var-simple.cpp, which defines
global variables with most of the integral types.

(Part of upstreaming the ClangIR incubator project into LLVM.)</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Add integral types to ClangIR. These are the first ClangIR types, so the
change includes some infrastructure for managing ClangIR types.

So that the integral types can be used somewhere, generate ClangIR for
global variables using the new `cir.global` op. As with the current
support for functions, global variables are just a stub at the moment.
The only properties that global variables have are a name and a type.

Add a new ClangIR code gen test global-var-simple.cpp, which defines
global variables with most of the integral types.

(Part of upstreaming the ClangIR incubator project into LLVM.)</pre>
</div>
</content>
</entry>
<entry>
<title>[clang][CIR] Change buildX functions to emitX (#115568)</title>
<updated>2024-11-12T17:56:25+00:00</updated>
<author>
<name>Shoaib Meenai</name>
<email>smeenai@fb.com</email>
</author>
<published>2024-11-12T17:56:25+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=1791b25f43f4e6a0b21284ce8076cfab160cb61a'/>
<id>1791b25f43f4e6a0b21284ce8076cfab160cb61a</id>
<content type='text'>
The buildX naming convention originated when the CIRGen implementation
was planned to be substantially different from original CodeGen. CIRGen
is now a much closer adaption of CodeGen, and the emitX to buildX
renaming just makes things more confusing, since CodeGen also has some
helper functions whose names start with build or Build, so it's not
immediately clear which CodeGen function corresponds to a CIRGen buildX
function. Rename the buildX functions back to emitX to fix this.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The buildX naming convention originated when the CIRGen implementation
was planned to be substantially different from original CodeGen. CIRGen
is now a much closer adaption of CodeGen, and the emitX to buildX
renaming just makes things more confusing, since CodeGen also has some
helper functions whose names start with build or Build, so it's not
immediately clear which CodeGen function corresponds to a CIRGen buildX
function. Rename the buildX functions back to emitX to fix this.</pre>
</div>
</content>
</entry>
<entry>
<title>[clang][CIR] Merge the mlir::cir namespace into cir (#115386)</title>
<updated>2024-11-08T18:43:28+00:00</updated>
<author>
<name>Shoaib Meenai</name>
<email>smeenai@fb.com</email>
</author>
<published>2024-11-08T18:43:28+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=c72389d4feef9eafc902f99c41f85ed218b5bedf'/>
<id>c72389d4feef9eafc902f99c41f85ed218b5bedf</id>
<content type='text'>
https://github.com/llvm/clangir/issues/1025 discusses the motivation.
The mechanical parts of this change were done via:

find clang \( -name '*.h' -o -name '*.cpp' -o -name '*.td' \) -print0 |
xargs -0 perl -pi -e 's/mlir::cir/cir/g'
find clang \( -name '*.h' -o -name '*.cpp' \) -print0 | xargs -0 perl
-pi -e 's/::cir/cir/g'

There were some manual fixups and a clang-format run afterwards.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
https://github.com/llvm/clangir/issues/1025 discusses the motivation.
The mechanical parts of this change were done via:

find clang \( -name '*.h' -o -name '*.cpp' -o -name '*.td' \) -print0 |
xargs -0 perl -pi -e 's/mlir::cir/cir/g'
find clang \( -name '*.h' -o -name '*.cpp' \) -print0 | xargs -0 perl
-pi -e 's/::cir/cir/g'

There were some manual fixups and a clang-format run afterwards.</pre>
</div>
</content>
</entry>
<entry>
<title>[clang][CIR] Move CIRGen types into clang::CIRGen (#115385)</title>
<updated>2024-11-08T18:41:39+00:00</updated>
<author>
<name>Shoaib Meenai</name>
<email>smeenai@fb.com</email>
</author>
<published>2024-11-08T18:41:39+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=40e545098e8bb5a18988316331e46c4557378afa'/>
<id>40e545098e8bb5a18988316331e46c4557378afa</id>
<content type='text'>
https://github.com/llvm/clangir/issues/1025 explains why we want to move
the CIR dialect from the `mlir::cir` to the `cir` namespace. To avoid
overloading the `cir` namespace too much afterwards, move all symbols
whose equivalents live inside the `clang::CodeGen` namespace to a new
`clang::CIRGen` namespace, so that we match the original CodeGen's
structure more closely.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
https://github.com/llvm/clangir/issues/1025 explains why we want to move
the CIR dialect from the `mlir::cir` to the `cir` namespace. To avoid
overloading the `cir` namespace too much afterwards, move all symbols
whose equivalents live inside the `clang::CodeGen` namespace to a new
`clang::CIRGen` namespace, so that we match the original CodeGen's
structure more closely.</pre>
</div>
</content>
</entry>
<entry>
<title>[CIR] Call code gen; create empty cir.func op (#113483)</title>
<updated>2024-11-05T19:16:30+00:00</updated>
<author>
<name>David Olsen</name>
<email>dolsen@nvidia.com</email>
</author>
<published>2024-11-05T19:16:30+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=c695a32576525b047f92b90de71eb707c152e29c'/>
<id>c695a32576525b047f92b90de71eb707c152e29c</id>
<content type='text'>
Finish hooking up ClangIR code gen into the Clang control flow,
initializing enough that basic code gen is possible.

Add an almost empty `cir.func` op to the ClangIR dialect. Currently the
only property of the function is its name. Add the code necessary to
code gen a cir.func op.

Create essentially empty files
clang/lib/CIR/Dialect/IR/{CIRAttrs.cpp,CIRTypes.cpp}. These will be
filled in later as attributes and types are defined in the ClangIR
dialect.

(Part of upstreaming the ClangIR incubator project into LLVM.)</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Finish hooking up ClangIR code gen into the Clang control flow,
initializing enough that basic code gen is possible.

Add an almost empty `cir.func` op to the ClangIR dialect. Currently the
only property of the function is its name. Add the code necessary to
code gen a cir.func op.

Create essentially empty files
clang/lib/CIR/Dialect/IR/{CIRAttrs.cpp,CIRTypes.cpp}. These will be
filled in later as attributes and types are defined in the ClangIR
dialect.

(Part of upstreaming the ClangIR incubator project into LLVM.)</pre>
</div>
</content>
</entry>
<entry>
<title>[CIR] Build out AST consumer patterns to reach the entry point into CIRGen</title>
<updated>2024-10-09T18:20:50+00:00</updated>
<author>
<name>Nathan Lanza</name>
<email>nathanlanza@gmail.com</email>
</author>
<published>2024-10-09T18:20:50+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=1bb52e94621d2cba4f34504697cb0ea83805cb98'/>
<id>1bb52e94621d2cba4f34504697cb0ea83805cb98</id>
<content type='text'>
Build out the necessary infrastructure for the main entry point into
ClangIR generation -- CIRGenModule. A set of boilerplate classes exist
to facilitate this -- CIRGenerator, CIRGenAction, EmitCIRAction and
CIRGenConsumer. These all mirror the corresponding types from LLVM
generation by Clang's CodeGen.

The main entry point to CIR generation is
`CIRGenModule::buildTopLevelDecl`. It is currently just an empty
function. We've added a test to ensure that the pipeline reaches this
point and doesn't fail, but does nothing else. This will be removed in
one of the subsequent patches that'll add basic `cir.func` emission.

This patch also re-adds `-emit-cir` to the driver. lib/Driver/Driver.cpp
requires that a driver flag exists to facilirate the selection of the
right actions for the driver to create. Without a driver flag you get
the standard behaviors of `-S`, `-c`, etc. If we want to emit CIR IR
and, eventually, bytecode we'll need a driver flag to force this. This
is why `-emit-llvm` is a driver flag. Notably, `-emit-llvm-bc` as a cc1
flag doesn't ever do the right thing. Without a driver flag it is
incorrectly ignored and an executable is emitted. With `-S` a file named
`something.s` is emitted which actually contains bitcode.

Reviewers: AaronBallman, MaskRay, bcardosolopes

Reviewed By: bcardosolopes, AaronBallman

Pull Request: https://github.com/llvm/llvm-project/pull/91007
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Build out the necessary infrastructure for the main entry point into
ClangIR generation -- CIRGenModule. A set of boilerplate classes exist
to facilitate this -- CIRGenerator, CIRGenAction, EmitCIRAction and
CIRGenConsumer. These all mirror the corresponding types from LLVM
generation by Clang's CodeGen.

The main entry point to CIR generation is
`CIRGenModule::buildTopLevelDecl`. It is currently just an empty
function. We've added a test to ensure that the pipeline reaches this
point and doesn't fail, but does nothing else. This will be removed in
one of the subsequent patches that'll add basic `cir.func` emission.

This patch also re-adds `-emit-cir` to the driver. lib/Driver/Driver.cpp
requires that a driver flag exists to facilirate the selection of the
right actions for the driver to create. Without a driver flag you get
the standard behaviors of `-S`, `-c`, etc. If we want to emit CIR IR
and, eventually, bytecode we'll need a driver flag to force this. This
is why `-emit-llvm` is a driver flag. Notably, `-emit-llvm-bc` as a cc1
flag doesn't ever do the right thing. Without a driver flag it is
incorrectly ignored and an executable is emitted. With `-S` a file named
`something.s` is emitted which actually contains bitcode.

Reviewers: AaronBallman, MaskRay, bcardosolopes

Reviewed By: bcardosolopes, AaronBallman

Pull Request: https://github.com/llvm/llvm-project/pull/91007
</pre>
</div>
</content>
</entry>
</feed>
