<feed xmlns='http://www.w3.org/2005/Atom'>
<title>llvm-project.git/clang/lib/CodeGen/CGExprAgg.cpp, branch users/nico/python-1</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>[KeyInstr][Clang] Aggregate init + copy (#134639)</title>
<updated>2025-05-22T16:35:49+00:00</updated>
<author>
<name>Orlando Cazalet-Hyams</name>
<email>orlando.hyams@sony.com</email>
</author>
<published>2025-05-22T16:35:49+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=0ee40ca5ccbf036179ee11530cc91de7d31131aa'/>
<id>0ee40ca5ccbf036179ee11530cc91de7d31131aa</id>
<content type='text'>
This patch is part of a stack that teaches Clang to generate Key Instructions
metadata for C and C++.

RFC:
https://discourse.llvm.org/t/rfc-improving-is-stmt-placement-for-better-interactive-debugging/82668

The feature is only functional in LLVM if LLVM is built with CMake flag
LLVM_EXPERIMENTAL_KEY_INSTRUCTIONs. Eventually that flag will be removed.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This patch is part of a stack that teaches Clang to generate Key Instructions
metadata for C and C++.

RFC:
https://discourse.llvm.org/t/rfc-improving-is-stmt-placement-for-better-interactive-debugging/82668

The feature is only functional in LLVM if LLVM is built with CMake flag
LLVM_EXPERIMENTAL_KEY_INSTRUCTIONs. Eventually that flag will be removed.</pre>
</div>
</content>
</entry>
<entry>
<title>[clang] Remove redundant control flow statements (NFC) (#140359)</title>
<updated>2025-05-17T19:59:47+00:00</updated>
<author>
<name>Kazu Hirata</name>
<email>kazu@google.com</email>
</author>
<published>2025-05-17T19:59:47+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=f9f69dac2a63afd9b317033bfe055a174bdd180f'/>
<id>f9f69dac2a63afd9b317033bfe055a174bdd180f</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>[clang] Remove unused local variables (NFC) (#138453)</title>
<updated>2025-05-04T17:51:40+00:00</updated>
<author>
<name>Kazu Hirata</name>
<email>kazu@google.com</email>
</author>
<published>2025-05-04T17:51:40+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=f002f300c5e1f9ce8adf00441b7e879fec36a071'/>
<id>f002f300c5e1f9ce8adf00441b7e879fec36a071</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>[CodeGen] Don't include CGDebugInfo.h in CodeGenFunction.h (NFC) (#134100)</title>
<updated>2025-04-03T06:04:19+00:00</updated>
<author>
<name>Nikita Popov</name>
<email>npopov@redhat.com</email>
</author>
<published>2025-04-03T06:04:19+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=b384d6d6ccc8f4452cd7086061c657ce76b41224'/>
<id>b384d6d6ccc8f4452cd7086061c657ce76b41224</id>
<content type='text'>
This is an expensive header, only include it where needed. Move some
functions out of line to achieve that.

This reduces time to build clang by ~0.5% in terms of instructions
retired.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This is an expensive header, only include it where needed. Move some
functions out of line to achieve that.

This reduces time to build clang by ~0.5% in terms of instructions
retired.</pre>
</div>
</content>
</entry>
<entry>
<title>[NFC] Fix Sanitizer breakage introduced in #128166 (#128990)</title>
<updated>2025-02-27T02:46:27+00:00</updated>
<author>
<name>Alex Voicu</name>
<email>alexandru.voicu@amd.com</email>
</author>
<published>2025-02-27T02:46:27+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=a2fac3f87be563cb588040c385f48b71cddf31e9'/>
<id>a2fac3f87be563cb588040c385f48b71cddf31e9</id>
<content type='text'>
Remove accidental leftover unused variable.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Remove accidental leftover unused variable.</pre>
</div>
</content>
</entry>
<entry>
<title>[clang][CodeGen] Additional fixes for #114062 (#128166)</title>
<updated>2025-02-27T02:03:17+00:00</updated>
<author>
<name>Alex Voicu</name>
<email>alexandru.voicu@amd.com</email>
</author>
<published>2025-02-27T02:03:17+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=c8f70d7286db0eb54b001a6621a863b96c006e45'/>
<id>c8f70d7286db0eb54b001a6621a863b96c006e45</id>
<content type='text'>
This addresses two issues introduced by moving indirect args into an
explicit AS (please see
&lt;https://github.com/llvm/llvm-project/pull/114062#issuecomment-2659829790&gt;
and
&lt;https://github.com/llvm/llvm-project/pull/114062#issuecomment-2661158477&gt;):

1. Unconditionally stripping casts from a pre-allocated return slot was
incorrect / insufficient (this is illustrated by the
`amdgcn_sret_ctor.cpp` test);
2. Putting compiler manufactured sret args in a non default AS can lead
to a C-cast (surprisingly) requiring an AS cast (this is illustrated by
the `sret_cast_with_nonzero_alloca_as.cpp test).

The way we handle (2), by subverting CK_BitCast emission iff a sret arg
is involved, is quite naff, but I couldn't think of any other way to use
a non default indirect AS and make this case work (hopefully this is a
failure of imagination on my part).</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This addresses two issues introduced by moving indirect args into an
explicit AS (please see
&lt;https://github.com/llvm/llvm-project/pull/114062#issuecomment-2659829790&gt;
and
&lt;https://github.com/llvm/llvm-project/pull/114062#issuecomment-2661158477&gt;):

1. Unconditionally stripping casts from a pre-allocated return slot was
incorrect / insufficient (this is illustrated by the
`amdgcn_sret_ctor.cpp` test);
2. Putting compiler manufactured sret args in a non default AS can lead
to a C-cast (surprisingly) requiring an AS cast (this is illustrated by
the `sret_cast_with_nonzero_alloca_as.cpp test).

The way we handle (2), by subverting CK_BitCast emission iff a sret arg
is involved, is quite naff, but I couldn't think of any other way to use
a non default indirect AS and make this case work (hopefully this is a
failure of imagination on my part).</pre>
</div>
</content>
</entry>
<entry>
<title>[HLSL] Implement HLSL intialization list support (#123141)</title>
<updated>2025-02-15T19:21:36+00:00</updated>
<author>
<name>Chris B</name>
<email>chris.bieneman@me.com</email>
</author>
<published>2025-02-15T19:21:36+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=761d422441c0e6822abb233d339fab4f3cf7f60a'/>
<id>761d422441c0e6822abb233d339fab4f3cf7f60a</id>
<content type='text'>
This PR implements HLSL's initialization list behvaior as specified in
the draft language specifcation under

[*Decl.Init.Agg*](https://microsoft.github.io/hlsl-specs/specs/hlsl.html#Decl.Init.Agg).

This behavior is a bit unusual for C/C++ because intermediate braces in
initializer lists are ignored and a whole array of additional
conversions occur unintuitively to how initializaiton works in C.

The implementaiton in this PR generates a valid C/C++ initialization
list AST for the HLSL initializer so that there are no changes required
to Clang's CodeGen to support this. This design will also allow us to
use Clang's rewrite to convert HLSL initializers to valid C/C++
initializers that are equivalent. It does have the downside that it will
generate often redundant accesses during codegen. The IR optimizer is
extremely good at eliminating those so this will have no impact on the
final executable performance.

There is some opportunity for optimizing the initializer list generation
that we could consider in subsequent commits. One notable opportunity
would be to identify aggregate objects that occur in the same place in
both initializers and do not require converison, those aggregates could
be initialized as aggregates rather than fully scalarized.

Closes #56067

---------

Co-authored-by: Finn Plummer &lt;50529406+inbelic@users.noreply.github.com&gt;
Co-authored-by: Helena Kotas &lt;hekotas@microsoft.com&gt;
Co-authored-by: Justin Bogner &lt;mail@justinbogner.com&gt;</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This PR implements HLSL's initialization list behvaior as specified in
the draft language specifcation under

[*Decl.Init.Agg*](https://microsoft.github.io/hlsl-specs/specs/hlsl.html#Decl.Init.Agg).

This behavior is a bit unusual for C/C++ because intermediate braces in
initializer lists are ignored and a whole array of additional
conversions occur unintuitively to how initializaiton works in C.

The implementaiton in this PR generates a valid C/C++ initialization
list AST for the HLSL initializer so that there are no changes required
to Clang's CodeGen to support this. This design will also allow us to
use Clang's rewrite to convert HLSL initializers to valid C/C++
initializers that are equivalent. It does have the downside that it will
generate often redundant accesses during codegen. The IR optimizer is
extremely good at eliminating those so this will have no impact on the
final executable performance.

There is some opportunity for optimizing the initializer list generation
that we could consider in subsequent commits. One notable opportunity
would be to identify aggregate objects that occur in the same place in
both initializers and do not require converison, those aggregates could
be initialized as aggregates rather than fully scalarized.

Closes #56067

---------

Co-authored-by: Finn Plummer &lt;50529406+inbelic@users.noreply.github.com&gt;
Co-authored-by: Helena Kotas &lt;hekotas@microsoft.com&gt;
Co-authored-by: Justin Bogner &lt;mail@justinbogner.com&gt;</pre>
</div>
</content>
</entry>
<entry>
<title>[HLSL] Implement HLSL Aggregate splatting (#118992)</title>
<updated>2025-02-14T17:25:24+00:00</updated>
<author>
<name>Sarah Spall</name>
<email>sarahspall@microsoft.com</email>
</author>
<published>2025-02-14T17:25:24+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=4d2d0afceeb732a5238c2167ab7a6b88cc66d976'/>
<id>4d2d0afceeb732a5238c2167ab7a6b88cc66d976</id>
<content type='text'>
Implement HLSL Aggregate Splat casting that handles splatting for arrays
and structs, and vectors if splatting from a vec1.
Closes #100609 and Closes #100619 
Depends on #118842</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Implement HLSL Aggregate Splat casting that handles splatting for arrays
and structs, and vectors if splatting from a vec1.
Closes #100609 and Closes #100619 
Depends on #118842</pre>
</div>
</content>
</entry>
<entry>
<title>[clang][CodeGen] `sret` args should always point to the `alloca` AS, so use that (#114062)</title>
<updated>2025-02-14T11:20:45+00:00</updated>
<author>
<name>Alex Voicu</name>
<email>alexandru.voicu@amd.com</email>
</author>
<published>2025-02-14T11:20:45+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=39ec9de7c23063b87f5c56f4e80c8d0f8b511a4b'/>
<id>39ec9de7c23063b87f5c56f4e80c8d0f8b511a4b</id>
<content type='text'>
`sret` arguments are always going to reside in the stack/`alloca`
address space, which makes the current formulation where their AS is
derived from the pointee somewhat quaint. This patch ensures that `sret`
ends up pointing to the `alloca` AS in IR function signatures, and also
guards agains trying to pass a casted `alloca`d pointer to a `sret` arg,
which can happen for most languages, when compiled for targets that have
a non-zero `alloca` AS (e.g. AMDGCN) / map `LangAS::default` to a
non-zero value (SPIR-V). A target could still choose to do something
different here, by e.g. overriding `classifyReturnType` behaviour.

In a broader sense, this patch extends non-aliased indirect args to also
carry an AS, which leads to changing the `getIndirect()` interface. At
the moment we're only using this for (indirect) returns, but it allows
for future handling of indirect args themselves. We default to using the
AllocaAS as that matches what Clang is currently doing, however if, in
the future, a target would opt for e.g. placing indirect returns in some
other storage, with another AS, this will require revisiting.

---------

Co-authored-by: Matt Arsenault &lt;arsenm2@gmail.com&gt;
Co-authored-by: Matt Arsenault &lt;Matthew.Arsenault@amd.com&gt;</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
`sret` arguments are always going to reside in the stack/`alloca`
address space, which makes the current formulation where their AS is
derived from the pointee somewhat quaint. This patch ensures that `sret`
ends up pointing to the `alloca` AS in IR function signatures, and also
guards agains trying to pass a casted `alloca`d pointer to a `sret` arg,
which can happen for most languages, when compiled for targets that have
a non-zero `alloca` AS (e.g. AMDGCN) / map `LangAS::default` to a
non-zero value (SPIR-V). A target could still choose to do something
different here, by e.g. overriding `classifyReturnType` behaviour.

In a broader sense, this patch extends non-aliased indirect args to also
carry an AS, which leads to changing the `getIndirect()` interface. At
the moment we're only using this for (indirect) returns, but it allows
for future handling of indirect args themselves. We default to using the
AllocaAS as that matches what Clang is currently doing, however if, in
the future, a target would opt for e.g. placing indirect returns in some
other storage, with another AS, this will require revisiting.

---------

Co-authored-by: Matt Arsenault &lt;arsenm2@gmail.com&gt;
Co-authored-by: Matt Arsenault &lt;Matthew.Arsenault@amd.com&gt;</pre>
</div>
</content>
</entry>
<entry>
<title>[HLSL] Implement HLSL Elementwise casting (excluding splat cases); Re-land #118842 (#126258)</title>
<updated>2025-02-07T17:12:55+00:00</updated>
<author>
<name>Sarah Spall</name>
<email>sarahspall@microsoft.com</email>
</author>
<published>2025-02-07T17:12:55+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=3f8e2802069aabe4384ecd4575d50fd4457dae51'/>
<id>3f8e2802069aabe4384ecd4575d50fd4457dae51</id>
<content type='text'>
Implement HLSLElementwiseCast excluding support for splat cases
Do not support casting types that contain bitfields.
Partly closes https://github.com/llvm/llvm-project/issues/100609 and
partly closes https://github.com/llvm/llvm-project/issues/100619
Re-land #118842 after fixing warning as an error, found by a buildbot.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Implement HLSLElementwiseCast excluding support for splat cases
Do not support casting types that contain bitfields.
Partly closes https://github.com/llvm/llvm-project/issues/100609 and
partly closes https://github.com/llvm/llvm-project/issues/100619
Re-land #118842 after fixing warning as an error, found by a buildbot.</pre>
</div>
</content>
</entry>
</feed>
