Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[HLSL] Improve logic for choosing spv/dx intrinsic at CG #83882

Closed
sudonatalie opened this issue Mar 4, 2024 · 1 comment · Fixed by #87171
Closed

[HLSL] Improve logic for choosing spv/dx intrinsic at CG #83882

sudonatalie opened this issue Mar 4, 2024 · 1 comment · Fixed by #87171
Assignees
Labels
clang:codegen enhancement Improving things as opposed to bug fixing, e.g. new or missing feature HLSL HLSL Language Support

Comments

@sudonatalie
Copy link
Member

Follow-up from: #82536

More target-specific intrinsics are going to be added that are effectively shared between SPIR-V and DirectX backends, so we need a better design for HLSL CodeGen than repetitive switch/if statements on the target. There are a few possible patterns discussed here: #82536 (comment).

@sudonatalie sudonatalie added enhancement Improving things as opposed to bug fixing, e.g. new or missing feature clang:codegen HLSL HLSL Language Support labels Mar 4, 2024
@llvmbot
Copy link
Collaborator

llvmbot commented Mar 4, 2024

@llvm/issue-subscribers-clang-codegen

Author: Natalie Chouinard (sudonatalie)

Follow-up from: https://github.com//pull/82536

More target-specific intrinsics are going to be added that are effectively shared between SPIR-V and DirectX backends, so we need a better design for HLSL CodeGen than repetitive switch/if statements on the target. There are a few possible patterns discussed here: #82536 (comment).

@farzonl farzonl self-assigned this Mar 25, 2024
farzonl added a commit to farzonl/llvm-project that referenced this issue Mar 27, 2024
This PR is part of bookkeeping for llvm#83882.
It also brings the SPIRV hlsl intrinsics tests in
parity with where the testing is on the DXIL backend.
farzonl added a commit to farzonl/llvm-project that referenced this issue Mar 28, 2024
This PR is part of bookkeeping for llvm#83882.
It also brings the SPIRV hlsl intrinsics tests in
parity with where the testing is on the DXIL backend.
farzonl added a commit that referenced this issue Apr 2, 2024
This PR is part of bookkeeping for #83882.
It also brings the SPIRV hlsl intrinsic tests in
parity with where the testing is on the DXIL backend.
farzonl added a commit that referenced this issue Apr 5, 2024
…lection of HLSL backends (#87171)

Start of #83882
- `Builtins.td` - add the `hlsl` `all` elementwise builtin.
- `CGBuiltin.cpp` - Show a use case for CGHLSLUtils via an `all`
intrinsic codegen.
- `CGHLSLRuntime.cpp` - move `thread_id` to use CGHLSLUtils.
- `CGHLSLRuntime.h` - Create a macro to help pick the right intrinsic
for the backend.
- `hlsl_intrinsics.h` - Add the `all` api.
- `SemaChecking.cpp` - Add `all` builtin type checking
- `IntrinsicsDirectX.td` - Add the `all` `dx` intrinsic
- `IntrinsicsSPIRV.td` - Add the `all` `spv` intrinsic

Work still needed:
- `SPIRVInstructionSelector.cpp` - Add an implementation of `OpAll` for
`spv_all` intrinsic
@farzonl farzonl closed this as completed Apr 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
clang:codegen enhancement Improving things as opposed to bug fixing, e.g. new or missing feature HLSL HLSL Language Support
Projects
Status: Done
3 participants