<feed xmlns='http://www.w3.org/2005/Atom'>
<title>llvm-project.git/llvm/lib/Transforms/HipStdPar, branch users/nico/python-2</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>[HIP][HIPSTDPAR] Re-work allocation interposition for `hipstdpar` (#138790)</title>
<updated>2025-05-07T13:14:25+00:00</updated>
<author>
<name>Alex Voicu</name>
<email>alexandru.voicu@amd.com</email>
</author>
<published>2025-05-07T13:14:25+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=3feb8b42e973f935883bc9e779645ecdae1a586d'/>
<id>3feb8b42e973f935883bc9e779645ecdae1a586d</id>
<content type='text'>
The allocation interposition mode had a number of issues, which are
primarily addressed in the library component via
&lt;https://github.com/ROCm/rocThrust/pull/543&gt;. However, it is necessary
to interpose some additional symbols, which this patch does.
Furthermore, to implement this in a compatible way, we guard the new
implementation under a V1 macro, which is defined in addition to the
existing `__HIPSTDPAR_INTERPOSE_ALLOC__` one.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The allocation interposition mode had a number of issues, which are
primarily addressed in the library component via
&lt;https://github.com/ROCm/rocThrust/pull/543&gt;. However, it is necessary
to interpose some additional symbols, which this patch does.
Furthermore, to implement this in a compatible way, we guard the new
implementation under a V1 macro, which is defined in addition to the
existing `__HIPSTDPAR_INTERPOSE_ALLOC__` one.</pre>
</div>
</content>
</entry>
<entry>
<title>[opt][HIPSTDPAR] Handle `__hipstdpar_hidden_malloc` (#123150)</title>
<updated>2025-01-22T01:29:12+00:00</updated>
<author>
<name>Alex Voicu</name>
<email>alexandru.voicu@amd.com</email>
</author>
<published>2025-01-22T01:29:12+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=335f1a72b22560e61f6170efef740c9c26b24f1a'/>
<id>335f1a72b22560e61f6170efef740c9c26b24f1a</id>
<content type='text'>
This patch adds support for replacing calls to
`__hipstdpar_hidden_malloc` with calls to `__libc_malloc`, similarly to
how we handle hidden `free`. A future paired change in the forwarding
header will leverage this capability in order to handle certain special
cases where it is not possible / desirable to allocate via the HIP
runtime.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This patch adds support for replacing calls to
`__hipstdpar_hidden_malloc` with calls to `__libc_malloc`, similarly to
how we handle hidden `free`. A future paired change in the forwarding
header will leverage this capability in order to handle certain special
cases where it is not possible / desirable to allocate via the HIP
runtime.</pre>
</div>
</content>
</entry>
<entry>
<title>[HipStdPar] Avoid repeated hash lookups (NFC) (#123558)</title>
<updated>2025-01-20T18:13:27+00:00</updated>
<author>
<name>Kazu Hirata</name>
<email>kazu@google.com</email>
</author>
<published>2025-01-20T18:13:27+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=f355a447634d6498fc5765771a9579564510654f'/>
<id>f355a447634d6498fc5765771a9579564510654f</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>[Transforms] Remove unused includes (NFC) (#115263)</title>
<updated>2024-11-07T18:58:58+00:00</updated>
<author>
<name>Kazu Hirata</name>
<email>kazu@google.com</email>
</author>
<published>2024-11-07T18:58:58+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=b02e5bc5b1be9d94689ebe1cf1244b7da540fb19'/>
<id>b02e5bc5b1be9d94689ebe1cf1244b7da540fb19</id>
<content type='text'>
Identified with misc-include-cleaner.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Identified with misc-include-cleaner.</pre>
</div>
</content>
</entry>
<entry>
<title>[HipStdPar] Avoid repeated hash lookups (NFC) (#112653)</title>
<updated>2024-10-17T14:44:27+00:00</updated>
<author>
<name>Kazu Hirata</name>
<email>kazu@google.com</email>
</author>
<published>2024-10-17T14:44:27+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=db3292402565042dff9a2d5a147e023de6d82263'/>
<id>db3292402565042dff9a2d5a147e023de6d82263</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>[Transforms] Construct SmallVector with iterator ranges (NFC) (#105607)</title>
<updated>2024-08-22T06:32:13+00:00</updated>
<author>
<name>Kazu Hirata</name>
<email>kazu@google.com</email>
</author>
<published>2024-08-22T06:32:13+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=820396c3a874f57205bfe52cc82bcac3a0035b3d'/>
<id>820396c3a874f57205bfe52cc82bcac3a0035b3d</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>[HipStdPar] Fix globle variable (#90627)</title>
<updated>2024-05-02T13:34:52+00:00</updated>
<author>
<name>Yaxun (Sam) Liu</name>
<email>yaxun.liu@amd.com</email>
</author>
<published>2024-05-02T13:34:52+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=cd683bd32cecd97b9d9fd345c4e6c067d84fefd4'/>
<id>cd683bd32cecd97b9d9fd345c4e6c067d84fefd4</id>
<content type='text'>
HipStdParAcceleratorCodeSelectionPass changes linkage of global
variables to extern_weak, which does not allow initializer.

An extern_weak global variable with initializer will cause llvm-as and
llc to fail.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
HipStdParAcceleratorCodeSelectionPass changes linkage of global
variables to extern_weak, which does not allow initializer.

An extern_weak global variable with initializer will cause llvm-as and
llc to fail.</pre>
</div>
</content>
</entry>
<entry>
<title>[HIP][LLVM][Opt] Add LLVM support for `hipstdpar`</title>
<updated>2023-10-12T10:26:48+00:00</updated>
<author>
<name>Alex Voicu</name>
<email>alexandru.voicu@amd.com</email>
</author>
<published>2023-10-12T10:26:48+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=0ce6255a50584863c2f462390cac6a63ccb5f136'/>
<id>0ce6255a50584863c2f462390cac6a63ccb5f136</id>
<content type='text'>
This patch adds the LLVM changes needed for enabling HIP parallel algorithm offload on AMDGPU targets. What we do here is add two passes, one mandatory and one optional:

1. HipStdParAcceleratorCodeSelectionPass is mandatory, depends on CallGraphAnalysis, and implements the following transform:

    - Traverse the call-graph, and check for functions that are roots for accelerator execution (at the moment, these are GPU kernels exclusively, and would originate in the accelerator specific algorithm library the toolchain uses as an implementation detail);
    - Starting from a root, do a BFS to find all functions that are reachable (called directly or indirectly via a call- chain) and record them;
    - After having done the above for all roots in the Module, we have the computed the set of reachable functions, which is the union of roots and functions reachable from roots;
    - All functions that are not in the reachable set are removed; for the special case where the reachable set is empty we completely clear the module;

2. HipStdParAllocationInterpositionPass is optional, is meant as a fallback with restricted functionality for cases where on-demand paging is unavailable on a platform, and implements the following transform:
    - Iterate all functions in a Module;
    - If a function's name is in a predefined set of allocation / deallocation that the runtime implementation is allowed and expected to interpose, replace all its uses with the equivalent accelerator aware function, iff the latter is available;
        - If the accelerator aware equivalent is unavailable we warn, but compilation will go ahead, which means that it is possible to get issues around the accelerator trying to access inaccessible memory at run time;
    - We rely on direct name matching as opposed to using the new alloc-kind family of attributes and / or the LibCall analysis pass because some of the legacy functions that need replacing would not carry the former or be identified by the latter.

Reviewed by: JonChesterfield, yaxunl

Differential Revision: https://reviews.llvm.org/D155856
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This patch adds the LLVM changes needed for enabling HIP parallel algorithm offload on AMDGPU targets. What we do here is add two passes, one mandatory and one optional:

1. HipStdParAcceleratorCodeSelectionPass is mandatory, depends on CallGraphAnalysis, and implements the following transform:

    - Traverse the call-graph, and check for functions that are roots for accelerator execution (at the moment, these are GPU kernels exclusively, and would originate in the accelerator specific algorithm library the toolchain uses as an implementation detail);
    - Starting from a root, do a BFS to find all functions that are reachable (called directly or indirectly via a call- chain) and record them;
    - After having done the above for all roots in the Module, we have the computed the set of reachable functions, which is the union of roots and functions reachable from roots;
    - All functions that are not in the reachable set are removed; for the special case where the reachable set is empty we completely clear the module;

2. HipStdParAllocationInterpositionPass is optional, is meant as a fallback with restricted functionality for cases where on-demand paging is unavailable on a platform, and implements the following transform:
    - Iterate all functions in a Module;
    - If a function's name is in a predefined set of allocation / deallocation that the runtime implementation is allowed and expected to interpose, replace all its uses with the equivalent accelerator aware function, iff the latter is available;
        - If the accelerator aware equivalent is unavailable we warn, but compilation will go ahead, which means that it is possible to get issues around the accelerator trying to access inaccessible memory at run time;
    - We rely on direct name matching as opposed to using the new alloc-kind family of attributes and / or the LibCall analysis pass because some of the legacy functions that need replacing would not carry the former or be identified by the latter.

Reviewed by: JonChesterfield, yaxunl

Differential Revision: https://reviews.llvm.org/D155856
</pre>
</div>
</content>
</entry>
<entry>
<title>Revert "[HIP][LLVM][Opt] Add LLVM support for `hipstdpar`"</title>
<updated>2023-10-11T11:27:03+00:00</updated>
<author>
<name>Alex Voicu</name>
<email>alexandru.voicu@amd.com</email>
</author>
<published>2023-10-11T11:27:03+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=25935c384dd83b131f3c09caaf23f7c63822cd46'/>
<id>25935c384dd83b131f3c09caaf23f7c63822cd46</id>
<content type='text'>
This reverts commit c5bba7ea5a05f540948f76a189c880eb24a5e8c6.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This reverts commit c5bba7ea5a05f540948f76a189c880eb24a5e8c6.
</pre>
</div>
</content>
</entry>
<entry>
<title>[HIP][LLVM][Opt] Add LLVM support for `hipstdpar`</title>
<updated>2023-10-11T11:22:00+00:00</updated>
<author>
<name>Alex Voicu</name>
<email>alexandru.voicu@amd.com</email>
</author>
<published>2023-10-11T11:22:00+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=c5bba7ea5a05f540948f76a189c880eb24a5e8c6'/>
<id>c5bba7ea5a05f540948f76a189c880eb24a5e8c6</id>
<content type='text'>
This patch adds the LLVM changes needed for enabling HIP parallel algorithm offload on AMDGPU targets. What we do here is add two passes, one mandatory and one optional:

1. HipStdParAcceleratorCodeSelectionPass is mandatory, depends on CallGraphAnalysis, and implements the following transform:

    - Traverse the call-graph, and check for functions that are roots for accelerator execution (at the moment, these are GPU kernels exclusively, and would originate in the accelerator specific algorithm library the toolchain uses as an implementation detail);
    - Starting from a root, do a BFS to find all functions that are reachable (called directly or indirectly via a call- chain) and record them;
    - After having done the above for all roots in the Module, we have the computed the set of reachable functions, which is the union of roots and functions reachable from roots;
    - All functions that are not in the reachable set are removed; for the special case where the reachable set is empty we completely clear the module;

2. HipStdParAllocationInterpositionPass is optional, is meant as a fallback with restricted functionality for cases where on-demand paging is unavailable on a platform, and implements the following transform:
    - Iterate all functions in a Module;
    - If a function's name is in a predefined set of allocation / deallocation that the runtime implementation is allowed and expected to interpose, replace all its uses with the equivalent accelerator aware function, iff the latter is available;
        - If the accelerator aware equivalent is unavailable we warn, but compilation will go ahead, which means that it is possible to get issues around the accelerator trying to access inaccessible memory at run time;
    - We rely on direct name matching as opposed to using the new alloc-kind family of attributes and / or the LibCall analysis pass because some of the legacy functions that need replacing would not carry the former or be identified by the latter.

Reviewed by: JonChesterfield, yaxunl

Differential Revision: https://reviews.llvm.org/D155856
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This patch adds the LLVM changes needed for enabling HIP parallel algorithm offload on AMDGPU targets. What we do here is add two passes, one mandatory and one optional:

1. HipStdParAcceleratorCodeSelectionPass is mandatory, depends on CallGraphAnalysis, and implements the following transform:

    - Traverse the call-graph, and check for functions that are roots for accelerator execution (at the moment, these are GPU kernels exclusively, and would originate in the accelerator specific algorithm library the toolchain uses as an implementation detail);
    - Starting from a root, do a BFS to find all functions that are reachable (called directly or indirectly via a call- chain) and record them;
    - After having done the above for all roots in the Module, we have the computed the set of reachable functions, which is the union of roots and functions reachable from roots;
    - All functions that are not in the reachable set are removed; for the special case where the reachable set is empty we completely clear the module;

2. HipStdParAllocationInterpositionPass is optional, is meant as a fallback with restricted functionality for cases where on-demand paging is unavailable on a platform, and implements the following transform:
    - Iterate all functions in a Module;
    - If a function's name is in a predefined set of allocation / deallocation that the runtime implementation is allowed and expected to interpose, replace all its uses with the equivalent accelerator aware function, iff the latter is available;
        - If the accelerator aware equivalent is unavailable we warn, but compilation will go ahead, which means that it is possible to get issues around the accelerator trying to access inaccessible memory at run time;
    - We rely on direct name matching as opposed to using the new alloc-kind family of attributes and / or the LibCall analysis pass because some of the legacy functions that need replacing would not carry the former or be identified by the latter.

Reviewed by: JonChesterfield, yaxunl

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