<feed xmlns='http://www.w3.org/2005/Atom'>
<title>llvm-project.git/flang/lib/Optimizer/CodeGen/CodeGen.cpp, branch users/fmayer/spr/wip-smartpointers</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>[flang][mlir] Migrate to free create functions. NFC. (#164657)</title>
<updated>2025-10-22T16:47:48+00:00</updated>
<author>
<name>Jakub Kuderski</name>
<email>jakub@nod-labs.com</email>
</author>
<published>2025-10-22T16:47:48+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=23ead476550a667d532554e966704494173fd9d7'/>
<id>23ead476550a667d532554e966704494173fd9d7</id>
<content type='text'>
See
https://discourse.llvm.org/t/psa-opty-create-now-with-100-more-tab-complete/87339.

I plan to mark these as deprecated in
https://github.com/llvm/llvm-project/pull/164649.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
See
https://discourse.llvm.org/t/psa-opty-create-now-with-100-more-tab-complete/87339.

I plan to mark these as deprecated in
https://github.com/llvm/llvm-project/pull/164649.</pre>
</div>
</content>
</entry>
<entry>
<title>[flang][FIR] add fir.assumed_size_extent to abstract assumed-size extent encoding (#164452)</title>
<updated>2025-10-22T09:46:18+00:00</updated>
<author>
<name>jeanPerier</name>
<email>jperier@nvidia.com</email>
</author>
<published>2025-10-22T09:46:18+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=c9fb37c75f741f1179f2d2c661d27d36645b0310'/>
<id>c9fb37c75f741f1179f2d2c661d27d36645b0310</id>
<content type='text'>
The purpose of this patch is to allow converting FIR array representation to
memref when possible without hitting memref verifier issue.

The issue was that FIR arrays may be assumed size, in which case the
last dimension will not be known at runtime. Flang uses -1 to encode
this to fulfill Fortran 2023 standard requirements in 18.5.3 point 5
about CFI_desc_t.

When arrays are converted to memeref, if this `-1` reaches memeref
operations, it triggers verifier errors (even if the conversion happened
in code that guards the code to be entered at runtime if the array is
assumed-size because folders/verifiers do not take into account
reachability).

This follows-up on discussions in #163505 merge requests</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The purpose of this patch is to allow converting FIR array representation to
memref when possible without hitting memref verifier issue.

The issue was that FIR arrays may be assumed size, in which case the
last dimension will not be known at runtime. Flang uses -1 to encode
this to fulfill Fortran 2023 standard requirements in 18.5.3 point 5
about CFI_desc_t.

When arrays are converted to memeref, if this `-1` reaches memeref
operations, it triggers verifier errors (even if the conversion happened
in code that guards the code to be entered at runtime if the array is
assumed-size because folders/verifiers do not take into account
reachability).

This follows-up on discussions in #163505 merge requests</pre>
</div>
</content>
</entry>
<entry>
<title>[flang][cuda] Do not fail if global is not found (#163445)</title>
<updated>2025-10-14T20:51:42+00:00</updated>
<author>
<name>Valentin Clement (バレンタイン クレメン)</name>
<email>clementval@gmail.com</email>
</author>
<published>2025-10-14T20:51:42+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=7b10e977f869488d2965b834f278ee0be45267e2'/>
<id>7b10e977f869488d2965b834f278ee0be45267e2</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>[flang][cuda] Set address space for constant variables (#163430)</title>
<updated>2025-10-14T19:16:26+00:00</updated>
<author>
<name>Valentin Clement (バレンタイン クレメン)</name>
<email>clementval@gmail.com</email>
</author>
<published>2025-10-14T19:16:26+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=6a7754f2acd19a8045073f7aaadc8d78fc219c7c'/>
<id>6a7754f2acd19a8045073f7aaadc8d78fc219c7c</id>
<content type='text'>
Set the correct address space for constant variables. Address of
operation will introduce an address cast.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Set the correct address space for constant variables. Address of
operation will introduce an address cast.</pre>
</div>
</content>
</entry>
<entry>
<title>[flang][cuda] Add a TODO for code generation of CONSTANT variable (#163268)</title>
<updated>2025-10-13T21:52:31+00:00</updated>
<author>
<name>Valentin Clement (バレンタイン クレメン)</name>
<email>clementval@gmail.com</email>
</author>
<published>2025-10-13T21:52:31+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=1c8cd1ed97cf78fdbe843a31306aba0dfc8cd853'/>
<id>1c8cd1ed97cf78fdbe843a31306aba0dfc8cd853</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>[Flang]Fix the build with the EXPENSIVE_CHECKS enabled (#162541)</title>
<updated>2025-10-08T20:35:23+00:00</updated>
<author>
<name>Alexey Bataev</name>
<email>a.bataev@outlook.com</email>
</author>
<published>2025-10-08T20:35:23+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=0ca23a3054cb87dc5a58420fe1f39383d5641eeb'/>
<id>0ca23a3054cb87dc5a58420fe1f39383d5641eeb</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>[flang][cuda] Do not use managed memory inside gpu module (#160730)</title>
<updated>2025-09-25T16:51:49+00:00</updated>
<author>
<name>Valentin Clement (バレンタイン クレメン)</name>
<email>clementval@gmail.com</email>
</author>
<published>2025-09-25T16:51:49+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=e47a42e5b597b155207da24a348baaba52014a92'/>
<id>e47a42e5b597b155207da24a348baaba52014a92</id>
<content type='text'>
Do not issue call to _FortranACUFAllocDescriptor inside gpu module.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Do not issue call to _FortranACUFAllocDescriptor inside gpu module.</pre>
</div>
</content>
</entry>
<entry>
<title>[flang][cuda] Make sure global device descriptor is allocated in managed memory (#160596)</title>
<updated>2025-09-24T20:32:59+00:00</updated>
<author>
<name>Valentin Clement (バレンタイン クレメン)</name>
<email>clementval@gmail.com</email>
</author>
<published>2025-09-24T20:32:59+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=37de695cb1de65dd16f589cdeae50008d1f91d4d'/>
<id>37de695cb1de65dd16f589cdeae50008d1f91d4d</id>
<content type='text'>
When the descriptor of a global device variable is re-materialized to be
passed to a kernel, make sure it is allocated in managed memory
otherwise the kernel launch will fail.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
When the descriptor of a global device variable is re-materialized to be
passed to a kernel, make sure it is allocated in managed memory
otherwise the kernel launch will fail.</pre>
</div>
</content>
</entry>
<entry>
<title>[Flang][OpenMP] Additional global address space modifications for device (#119585)</title>
<updated>2025-09-17T01:27:03+00:00</updated>
<author>
<name>agozillon</name>
<email>Andrew.Gozillon@amd.com</email>
</author>
<published>2025-09-17T01:27:03+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=046d6a39983a9a4ea97343167c92cf8a0a6ff325'/>
<id>046d6a39983a9a4ea97343167c92cf8a0a6ff325</id>
<content type='text'>
A prior PR added a portion of the global address space modifications
required for declare target to, this PR seeks to add
 a small amount more leftover from that PR.
   
The intent is to allow for more correct IR that the backends (in
particular AMDGPU) can treat more aptly for optimisations and code
correctness
    
1/3 required PRs to enable declare target to mapping, should look at PR
3/3 to check for full green passes (this one will fail a number due to
some dependencies).
    
Co-authored-by: Raghu Maddhipatla raghu.maddhipatla@amd.com</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
A prior PR added a portion of the global address space modifications
required for declare target to, this PR seeks to add
 a small amount more leftover from that PR.
   
The intent is to allow for more correct IR that the backends (in
particular AMDGPU) can treat more aptly for optimisations and code
correctness
    
1/3 required PRs to enable declare target to mapping, should look at PR
3/3 to check for full green passes (this one will fail a number due to
some dependencies).
    
Co-authored-by: Raghu Maddhipatla raghu.maddhipatla@amd.com</pre>
</div>
</content>
</entry>
<entry>
<title>[mlir][LLVM] Add LLVMAddrSpaceAttrInterface and NVVMMemorySpaceAttr (#157339)</title>
<updated>2025-09-14T13:05:28+00:00</updated>
<author>
<name>Fabian Mora</name>
<email>fmora.dev@gmail.com</email>
</author>
<published>2025-09-14T13:05:28+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=48babe193186248e1c386a847047d59ab61c762d'/>
<id>48babe193186248e1c386a847047d59ab61c762d</id>
<content type='text'>
This patch introduces the `LLVMAddrSpaceAttrInterface` for defining
compatible LLVM address space attributes

To test this interface, this patch also adds:
- Adds NVVMMemorySpaceAttr implementing both LLVMAddrSpaceAttrInterface
and MemorySpaceAttrInterface
- Converts NVVM memory space constants from enum to MLIR enums
- Updates all NVVM memory space references to use new attribute system
- Adds support for NVVM memory spaces in ptr dialect translation

Example:
```mlir
llvm.func @nvvm_ptr_address_space(
    !ptr.ptr&lt;#nvvm.memory_space&lt;global&gt;&gt;,
    !ptr.ptr&lt;#nvvm.memory_space&lt;shared&gt;&gt;,
    !ptr.ptr&lt;#nvvm.memory_space&lt;constant&gt;&gt;,
    !ptr.ptr&lt;#nvvm.memory_space&lt;local&gt;&gt;,
    !ptr.ptr&lt;#nvvm.memory_space&lt;tensor&gt;&gt;,
    !ptr.ptr&lt;#nvvm.memory_space&lt;shared_cluster&gt;&gt;
  ) -&gt; !ptr.ptr&lt;#nvvm.memory_space&lt;generic&gt;&gt;
```
Translating the above code to LLVM produces:
```llvm
declare ptr @nvvm_ptr_address_space(ptr addrspace(1), ptr addrspace(3), ptr addrspace(4), ptr addrspace(5), ptr addrspace(6), ptr addrspace(7))
```


To convert the memory space enum to the new enum class use:
```bash
grep -r . -e "NVVMMemorySpace::kGenericMemorySpace" -l | xargs sed -i -e "s/NVVMMemorySpace::kGenericMemorySpace/NVVMMemorySpace::Generic/g"
grep -r . -e "NVVMMemorySpace::kGlobalMemorySpace" -l | xargs sed -i -e "s/NVVMMemorySpace::kGlobalMemorySpace/NVVMMemorySpace::Global/g"
grep -r . -e "NVVMMemorySpace::kSharedMemorySpace" -l | xargs sed -i -e "s/NVVMMemorySpace::kSharedMemorySpace/NVVMMemorySpace::Shared/g"
grep -r . -e "NVVMMemorySpace::kConstantMemorySpace" -l | xargs sed -i -e "s/NVVMMemorySpace::kConstantMemorySpace/NVVMMemorySpace::Constant/g"
grep -r . -e "NVVMMemorySpace::kLocalMemorySpace" -l | xargs sed -i -e "s/NVVMMemorySpace::kLocalMemorySpace/NVVMMemorySpace::Local/g"
grep -r . -e "NVVMMemorySpace::kTensorMemorySpace" -l | xargs sed -i -e "s/NVVMMemorySpace::kTensorMemorySpace/NVVMMemorySpace::Tensor/g"
grep -r . -e "NVVMMemorySpace::kSharedClusterMemorySpace" -l | xargs sed -i -e "s/NVVMMemorySpace::kSharedClusterMemorySpace/NVVMMemorySpace::SharedCluster/g"
```

NOTE: A future patch will add support for ROCDL, it wasn't added here to
keep the patch small.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This patch introduces the `LLVMAddrSpaceAttrInterface` for defining
compatible LLVM address space attributes

To test this interface, this patch also adds:
- Adds NVVMMemorySpaceAttr implementing both LLVMAddrSpaceAttrInterface
and MemorySpaceAttrInterface
- Converts NVVM memory space constants from enum to MLIR enums
- Updates all NVVM memory space references to use new attribute system
- Adds support for NVVM memory spaces in ptr dialect translation

Example:
```mlir
llvm.func @nvvm_ptr_address_space(
    !ptr.ptr&lt;#nvvm.memory_space&lt;global&gt;&gt;,
    !ptr.ptr&lt;#nvvm.memory_space&lt;shared&gt;&gt;,
    !ptr.ptr&lt;#nvvm.memory_space&lt;constant&gt;&gt;,
    !ptr.ptr&lt;#nvvm.memory_space&lt;local&gt;&gt;,
    !ptr.ptr&lt;#nvvm.memory_space&lt;tensor&gt;&gt;,
    !ptr.ptr&lt;#nvvm.memory_space&lt;shared_cluster&gt;&gt;
  ) -&gt; !ptr.ptr&lt;#nvvm.memory_space&lt;generic&gt;&gt;
```
Translating the above code to LLVM produces:
```llvm
declare ptr @nvvm_ptr_address_space(ptr addrspace(1), ptr addrspace(3), ptr addrspace(4), ptr addrspace(5), ptr addrspace(6), ptr addrspace(7))
```


To convert the memory space enum to the new enum class use:
```bash
grep -r . -e "NVVMMemorySpace::kGenericMemorySpace" -l | xargs sed -i -e "s/NVVMMemorySpace::kGenericMemorySpace/NVVMMemorySpace::Generic/g"
grep -r . -e "NVVMMemorySpace::kGlobalMemorySpace" -l | xargs sed -i -e "s/NVVMMemorySpace::kGlobalMemorySpace/NVVMMemorySpace::Global/g"
grep -r . -e "NVVMMemorySpace::kSharedMemorySpace" -l | xargs sed -i -e "s/NVVMMemorySpace::kSharedMemorySpace/NVVMMemorySpace::Shared/g"
grep -r . -e "NVVMMemorySpace::kConstantMemorySpace" -l | xargs sed -i -e "s/NVVMMemorySpace::kConstantMemorySpace/NVVMMemorySpace::Constant/g"
grep -r . -e "NVVMMemorySpace::kLocalMemorySpace" -l | xargs sed -i -e "s/NVVMMemorySpace::kLocalMemorySpace/NVVMMemorySpace::Local/g"
grep -r . -e "NVVMMemorySpace::kTensorMemorySpace" -l | xargs sed -i -e "s/NVVMMemorySpace::kTensorMemorySpace/NVVMMemorySpace::Tensor/g"
grep -r . -e "NVVMMemorySpace::kSharedClusterMemorySpace" -l | xargs sed -i -e "s/NVVMMemorySpace::kSharedClusterMemorySpace/NVVMMemorySpace::SharedCluster/g"
```

NOTE: A future patch will add support for ROCDL, it wasn't added here to
keep the patch small.</pre>
</div>
</content>
</entry>
</feed>
