<feed xmlns='http://www.w3.org/2005/Atom'>
<title>llvm-project.git/llvm/test/CodeGen/SPIRV/function, 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>[SPIR-V] Rework usage of virtual registers' types and classes (#104104)</title>
<updated>2024-08-22T07:40:27+00:00</updated>
<author>
<name>Vyacheslav Levytskyy</name>
<email>vyacheslav.levytskyy@intel.com</email>
</author>
<published>2024-08-22T07:40:27+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=67d3ef74b31e1517d4f679e754cc2b3041c95901'/>
<id>67d3ef74b31e1517d4f679e754cc2b3041c95901</id>
<content type='text'>
This PR continues https://github.com/llvm/llvm-project/pull/101732
changes in virtual register processing aimed to improve correctness of
emitted MIR between passes from the perspective of MachineVerifier.
Namely, the following changes are introduced:
* register classes (lib/Target/SPIRV/SPIRVRegisterInfo.td) and
instruction patterns (lib/Target/SPIRV/SPIRVInstrInfo.td) are corrected
and simplified (by removing unnecessary sophisticated options) -- e.g.,
this PR gets rid of duplicating 32/64 bits patterns, removes ANYID
register class and simplifies definition of the rest of register
classes,
* hardcoded LLT scalar types in passes before instruction selection are
corrected -- the goal is to have correct bit width before instruction
selection, and use 64 bits registers for pattern matching in the
instruction selection pass; 32-bit registers remain where they are
described in such terms by SPIR-V specification (like, for example,
creation of virtual registers for scope/mem semantics operands),
* rework virtual register type/class assignment for calls/builtins
lowering,
* a series of minor changes to fix validity of emitted code between
passes:
  - ensure that that bitcast changes the type,
  - fix the pattern for instruction selection for OpExtInst,
  - simplify inline asm operands usage,
  - account for arbitrary integer sizes / update legalizer rules;
* add '-verify-machineinstrs' to existed test cases.

See also https://github.com/llvm/llvm-project/issues/88129 that this PR
may resolve.

This PR fixes a great number of issues reported by MachineVerifier and,
as a result, reduces a number of failed test cases for the mode with
expensive checks set on from ~200 to ~57.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This PR continues https://github.com/llvm/llvm-project/pull/101732
changes in virtual register processing aimed to improve correctness of
emitted MIR between passes from the perspective of MachineVerifier.
Namely, the following changes are introduced:
* register classes (lib/Target/SPIRV/SPIRVRegisterInfo.td) and
instruction patterns (lib/Target/SPIRV/SPIRVInstrInfo.td) are corrected
and simplified (by removing unnecessary sophisticated options) -- e.g.,
this PR gets rid of duplicating 32/64 bits patterns, removes ANYID
register class and simplifies definition of the rest of register
classes,
* hardcoded LLT scalar types in passes before instruction selection are
corrected -- the goal is to have correct bit width before instruction
selection, and use 64 bits registers for pattern matching in the
instruction selection pass; 32-bit registers remain where they are
described in such terms by SPIR-V specification (like, for example,
creation of virtual registers for scope/mem semantics operands),
* rework virtual register type/class assignment for calls/builtins
lowering,
* a series of minor changes to fix validity of emitted code between
passes:
  - ensure that that bitcast changes the type,
  - fix the pattern for instruction selection for OpExtInst,
  - simplify inline asm operands usage,
  - account for arbitrary integer sizes / update legalizer rules;
* add '-verify-machineinstrs' to existed test cases.

See also https://github.com/llvm/llvm-project/issues/88129 that this PR
may resolve.

