Skip to content

[DirectX][Scalarizer] Add support to scalarize struct of vector return types #111437

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

Closed
farzonl opened this issue Oct 7, 2024 · 0 comments · Fixed by #111569
Closed

[DirectX][Scalarizer] Add support to scalarize struct of vector return types #111437

farzonl opened this issue Oct 7, 2024 · 0 comments · Fixed by #111569
Assignees

Comments

@farzonl
Copy link
Member

farzonl commented Oct 7, 2024

Implement this RFC https://discourse.llvm.org/t/rfc-allow-the-scalarizer-pass-to-scalarize-vectors-returned-in-structs/82306

look into complexity of adding llvm.frexp test case.

@farzonl farzonl self-assigned this Oct 7, 2024
@farzonl farzonl converted this from a draft issue Oct 7, 2024
@farzonl farzonl linked a pull request Oct 8, 2024 that will close this issue
@damyanp damyanp moved this from Planning to Active in HLSL Support Oct 15, 2024
@damyanp damyanp moved this from Active to Needs Review in HLSL Support Oct 17, 2024
farzonl added a commit that referenced this issue Oct 21, 2024
Based on this RFC:
https://discourse.llvm.org/t/rfc-allow-the-scalarizer-pass-to-scalarize-vectors-returned-in-structs/82306

LLVM intrinsics do not support out params. To get around this limitation
implementers will make intrinsics return structs to capture a return
type and an out param. This implementation detail should not impact
scalarization since these cases should be elementwise operations.

## Three changes are needed. 
- The CallInst visitor needs to be updated to handle Structs
- A new visitor is needed for `ExtractValue` instructions
- finsh needs to be update to handle structs so that insert elements are
properly propogated.

## Testing changes
- Add support for `llvm.frexp`
- Add support for `llvm.dx.splitdouble`

fixes #111437
@damyanp damyanp removed the status in HLSL Support Oct 22, 2024
KornevNikita pushed a commit to intel/llvm that referenced this issue Feb 19, 2025
Based on this RFC:
https://discourse.llvm.org/t/rfc-allow-the-scalarizer-pass-to-scalarize-vectors-returned-in-structs/82306

LLVM intrinsics do not support out params. To get around this limitation
implementers will make intrinsics return structs to capture a return
type and an out param. This implementation detail should not impact
scalarization since these cases should be elementwise operations.

## Three changes are needed. 
- The CallInst visitor needs to be updated to handle Structs
- A new visitor is needed for `ExtractValue` instructions
- finsh needs to be update to handle structs so that insert elements are
properly propogated.

## Testing changes
- Add support for `llvm.frexp`
- Add support for `llvm.dx.splitdouble`

fixes llvm/llvm-project#111437
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

2 participants