139 Commits

Author SHA1 Message Date
Steven Perron
9dc8f465a4
[SPIRV] Implement the int_spv_resource_calculate_lod* IntrinsicsSPIRV (#188337)
Implements intrinsics used to get the level-of-detail given a texture,
sampler, and a coordinate. It will be used to implement the
corresponding HLSL methods.

Assisted-by: Gemini
2026-04-01 14:03:42 +00:00
Arseniy Obolenskiy
c97561ced1
[SPIR-V] Derive FPFastMathMode from nofpclass attributes on OpenCL builtins (#188984) 2026-03-31 22:25:22 +02:00
Arseniy Obolenskiy
b7b9368738
[SPIR-V] Support for C++ for OpenCL source language (#188791)
- Add CPP_for_OpenCL source language operand
- Handle opencl.cxx.version metadata

Align handling with SPIR-V translator logic and tests presented there
2026-03-27 15:36:27 +01:00
Arseniy Obolenskiy
14de6dafee
[SPIR-V] Support global variable annotations in llvm.global.annotations (#187241)
SPIR-V backend previously only supported function annotations in
llvm.global.annotations and crashed with a fatal error when encountering
global variable entries
2026-03-20 11:19:12 +01:00
Viktoria Maximova
eaf04be341
[SPIR-V] Complete SPV_INTEL_16bit_atomics extension support (#184312)
Add missing capabilities to finalize SPV_INTEL_16bit_atomics extension:
- AtomicInt16CompareExchangeINTEL (6260): for i16
load/store/exchange/cmpxchg
- Int16AtomicsINTEL (6261): for i16 arithmetic atomics (add, sub, min,
max, etc.)
- AtomicBFloat16LoadStoreINTEL (6262): for bfloat16 load/store/exchange

This completes the implementation started in 6ef3218.

Specification:
https://github.com/intel/llvm/blob/sycl/sycl/doc/design/spirv-extensions/SPV_INTEL_16bit_atomics.asciidoc
2026-03-19 11:34:57 +01:00
Kai
eabcfcee08
[HLSL][DXIL][SPIRV] QuadReadAcrossX intrinsic support (#184360)
This PR adds QuadReadAcrossX intrinsic support in HLSL with codegen for
both DirectX and SPIRV backends. Resolves
https://github.com/llvm/llvm-project/issues/99175.

- [x] Implement QuadReadAcrossX clang builtin
- [x]  Link QuadReadAcrossX clang builtin with hlsl_intrinsics.h
- [x] Add sema checks for QuadReadAcrossX to
CheckHLSLBuiltinFunctionCall in SemaChecking.cpp
- [x] Add codegen for QuadReadAcrossX to EmitHLSLBuiltinExpr in
CGBuiltin.cpp
- [x] Add codegen tests to
clang/test/CodeGenHLSL/builtins/QuadReadAcrossX.hlsl
- [x] Add sema tests to
clang/test/SemaHLSL/BuiltIns/QuadReadAcrossX-errors.hlsl
- [x] Create the int_dx_QuadReadAcrossX intrinsic in
IntrinsicsDirectX.td
- [x] Create the DXILOpMapping of int_dx_QuadReadAcrossX to 123 in
DXIL.td
- [x] Create the QuadReadAcrossX.ll and QuadReadAcrossX_errors.ll tests
in llvm/test/CodeGen/DirectX/
- [x] Create the int_spv_QuadReadAcrossX intrinsic in IntrinsicsSPIRV.td
- [x] In SPIRVInstructionSelector.cpp create the QuadReadAcrossX
lowering and map it to int_spv_QuadReadAcrossX in
SPIRVInstructionSelector::selectIntrinsic.
- [x] Create SPIR-V backend test case in
llvm/test/CodeGen/SPIRV/hlsl-intrinsics/QuadReadAcrossX.ll
2026-03-18 11:49:34 -07:00
Arseniy Obolenskiy
bec0f40ef2
[SPIR-V] Handle spirv.MemoryModel metadata (#186138) 2026-03-17 13:59:07 +01:00
Fangrui Song
7d6a642161
Remove unneeded cl::ZeroOrMore for cl::opt/cl::list options. NFC (#186044)
Similar to commit 557efc9a8b68628c2c944678c6471dac30ed9e8e (2022).

cl::ZeroOrMore is the default for cl::list and is unnecessary for
cl::opt
since the "may only occur zero or one times!" error was removed.
Also remove cl::init(false) on modified cl::opt<bool> lines.
2026-03-12 07:17:57 +00:00
Steven Perron
bf67e4d4ad
[HLSL][SPIR-V] Add resource load level intrinsics and SPIR-V backend support (#185707)
Adds the intrinsics resource_load_level intrinic for DXIL and SPIR-V. It
will be used to load a value from an specific location in the image at
the given mip level. It will be used to implement the Texture Load and
mips[][] methods.

Assisted-by: Gemini
2026-03-11 16:59:07 +00:00
Arseniy Obolenskiy
d8f71b1638
[SPIR-V] Add support for SPV_INTEL_masked_gather_scatter extension (#185418)
Fixes the first bullet in #184638 

Corresponding patch to add support for vector operands in
OpConvertPtrToU/OpConvertUToPtr operations in spirv-val:
https://github.com/KhronosGroup/SPIRV-Tools/pull/6575

SPIR-V extension reference used:
278044a51f/extensions/INTEL/SPV_INTEL_masked_gather_scatter.asciidoc
2026-03-11 13:14:36 +01:00
Karol Herbst
cc38e4232c
[SPIR-V] Make SPIRVModuleAnalysis::MAI a non static member (#160956)
Otherwise multiple translation units in the same process could run into
ID reuse collisions cause invalid SPIR-Vs to be generated due to having
multiple definition for the same SPIR-V SSA value.

Closes: https://github.com/llvm/llvm-project/issues/160613
2026-03-10 16:16:56 +01:00
Nick Sarnie
c782e2d405
[SPIRV] Don't emit service function basic block names (#184206)
Right now if a module has a service function we always emit `OpName
entry` for the service function's basic block.

The actual service function isn't emitted and no other instruction uses
the basic block `OpName` instruction, so don't emit it.

Signed-off-by: Nick Sarnie <nick.sarnie@intel.com>
2026-03-03 14:26:40 +00:00
Steven Perron
4c8ad96a4a
[SPIRV] Implement Gather and GatherCmp intrinsics (#182578)
This commit implements the intrinsics needed to represent the texture
Gather* instructions in HLSL.

Assisted-by: Gemini
2026-02-25 09:06:58 -05:00
Juan Manuel Martinez Caamaño
7f2b875c7d
[SPIRV] Replace SPIRVType with SPIRVTypeInst as much as we can (#180721)
Second part of https://github.com/llvm/llvm-project/pull/179947 where we
use `SPIRVTypeInst` as much as we can.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-02-11 14:05:08 +01:00
Steven Perron
e1d2ff6caf
[SPIRV] Implement lowering for HLSL Texture2D sampling intrinsics (#179312)
This patch implements the SPIR-V lowering for the following HLSL
intrinsics:
- SampleBias
- SampleGrad
- SampleLevel
- SampleCmp
- SampleCmpLevelZero

It defines the required LLVM intrinsics in 'IntrinsicsDirectX.td' and
'IntrinsicsSPIRV.td'.

It updates 'SPIRVInstructionSelector.cpp' to handle the new intrinsics
and
generates the correct 'OpImageSample*' instructions with the required
operands
(Bias, Grad, Lod, ConstOffset, MinLod, etc.).

CodeGen tests are added to verify the implementation for images with
dimension 1D, 2D, 3D, and Cube.

Assisted-by: Gemini
2026-02-09 17:28:58 -05:00
Dmitry Sidorov
fcc4231ac5
[SPIR-V] Add SPV_INTEL_unstructured_loop_controls extension (#178799)
For compute we don't run structurizer hence we won't be able to preserve
loop metadata via LoopMerge instruction. So
SPV_INTEL_unstructured_loop_controls is the only way we can preserve the
info in unstructured control flow.
2026-02-02 15:06:18 +01:00
Viktoria Maximova
8f8dfbf8c9
[SPIR-V] Implement SPV_KHR_fma extension (#173057)
The extension adds support for the `OpFmaKHR` instruction, which
provides a native SPIR-V instruction for fused multiply-add operations
as an alternative to using OpenCL.std::Fma extended instruction.

Translate both LLVM fma intrinsics as well as OCL builtins to `OpFmaKHR`
if the extension is available.

Specification:

https://github.khronos.org/SPIRV-Registry/extensions/KHR/SPV_KHR_fma.html
2026-01-29 17:39:57 -08:00
Steven Perron
296f5a75bd
[SPIR-V] Implement sample and sample_clamp intrinsics for HLSL resources (#177234)
This patch implements the `sample` and `sample_clamp` intrinsics for
HLSL
resources in the SPIR-V backend. It adds the necessary intrinsic
definitions
in `IntrinsicsDirectX.td` and `IntrinsicsSPIRV.td`, and implements the
instruction selection logic in `SPIRVInstructionSelector.cpp`.

Key changes:
- Added `int_dx_resource_sample` and `int_dx_resource_sample_clamp`
intrinsics.
- Added `int_spv_resource_sample` and `int_spv_resource_sample_clamp`
intrinsics.
- Implemented `selectSampleIntrinsic` to handle
`OpImageSampleImplicitLod` generation.
- Added `ResourceDimension` enum in `DXILABI.h` and `HLSLResource.h`.
- Added a new test case
`llvm/test/CodeGen/SPIRV/hlsl-resources/Sample.ll` to verify the
implementation.
2026-01-23 12:21:31 -05:00
Michal Paszkowski
a679a25ceb
Revert " [SPIRV] Addition of extension SPV_KHR_non_semantic_info and SPV_KHR_relaxed_extended_instruction" (#177093)
Reverts llvm/llvm-project#169643 due to build issues
2026-01-20 21:41:31 -08:00
Aadesh Premkumar
287be74a02
[SPIRV] Addition of extension SPV_KHR_non_semantic_info and SPV_KHR_relaxed_extended_instruction (#169643)
--Added support for the extension SPV_KHR_non_semantic_info
--Added support for the extension SPV_KHR_relaxed_extended_instruction 
--Added instructions from the documentation of the extension. 
--Added supporting tests for the same.

Same as #165302

---------

Co-authored-by: Michal Paszkowski <michal@michalpaszkowski.com>
2026-01-20 21:36:01 -08:00
Subash B
075e4672a6
[SPIRV] Added Support for the SPV_ALTERA_arbitrary_precision_floating_point Extension (#160054)
Added support for the SPV_ALTERA_arbitrary_precision_floating_point
extension, enabling all the arbitrary precision floating-point
operations with instruction definitions and test files.
2026-01-14 00:37:22 -08:00
Aadesh Premkumar
2c26d56045
[SPIRV] Support for the extension SPV_EXT_image_raw10_raw12 (#160032)
Added support for SPV_EXT_image_raw10_raw12 extension.
2025-12-15 23:57:36 -08:00
Alexander Johnston
4ca2caeab6
[HLSL] Implement ddx/ddy_fine intrinsics (#168874)
Implements the HLSL ddx_fine and ddy_fine intrinsics.
For the SPIRV backend the intrinsics are ensured to be unavailable in
opencl (as they require fragment execution stage).

Closes https://github.com/llvm/llvm-project/issues/99098
Closes https://github.com/llvm/llvm-project/issues/99101
2025-12-12 09:34:41 -08:00
Alex Voicu
ef47462ce9
[SPIRV] Start adding support for int128 (#170798)
LLVM has pretty thorough support for `int128`, and it has started seeing
some use. Even thouth we already have support for the
`SPV_ALTERA_arbitrary_precision_integers` extension, the BE was oddly
capping integer width to 64-bits. This patch adds partial support for
lowering 128-bit integers to `OpTypeInt 128`. Some work remains to be
done around legalisation support and validating constant uses (e.g.
cases that get lowered to `OpSpecConstantOp`).
2025-12-09 17:11:28 +00:00
Alex Voicu
93d64a5c4d
[SPIRV] Add <2 x half> and <4 x half> atomics via SPV_NV_shader_atomic_fp16_vector (#170213)
This adds support for the `SPV_NV_shader_atomic_fp16_vector` extension,
and then uses it to enable lowering of atomic add, sub, min and max on 2
and 4 component vectors of FP16, which are rather common options in ML
workloads. Even though `bfloat16` also works in practice, we do not
enable it since it's not specified in the extension (which might need
updating / promoting to KHR at least). A `TODO` is also inserted in
`SPIRVModuleAnalysis.cpp' regarding the need to upgrade its ample usage
of `report_fatal_error`; I have a WiP patch for that, but it still needs
a bit of baking. Finally, a paired patch will be necessary in the
Translator, as it's not aware of the extension either - I'll update this
review to reference the PR once I create it.
2025-12-05 20:23:25 +00:00
Aadesh Premkumar
7494f3df14
[SPIRV] Added support for extension SPV_ALTERA_arbitrary_precision_fixed_point and name change of SPV_INTEL_arbitrary_precision_integers to SPV_ALTERA_arbitrary_precision_integers (#136085)
--Added support for extension SPV_ALTERA_arbitrary_precision_fixed_point
--Added test files for extension
SPV_ALTERA_arbitrary_precision_fixed_point
2025-11-30 18:44:51 -08:00
Kazu Hirata
7dd531f428
[SPIRV] Use range-based for loops (NFC) (#169241)
Identified with modernize-loop-convert.
2025-11-23 22:33:06 -08:00
Alexander Johnston
ed60cd2563
[HLSL] Implement ddx/ddy_coarse intrinsics (#164831)
Closes https://github.com/llvm/llvm-project/issues/99097
Closes https://github.com/llvm/llvm-project/issues/99100

As ddx and ddy are near identical implementations I've combined them in
this PR. This aims to unblock
https://github.com/llvm/llvm-project/pull/161378

---------

Co-authored-by: Alexander Johnston <alexander.johnston@amd.com>
2025-11-18 16:41:07 +01:00
Marcos Maronas
2681497d1b
[SPIRV] Allow multiple FuncParamAttr decoration on the same id. (#166782)
According to SPIR-V spec:

> It is invalid to decorate any given id or structure member more than
one time with the same
[decoration](https://registry.khronos.org/SPIR-V/specs/unified1/SPIRV.html#Decoration),
unless explicitly allowed below for a specific decoration.

`FuncParamAttr` explicitly allows multiple uses of the decoration on the
same id, so this patch honors it.
2025-11-10 15:24:50 +00:00
Alex Voicu
6ef32188b5
[SPIRV] Add support for bfloat16 atomics via the SPV_INTEL_16bit_atomics extension (#166257)
This enables support for atomic RMW ops (add, sub, min and max to be
precise) with `bfloat16` operands, via the [SPV_INTEL_16bit_atomics
extension](https://github.com/intel/llvm/pull/20009). It's logically a
successor to #166031 (I should've used a stack), but I'm putting it up
for early review.

---------

Co-authored-by: Matt Arsenault <arsenm2@gmail.com>
2025-11-09 17:26:14 +00:00
Aadesh Premkumar
47cf5a1b82
[SPIRV] Support for the extension SPV_ALTERA_blocking_pipes (#138675)
--Added support for the extension SPV_ALTERA_blocking_pipes
--Added test files for the extension SPV_ALTERA_blocking_pipes
2025-11-06 11:59:54 +01:00
Alex Voicu
2286118e6f
[SPIRV] Enable bfloat16 arithmetic (#166031)
Enable the `SPV_INTEL_bfloat16_arithmetic` extension, which allows arithmetic, relational and `OpExtInst` instructions to take `bfloat16` arguments. This patch only adds support to arithmetic and relational ops. The extension itself is rather fresh, but `bfloat16` is ubiquitous at this point and not supporting these ops is limiting.
2025-11-04 18:10:26 +02:00
Alex Voicu
2237a18f25
[SPIRV] Enable OpenCL max_work_group_size translation via SPV_INTEL_kernel_attributes (#165891)
This adds BE support for the
[`SPV_INTEL_kernel_attributes`](https://github.khronos.org/SPIRV-Registry/extensions/INTEL/SPV_INTEL_kernel_attributes.html)
extension. The extension is necessary to encode the rather useful
`max_work_group_size` kernel attribute, via `OpExecutionMode
MaxWorkgroupSizeINTEL`, which is the only Execution Mode added by the
extension that this patch adds full processing for. Future patches will
add the other Execution Modes and Capabilities. The test is adapted from
the equivalent Translator test; it depends on #165815.
2025-11-04 14:37:16 +00:00
Kazu Hirata
315a32a1a3
[SPIRV] Remove a redundant cast (NFC) (#165833)
FinalFlags is already of type unsigned.
2025-10-31 09:42:23 -07:00
Juan Manuel Martinez Caamaño
77ade8905f
[NFC] Use F->isDeclaration instead of (*F).isDeclaration (#164238) 2025-10-20 17:24:35 +02:00
Juan Manuel Martinez Caamaño
fbc2d06c54
[NFC][SPIRV] Remove useless static_cast (#164239) 2025-10-20 16:17:52 +02:00
Lucie Choi
62f91152fb
[SPIR-V] Add capability for non-uniform indexing for StructuredBuffer types. (#163424)
- Capability `StorageBufferArrayNonUniformIndexing` is required if the
non-uniform index accesses "arrays in the StorageBuffer [storage
class](https://registry.khronos.org/SPIR-V/specs/unified1/SPIRV.html#Storage_Class)
or
BufferBlock-[decorated](https://registry.khronos.org/SPIR-V/specs/unified1/SPIRV.html#Decoration)
arrays." (e.g. `RWStructuredBuffer`, `StructuredBuffer`)

- Also fix the wrong unit test name: `StructuredBufferNonUniformIdx.ll`
-> `RWBufferNonUniformIdx.ll`

Resolves https://github.com/llvm/llvm-project/issues/162889
Addresses https://github.com/llvm/llvm-project/issues/161852
2025-10-17 17:17:09 -04:00
Lucie Choi
a43c0cf77f
[SPIR-V] Generate SPIR-V instructions when 'enable-maximal-reconvergence' function attribute is set (#163682)
Implement maximal reconvergence in SPIR-V codegen.

Addresses https://github.com/llvm/llvm-project/issues/136930
2025-10-17 13:12:56 +02:00
YixingZhang007
f802acf32d
[SPIR-V] Add SPV_INTEL_predicated_io extension (#161591)
This PR introduces the support for the SPIR-V extension
`SPV_INTEL_predicated_io`. This extension adds predicated load and store
instructions. Predicated load performs load from memory if predicate is
true; otherwise, it uses default_value as a result. Predicated store
performs store of value to memory if predicate is true; otherwise, it
does nothing.

Reference Specification:

https://github.com/intel/llvm/blob/sycl/sycl/doc/design/spirv-extensions/SPV_INTEL_predicated_io.asciidoc
2025-10-08 23:29:01 +02:00
Marcos Maronas
ebcf025e2e
[SPIR-V] Implement SPV_KHR_float_controls2 (#146941)
Implementation of
[SPV_KHR_float_controls2](https://github.khronos.org/SPIRV-Registry/extensions/KHR/SPV_KHR_float_controls2.html)
extension, and corresponding tests.

Some of the tests make use of `!spirv.ExecutionMode` LLVM named
metadata. This is because some SPIR-V instructions don't have a direct
equivalent in LLVM IR, so the SPIR-V Target uses different LLVM named
metadata to convey the necessary information. Below, you will find an
example from one of the newly added tests:
```
!spirv.ExecutionMode = !{!19, !20, !21, !22, !23, !24, !25, !26, !27}
!19 = !{ptr @k_float_controls_float, i32 6028, float poison, i32 131079}
!20 = !{ptr @k_float_controls_all, i32 6028, float poison, i32 131079}
!21 = !{ptr @k_float_controls_float, i32 31}
!22 = !{ptr @k_float_controls_all, i32 31}
!23 = !{ptr @k_float_controls_float, i32 4461, i32 32}
!24 = !{ptr @k_float_controls_all, i32 4461, i32 16}
!25 = !{ptr @k_float_controls_all, i32 4461, i32 32}
!26 = !{ptr @k_float_controls_all, i32 4461, i32 64}
!27 = !{ptr @k_float_controls_all, i32 4461, i32 128}
```
`!spirv.ExecutionMode` contains a list of metadata nodes, and each of
them specifies the required operands for expressing a particular
`OpExecutionMode` instruction in SPIR-V. For example, `!19 = !{ptr
@k_float_controls_float, i32 6028, float poison, i32 131079}` will be
lowered to `OpExecutionMode [[k_float_controls_float_ID]]
FPFastMathDefault [[float_type_ID]] 131079`.

---------

Co-authored-by: Dmitry Sidorov <dmitry.sidorov@intel.com>
2025-09-30 16:01:30 +01:00
Ebin-McW
0dbc1e2dff
[SPIRV] Added constraint for SPV_INTEL_bindless_image extension (#160249)
Added constraints related to Addressing model as specified in the
specification.
It conforms with the implementation in translator

Same as PR #160089
Solved all issues
2025-09-28 05:52:19 -07:00
Ebin-McW
5d85d54feb
[SPIRV] Add support for the extension SPV_EXT_relaxed_printf_string_address_space (#160245)
Added support for the extension to support more storageclass for printf
strings.
2025-09-28 05:50:15 -07:00
YixingZhang007
f91e0bf160
[SPIRV] Add support for the SPIR-V extension SPV_KHR_bfloat16 (#155645)
This PR introduces the support for the SPIR-V extension
`SPV_KHR_bfloat16`. This extension extends the `OpTypeFloat` instruction
to enable the use of bfloat16 types with cooperative matrices and dot
products.

TODO:
Per the `SPV_KHR_bfloat16` extension, there are a limited number of
instructions that can use the bfloat16 type. For example, arithmetic
instructions like `FAdd` or `FMul` can't operate on `bfloat16` values.
Therefore, a future patch should be added to either emit an error or
fall back to FP32 for arithmetic in cases where bfloat16 must not be
used.

Reference Specification:

https://github.com/KhronosGroup/SPIRV-Registry/blob/main/extensions/KHR/SPV_KHR_bfloat16.asciidoc
2025-09-22 14:52:57 +02:00
Marcos Maronas
b5a1747c8f
[SPIRV] Move instead of copy. (#156637) 2025-09-08 14:29:30 +02:00
Marcos Maronas
dfd506b948
[SPIRV] Fix code quality issues. (#152005)
Fix code quality issues reported by static analysis tool, such as:
- Rule of Three/Five.
- Dereference after null check.
- Unchecked return value.
- Variable copied when it could be moved.
2025-08-06 15:50:00 +01:00
Marcos Maronas
fd07d90f9f
[SPIRV] Fix buildbot failure after #149522 (#152135) 2025-08-05 15:32:13 +02:00
Marcos Maronas
cda4820270
[SPIRV] Do not use OpTypeRuntimeArray in Kernel env. (#149522)
Prior to this patch, when `NumElems` was 0, `OpTypeRuntimeArray` was
directly generated, but it requires `Shader` capability, so it can only
be generated if `Shader` env is being used. We have observed a pattern
of using unbound arrays that translate into `[0 x ...]` types in OpenCL,
which implies `Kernel` capability, so `OpTypeRuntimeArray` should not be
used. To prevent this scenario, this patch simplifies GEP instructions
where type is a 0-length array and the first index is also 0. In such
scenario, we effectively drop the 0-length array and the first index.

Additionally, the newly added test prior to this patch was generating a
module with both `Shader` and `Kernel` capabilities at the same time,
but they're incompatible. This patch also fixes that.

Finally, prior to this patch, the newly added test was adding `Shader`
capability to the module even with the command line flag
`--avoid-spirv-capabilities=Shader`. This patch also has a fix for that.
2025-08-05 15:10:15 +02:00
YixingZhang007
c0fa432315
[SPIR-V] Add support for the SPIR-V extension SPV_INTEL_tensor_float32_conversion (#150090)
This PR introduces the support for the SPIR-V extension
`SPV_INTEL_tensor_float32_conversion` and the corresponding OpenCL
extension `cl_intel_tensor_float32_conversions`.
This extension introduces a rounding instruction that converts standard
32-bit floating-point values to the TensorFloat32 (TF32) format.

Reference Specification: 

https://github.com/KhronosGroup/SPIRV-Registry/blob/main/extensions/INTEL/SPV_INTEL_tensor_float32_conversion.asciidoc
2025-08-01 22:43:59 +02:00
Steven Perron
4e213159af
[SPIRV] Add FloatControl2 capability (#144371)
Add handling for FPFastMathMode in SPIR-V shaders. This is a first pass
that
simply does a direct translation when the proper extension is available.
This will unblock work for HLSL. However, it is not a full solution.

The default math mode for spir-v is determined by the API. When
targeting Vulkan many of the fast math options are assumed. We should do
something particular when targeting Vulkan.

We will also need to handle the hlsl "precise" keyword correctly when
FPFastMathMode is not available.

Unblockes https://github.com/llvm/llvm-project/issues/140739, but we are
keeing it open to track the remaining issues mentioned above.
2025-07-02 08:48:57 -04:00
Nathan Gauër
ef1cb8277a
[SPIR-V] Fix ExecutionMode generation (#143888)
PR #141787 added code to emit the Fragment execution model. This
required emitting the OriginUpperLeft ExecutionMode. But this was done
by using the same codepath used for OpEntrypoint.

This has 2 issues:
- the interface variables were added to both OpEntryPoint and
OpExecutionMode.
- the existing OpExecutionMode logic was not used.

This commit fixes this, regrouping OpExecutionMode handling in one
place, and fixing bad codegen issue when interface variiables are added.
2025-06-12 18:13:29 +02:00