This PR fixes a great number of issues reported by MachineVerifier and,
as a result, reduces a number of failed test cases for the mode with
expensive checks set on from ~200 to ~57.</pre>
</div>
</content>
</entry>
<entry>
<title>[SPIR-V] Fix a crash in SPIRV Backend during the 'finalize lowering' stage on management of function forward calls (#97435)</title>
<updated>2024-07-03T15:56:26+00:00</updated>
<author>
<name>Vyacheslav Levytskyy</name>
<email>vyacheslav.levytskyy@intel.com</email>
</author>
<published>2024-07-03T15:56:26+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=1db4221c6da0f77517e1921f7c17a6f4e493e38f'/>
<id>1db4221c6da0f77517e1921f7c17a6f4e493e38f</id>
<content type='text'>
This PR is to fix a crash in SPIRV Backend during the 'finalize
lowering' stage on management of function forward calls. The reproducer
is committed as a new test case.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This PR is to fix a crash in SPIRV Backend during the 'finalize
lowering' stage on management of function forward calls. The reproducer
is committed as a new test case.</pre>
</div>
</content>
</entry>
<entry>
<title>[SPIR-V] Do not use OpenCL metadata for ptr element type resolution (#82678)</title>
<updated>2024-03-04T06:38:59+00:00</updated>
<author>
<name>Michal Paszkowski</name>
<email>michal@paszkowski.org</email>
</author>
<published>2024-03-04T06:38:59+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=43222bd3091db5403e3320d23a241a534c1eefec'/>
<id>43222bd3091db5403e3320d23a241a534c1eefec</id>
<content type='text'>
This pull request aims to remove any dependency on OpenCL/SPIR-V type
information in LLVM IR metadata. While, using metadata might simplify
and prettify the resulting SPIR-V output (and restore some of the
information missed in the transformation to opaque pointers), the
overall methodology for resolving kernel parameter types is highly
inefficient.

The high-level strategy is to assign kernel parameter types in this order:

1. Resolving the types using builtin function calls as mangled names
must contain type information or by looking up builtin definition in
SPIRVBuiltins.td. Then:

- Assigning the type temporarily using an intrinsic and later setting
the right SPIR-V type in SPIRVGlobalRegistry after IRTranslation
 - Inserting a bitcast
2. Defaulting to LLVM IR types (in case of pointers the generic i8*
type or types from byval/byref attributes)

In case of type incompatibility (e.g. parameter defined initially as
sampler_t and later used as image_t) the error will be found early on
before IRTranslation (in the SPIRVEmitIntrinsics pass).</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This pull request aims to remove any dependency on OpenCL/SPIR-V type
information in LLVM IR metadata. While, using metadata might simplify
and prettify the resulting SPIR-V output (and restore some of the
information missed in the transformation to opaque pointers), the
overall methodology for resolving kernel parameter types is highly
inefficient.

The high-level strategy is to assign kernel parameter types in this order:

1. Resolving the types using builtin function calls as mangled names
must contain type information or by looking up builtin definition in
SPIRVBuiltins.td. Then:

- Assigning the type temporarily using an intrinsic and later setting
the right SPIR-V type in SPIRVGlobalRegistry after IRTranslation
 - Inserting a bitcast
2. Defaulting to LLVM IR types (in case of pointers the generic i8*
type or types from byval/byref attributes)

In case of type incompatibility (e.g. parameter defined initially as
sampler_t and later used as image_t) the error will be found early on
before IRTranslation (in the SPIRVEmitIntrinsics pass).</pre>
</div>
</content>
</entry>
<entry>
<title>[SPIR-V] Emit SPIR-V bitcasts between source/expected pointer type (#69621)</title>
<updated>2024-01-05T03:31:15+00:00</updated>
<author>
<name>Michal Paszkowski</name>
<email>michal.paszkowski@outlook.com</email>
</author>
<published>2024-01-05T03:31:15+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=b4cfb50c65bd3893d1a0639deb33bd664214a20f'/>
<id>b4cfb50c65bd3893d1a0639deb33bd664214a20f</id>
<content type='text'>
This patch introduces a new spv_ptrcast intrinsic for tracking expected
pointer types. The change fixes multiple OpenCL CTS regressions due the
switch to opaque pointers (e.g. basic/hiloeo).</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This patch introduces a new spv_ptrcast intrinsic for tracking expected
pointer types. The change fixes multiple OpenCL CTS regressions due the
switch to opaque pointers (e.g. basic/hiloeo).</pre>
</div>
</content>
</entry>
<entry>
<title>[SPIR-V] Remove -opaque-pointers=0 from LITs, fixes for opaque pointers support</title>
<updated>2023-09-19T07:50:42+00:00</updated>
<author>
<name>Michal Paszkowski</name>
<email>michal.paszkowski@outlook.com</email>
</author>
<published>2023-09-07T19:03:33+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=ec7baca17e78d47c1571d1c06b95f920562293da'/>
<id>ec7baca17e78d47c1571d1c06b95f920562293da</id>
<content type='text'>
Differential Revision: https://reviews.llvm.org/D156049
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Differential Revision: https://reviews.llvm.org/D156049
</pre>
</div>
</content>
</entry>
<entry>
<title>[SPIR-V] Add -opaque-pointers=0 to some LIT tests</title>
<updated>2023-01-19T13:02:14+00:00</updated>
<author>
<name>Michal Paszkowski</name>
<email>michal.paszkowski@outlook.com</email>
</author>
<published>2023-01-18T23:05:37+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=786cb151d938b52bebfe3ae338d0bd38bcc03dfa'/>
<id>786cb151d938b52bebfe3ae338d0bd38bcc03dfa</id>
<content type='text'>
Differential Revision: https://reviews.llvm.org/D142061
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Differential Revision: https://reviews.llvm.org/D142061
</pre>
</div>
</content>
</entry>
<entry>
<title>[SPIR-V] Map IR function pointers to registers in ModuleAnalysis</title>
<updated>2023-01-07T14:38:01+00:00</updated>
<author>
<name>Michal Paszkowski</name>
<email>michal.paszkowski@outlook.com</email>
</author>
<published>2023-01-07T14:25:53+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=99203241df4d73e569e9219105fec76919f07c19'/>
<id>99203241df4d73e569e9219105fec76919f07c19</id>
<content type='text'>
SPIRVModuleAnalysis collects module and external function registers
(usually result of OpFunction) for use when emitting OpFunctionCall.
This patch makes the mapping between the functions and registers using
pointers (instead of name strings) to ensure anonymous functions and
calls can be resolved properly.

Differential Revision: https://reviews.llvm.org/D140548
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
SPIRVModuleAnalysis collects module and external function registers
(usually result of OpFunction) for use when emitting OpFunctionCall.
This patch makes the mapping between the functions and registers using
pointers (instead of name strings) to ensure anonymous functions and
calls can be resolved properly.

Differential Revision: https://reviews.llvm.org/D140548
</pre>
</div>
</content>
</entry>
<entry>
<title>[SPIR-V] Support memory(...) function attributes</title>
<updated>2022-12-19T18:36:32+00:00</updated>
<author>
<name>Michal Paszkowski</name>
<email>michal.paszkowski@outlook.com</email>
</author>
<published>2022-12-19T18:36:32+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=b0020f423feb922c35802af96234c5d21b8d3f51'/>
<id>b0020f423feb922c35802af96234c5d21b8d3f51</id>
<content type='text'>
Adds support for memory(...) function attributes in SPIR-V function
control info lowering.

Differential Revision: https://reviews.llvm.org/D139133
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Adds support for memory(...) function attributes in SPIR-V function
control info lowering.

Differential Revision: https://reviews.llvm.org/D139133
</pre>
</div>
</content>
</entry>
<entry>
<title>[SPIRV] Fix formatting of function tests</title>
<updated>2022-10-13T23:55:27+00:00</updated>
<author>
<name>Michal Paszkowski</name>
<email>michal.paszkowski@outlook.com</email>
</author>
<published>2022-10-10T22:17:11+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=14ea4f5bf262037a90064d842138593961db7de9'/>
<id>14ea4f5bf262037a90064d842138593961db7de9</id>
<content type='text'>
Differential Revision: https://reviews.llvm.org/D135624
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Differential Revision: https://reviews.llvm.org/D135624
</pre>
</div>
</content>
</entry>
<entry>
<title>[SPIRV] Fix call lowering of "anonymous" functions</title>
<updated>2022-10-10T22:06:29+00:00</updated>
<author>
<name>Michal Paszkowski</name>
<email>michal.paszkowski@outlook.com</email>
</author>
<published>2022-10-06T19:35:41+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=7a3c9a85c5fa614ba43b013fce3445fe1f8fdd3f'/>
<id>7a3c9a85c5fa614ba43b013fce3445fe1f8fdd3f</id>
<content type='text'>
The patch fixes lowering of anonymous functions, removes file/linkage
info for builtin call demangling, and adds relevant test demonstrating
a fixed problem.

Differential Revision: https://reviews.llvm.org/D135390
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The patch fixes lowering of anonymous functions, removes file/linkage
info for builtin call demangling, and adds relevant test demonstrating
a fixed problem.

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