-
Notifications
You must be signed in to change notification settings - Fork 11k
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] MS-style for
and while
statement unroll
attribute
#70114
Comments
@llvm-beanz - checking here - the title seems to suggest that this involves actually implementing |
That's probably poor issue writing on my part. The AC should really be "this feature should work and be tested". My hope is that this can just be implemented in terms of the existing loop hint support, and I wanted to track that since I probably won't be the person to actually do this work. I haven't had time to investigate further to verify that the existing mechanisms will handle our needs so it is possible this task is bigger than I suspect. |
@llvm/issue-subscribers-clang-codegen Author: Chris B (llvm-beanz)
HLSL `for` and `while` loops support Microsoft-syntax attributes. For Phase 1 we need to support parsing the `unroll` attribute:
https://learn.microsoft.com/en-us/windows/win32/direct3dhlsl/dx-graphics-hlsl-for AC: |
@llvm/issue-subscribers-clang-frontend Author: Chris B (llvm-beanz)
HLSL `for` and `while` loops support Microsoft-syntax attributes. For Phase 1 we need to support parsing the `unroll` attribute:
https://learn.microsoft.com/en-us/windows/win32/direct3dhlsl/dx-graphics-hlsl-for AC: |
spec: microsoft/hlsl-specs#263 - `Attr.td` - Define the HLSL loop attribute hints (unroll and loop) - `AttrDocs.td` - Add documentation for unroll and loop - `CGLoopInfo.cpp` - Add codegen for HLSL unroll that maps to clang unroll expectations - `ParseStmt.cpp` - For statements if HLSL define DeclSpecAttrs via MaybeParseMicrosoftAttributes - `SemaStmtAttr.cpp` - Add the HLSL loop unroll handeling resolves llvm#70114 dxc examples: - for loop: https://hlsl.godbolt.org/z/8EK6Pa139 - while loop: https://hlsl.godbolt.org/z/ebr5MvEcK - do while: https://hlsl.godbolt.org/z/be8cedoTs Documentation: ![Screenshot_20240531_143000](https://github.com/llvm/llvm-project/assets/1802579/9da9df9b-68a6-49eb-9d4f-e080aa2eff7f)
HLSL
for
andwhile
loops support Microsoft-syntax attributes. For Phase 1 we need to support parsing theunroll
attribute:https://learn.microsoft.com/en-us/windows/win32/direct3dhlsl/dx-graphics-hlsl-for
https://learn.microsoft.com/en-us/windows/win32/direct3dhlsl/dx-graphics-hlsl-while
AC:
Investigate if we can implement the
unroll
attribute via the clangloophint
attributeif there are differences then additional work items will be created for later phases
The text was updated successfully, but these errors were encountered: