<feed xmlns='http://www.w3.org/2005/Atom'>
<title>llvm-project.git/clang/test/OpenMP/sections_firstprivate_codegen.cpp, branch main</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>[clang][CodeGen] Set `dead_on_return` when passing arguments indirectly</title>
<updated>2025-07-18T09:50:18+00:00</updated>
<author>
<name>Antonio Frighetto</name>
<email>me@antoniofrighetto.com</email>
</author>
<published>2025-07-18T08:59:42+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=9e0c06d708a40bb3c8bd08acd982836cce718135'/>
<id>9e0c06d708a40bb3c8bd08acd982836cce718135</id>
<content type='text'>
Let Clang emit `dead_on_return` attribute on pointer arguments
that are passed indirectly, namely, large aggregates that the
ABI mandates be passed by value; thus, the parameter is destroyed
within the callee. Writes to such arguments are not observable by
the caller after the callee returns.

This should desirably enable further MemCpyOpt/DSE optimizations.

Previous discussion: https://discourse.llvm.org/t/rfc-add-dead-on-return-attribute/86871.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Let Clang emit `dead_on_return` attribute on pointer arguments
that are passed indirectly, namely, large aggregates that the
ABI mandates be passed by value; thus, the parameter is destroyed
within the callee. Writes to such arguments are not observable by
the caller after the callee returns.

This should desirably enable further MemCpyOpt/DSE optimizations.

