Skip to content

Move helper functions out of SemaHLSL into a common location for SemaSPIRV to use #123831

Open
@Icohedron

Description

@Icohedron

While working on #122992, @inbelic mentioned that the semantics checks in clang/lib/Sema/SemaSPIRV.cpp could be simplified by using helper functions that are currently only present in clang/lib/Sema/SemaHLSL.cpp, such as CheckArgTypeIsCorrect and CheckAllArgTypesAreCorrect.

It would be useful to migrate the helper functions out of SemaHLSL into a common location accessible to both SemaHLSL and SemaSPIRV to make the code in SemaSPIRV less verbose and more readable.

Activity

added
HLSLHLSL Language Support
and removed on Jan 21, 2025
moved this to Planning in HLSL Supporton Jan 21, 2025
farzonl

farzonl commented on Jan 21, 2025

@farzonl
Member

Keep in mind not all hlsl vector rules apply to spirv. For example half and double data type rules in hlsl will be different from spirv.

added
clang:frontendLanguage frontend issues, e.g. anything involving "Sema"
on Jan 28, 2025
llvmbot

llvmbot commented on Jan 28, 2025

@llvmbot
Member

@llvm/issue-subscribers-clang-frontend

Author: Deric Cheung (Icohedron)

While working on #122992, @inbelic [mentioned](https://github.com//pull/122992#pullrequestreview-2559625948) that the semantics checks in `clang/lib/Sema/SemaSPIRV.cpp` could be simplified by using helper functions that are currently only present in `clang/lib/Sema/SemaHLSL.cpp`, such as `CheckArgTypeIsCorrect` and `CheckAllArgTypesAreCorrect`.

It would be useful to migrate the helper functions out of SemaHLSL into a common location accessible to both SemaHLSL and SemaSPIRV to make the code in SemaSPIRV less verbose and more readable.

changed the title [-][HLSL] Move helper functions out of SemaHLSL into a common location for SemaSPIRV to use[/-] [+]Move helper functions out of SemaHLSL into a common location for SemaSPIRV to use[/+] on Jan 28, 2025
llvmbot

llvmbot commented on Jan 28, 2025

@llvmbot
Member

Hi!

This issue may be a good introductory issue for people new to working on LLVM. If you would like to work on this issue, your first steps are:

  1. Check that no other contributor has already been assigned to this issue. If you believe that no one is actually working on it despite an assignment, ping the person. After one week without a response, the assignee may be changed.
  2. In the comments of this issue, request for it to be assigned to you, or just create a pull request after following the steps below. Mention this issue in the description of the pull request.
  3. Fix the issue locally.
  4. Run the test suite locally. Remember that the subdirectories under test/ create fine-grained testing targets, so you can e.g. use make check-clang-ast to only run Clang's AST tests.
  5. Create a Git commit.
  6. Run git clang-format HEAD~1 to format your changes.
  7. Open a pull request to the upstream repository on GitHub. Detailed instructions can be found in GitHub's documentation. Mention this issue in the description of the pull request.

If you have any further questions about this issue, don't hesitate to ask via a comment in the thread below.

llvmbot

llvmbot commented on Jan 28, 2025

@llvmbot
Member

@llvm/issue-subscribers-good-first-issue

Author: Deric Cheung (Icohedron)

While working on #122992, @inbelic [mentioned](https://github.com//pull/122992#pullrequestreview-2559625948) that the semantics checks in `clang/lib/Sema/SemaSPIRV.cpp` could be simplified by using helper functions that are currently only present in `clang/lib/Sema/SemaHLSL.cpp`, such as `CheckArgTypeIsCorrect` and `CheckAllArgTypesAreCorrect`.

It would be useful to migrate the helper functions out of SemaHLSL into a common location accessible to both SemaHLSL and SemaSPIRV to make the code in SemaSPIRV less verbose and more readable.

moved this from Planning to Ready in HLSL Supporton Jan 28, 2025
bassiounix

bassiounix commented on Jan 30, 2025

@bassiounix
Contributor

I'd like to be assigned to this. I'll try to extract the common part with the 2 functions mentioned in the issue and the SemaSPIRV.cpp.

kunxl-gg

kunxl-gg commented on Mar 13, 2025

@kunxl-gg

Hey, is this issue being worked upon by someone? Would like to work on this.

farzonl

farzonl commented on Mar 13, 2025

@farzonl
Member

@kunxl-gg this issue is blocked. We should remove the good first issue from this ticket. The last pr revealed this was a more complicated ask than we had considered.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    clang:frontendLanguage frontend issues, e.g. anything involving "Sema"

    Type

    Projects

    Status

    Ready

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @farzonl@Icohedron@damyanp@inbelic@bassiounix

        Issue actions

          Move helper functions out of SemaHLSL into a common location for SemaSPIRV to use · Issue #123831 · llvm/llvm-project