Previous discussion: https://discourse.llvm.org/t/rfc-add-dead-on-return-attribute/86871.
</pre>
</div>
</content>
</entry>
<entry>
<title>[IRBuilder] Generate nuw GEPs for struct member accesses (#99538)</title>
<updated>2024-08-09T12:25:04+00:00</updated>
<author>
<name>Hari Limaye</name>
<email>hari.limaye@arm.com</email>
</author>
<published>2024-08-09T12:25:04+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=94473f4db6a6f5f12d7c4081455b5b596094eac5'/>
<id>94473f4db6a6f5f12d7c4081455b5b596094eac5</id>
<content type='text'>
Generate nuw GEPs for struct member accesses, as inbounds + non-negative
implies nuw.

Regression tests are updated using update scripts where possible, and by
find + replace where not.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Generate nuw GEPs for struct member accesses, as inbounds + non-negative
implies nuw.

Regression tests are updated using update scripts where possible, and by
find + replace where not.</pre>
</div>
</content>
</entry>
<entry>
<title>[CodeGen] Simplify codegen for array initialization (#93956)</title>
<updated>2024-06-10T07:19:55+00:00</updated>
<author>
<name>Nikita Popov</name>
<email>npopov@redhat.com</email>
</author>
<published>2024-06-10T07:19:55+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=12d24e0c56a154c88247e55c7c352030e4d9073d'/>
<id>12d24e0c56a154c88247e55c7c352030e4d9073d</id>
<content type='text'>
This makes codegen for array initialization simpler in two ways:
1. Drop the zero-index GEP at the start, which is no longer needed with
opaque pointers.
2. Emit GEPs directly to the correct element, instead of having a long
chain of +1 GEPs. This is more canonical, and also avoids regressions in
unoptimized builds from #93823.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This makes codegen for array initialization simpler in two ways:
1. Drop the zero-index GEP at the start, which is no longer needed with
opaque pointers.
2. Emit GEPs directly to the correct element, instead of having a long
chain of +1 GEPs. This is more canonical, and also avoids regressions in
unoptimized builds from #93823.</pre>
</div>
</content>
</entry>
<entry>
<title>[clang][CodeGen] Ensure consistent `mustprogress` attribute emission</title>
<updated>2023-11-11T08:43:03+00:00</updated>
<author>
<name>Antonio Frighetto</name>
<email>me@antoniofrighetto.com</email>
</author>
<published>2023-11-06T22:20:31+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=970bf07d0b184c7ec356ae8f47b193a5e3ff0309'/>
<id>970bf07d0b184c7ec356ae8f47b193a5e3ff0309</id>
<content type='text'>
Emission of `mustprogress` attribute previously occurred only within
`EmitFunctionBody`, after generating the function body. Other routines
for function body creation may lack the attribute, potentially leading
to suboptimal optimizations later in the pipeline. Attribute emission
is now anticipated prior to generating the function body.

Fixes: https://github.com/llvm/llvm-project/issues/69833.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Emission of `mustprogress` attribute previously occurred only within
`EmitFunctionBody`, after generating the function body. Other routines
for function body creation may lack the attribute, potentially leading
to suboptimal optimizations later in the pipeline. Attribute emission
is now anticipated prior to generating the function body.

Fixes: https://github.com/llvm/llvm-project/issues/69833.
</pre>
</div>
</content>
</entry>
<entry>
<title>[OpenMP] Prefix outlined and reduction func names with original func's name</title>
<updated>2023-04-19T20:00:26+00:00</updated>
<author>
<name>Itay Bookstein</name>
<email>itay.bookstein@nextsilicon.com</email>
</author>
<published>2022-12-23T09:35:47+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=782c59a4eef0bca8546b0cfbb1e48a9fcd044c93'/>
<id>782c59a4eef0bca8546b0cfbb1e48a9fcd044c93</id>
<content type='text'>
This patch prefixes omp outlined helpers and reduction funcs
with the original function's name.

Reviewed By: jdoerfert

Differential Revision: https://reviews.llvm.org/D140722
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This patch prefixes omp outlined helpers and reduction funcs
with the original function's name.

Reviewed By: jdoerfert

Differential Revision: https://reviews.llvm.org/D140722
</pre>
</div>
</content>
</entry>
<entry>
<title>Revert "[OpenMP] Prefix outlined and reduction func names with original func's name"</title>
<updated>2023-04-19T16:08:49+00:00</updated>
<author>
<name>Itay Bookstein</name>
<email>itay.bookstein@nextsilicon.com</email>
</author>
<published>2023-04-19T16:08:11+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=6fdd13e0ec61dfa5bd631ec44d2752d965c26436'/>
<id>6fdd13e0ec61dfa5bd631ec44d2752d965c26436</id>
<content type='text'>
This reverts commit 029bfc311d4d7d3cd90be81bb08c046848796d02.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This reverts commit 029bfc311d4d7d3cd90be81bb08c046848796d02.
</pre>
</div>
</content>
</entry>
<entry>
<title>[OpenMP] Prefix outlined and reduction func names with original func's name</title>
<updated>2023-04-19T16:05:21+00:00</updated>
<author>
<name>Itay Bookstein</name>
<email>itay.bookstein@nextsilicon.com</email>
</author>
<published>2022-12-23T09:35:47+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=029bfc311d4d7d3cd90be81bb08c046848796d02'/>
<id>029bfc311d4d7d3cd90be81bb08c046848796d02</id>
<content type='text'>
This patch attempts to prefix omp outlined helpers and reduction funcs
with the original function's name.

Reviewed By: jdoerfert

Differential Revision: https://reviews.llvm.org/D140722
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This patch attempts to prefix omp outlined helpers and reduction funcs
with the original function's name.

Reviewed By: jdoerfert

Differential Revision: https://reviews.llvm.org/D140722
</pre>
</div>
</content>
</entry>
<entry>
<title>Reland "[codegen] Store address of indirect arguments on the stack"</title>
<updated>2023-02-01T18:07:47+00:00</updated>
<author>
<name>Felipe de Azevedo Piovezan</name>
<email>fpiovezan@apple.com</email>
</author>
<published>2023-01-06T18:52:22+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=f84d30e172b1f2365b1437b931d99156a76ed8f2'/>
<id>f84d30e172b1f2365b1437b931d99156a76ed8f2</id>
<content type='text'>
The commit was reverted due to a regression in debug information of an
optimized code test in lldb. This has since been addressed by:

1. rGf753e5be8239: [LiveDebugValues] Allow EntryValue with OP_deref
expressions
2. rG055f2f04e658: [mem2reg][debuginfo] Handle op_deref when converting
dbg.declare

Differential Revision: https://reviews.llvm.org/D141381
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The commit was reverted due to a regression in debug information of an
optimized code test in lldb. This has since been addressed by:

1. rGf753e5be8239: [LiveDebugValues] Allow EntryValue with OP_deref
expressions
2. rG055f2f04e658: [mem2reg][debuginfo] Handle op_deref when converting
dbg.declare

Differential Revision: https://reviews.llvm.org/D141381
</pre>
</div>
</content>
</entry>
<entry>
<title>Revert "[codegen] Store address of indirect arguments on the stack"</title>
<updated>2023-01-16T16:05:22+00:00</updated>
<author>
<name>Felipe de Azevedo Piovezan</name>
<email>fpiovezan@apple.com</email>
</author>
<published>2023-01-16T16:05:22+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=f2d301fe82869f881b86b51da7b4752972c66707'/>
<id>f2d301fe82869f881b86b51da7b4752972c66707</id>
<content type='text'>
This reverts commit 7e4447a17db4a070f01c8f8a87505a4b2a1b0e3a.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This reverts commit 7e4447a17db4a070f01c8f8a87505a4b2a1b0e3a.
</pre>
</div>
</content>
</entry>
<entry>
<title>[codegen] Store address of indirect arguments on the stack</title>
<updated>2023-01-16T14:14:55+00:00</updated>
<author>
<name>Felipe de Azevedo Piovezan</name>
<email>fpiovezan@apple.com</email>
</author>
<published>2023-01-06T18:52:22+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=7e4447a17db4a070f01c8f8a87505a4b2a1b0e3a'/>
<id>7e4447a17db4a070f01c8f8a87505a4b2a1b0e3a</id>
<content type='text'>
With codegen prior to this patch, truly indirect arguments -- i.e.
those that are not `byval` -- can have their debug information lost even
at O0. Because indirect arguments are passed by pointer, and this
pointer is likely placed in a register as per the function call ABI,
debug information is lost as soon as the register gets clobbered.

This patch solves the issue by storing the address of the parameter on
the stack, using a similar strategy employed when C++ references are
passed. In other words, this patch changes codegen from:

```
define @foo(ptr %arg) {
   call void @llvm.dbg.declare(%arg, [...], metadata !DIExpression())
```

To:

```
define @foo(ptr %arg) {
   %ptr_storage = alloca ptr
   store ptr %arg, ptr %ptr_storage
   call void @llvm.dbg.declare(%ptr_storage, [...], metadata !DIExpression(DW_OP_deref))
```

Some common cases where this may happen with C or C++ function calls:
  1. "Big enough" trivial structures passed by value under the ARM ABI.
  2. Structures that are non-trivial for the purposes of call (as per
  the Itanium ABI) when passed by value.

A few tests were matching the wrong alloca (matching against the new
alloca, instead of the old one), so they were updated to either match
both allocas or include a `,` right after the alloca type, to prevent
matching against a pointer type.

Differential Revision: https://reviews.llvm.org/D141381
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
With codegen prior to this patch, truly indirect arguments -- i.e.
those that are not `byval` -- can have their debug information lost even
at O0. Because indirect arguments are passed by pointer, and this
pointer is likely placed in a register as per the function call ABI,
debug information is lost as soon as the register gets clobbered.

This patch solves the issue by storing the address of the parameter on
the stack, using a similar strategy employed when C++ references are
passed. In other words, this patch changes codegen from:

```
define @foo(ptr %arg) {
   call void @llvm.dbg.declare(%arg, [...], metadata !DIExpression())
```

To:

```
define @foo(ptr %arg) {
   %ptr_storage = alloca ptr
   store ptr %arg, ptr %ptr_storage
   call void @llvm.dbg.declare(%ptr_storage, [...], metadata !DIExpression(DW_OP_deref))
```

Some common cases where this may happen with C or C++ function calls:
  1. "Big enough" trivial structures passed by value under the ARM ABI.
  2. Structures that are non-trivial for the purposes of call (as per
  the Itanium ABI) when passed by value.

A few tests were matching the wrong alloca (matching against the new
alloca, instead of the old one), so they were updated to either match
both allocas or include a `,` right after the alloca type, to prevent
matching against a pointer type.

Differential Revision: https://reviews.llvm.org/D141381
</pre>
</div>
</content>
</entry>
</feed>
