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] bitcasts emitted instead of vector conversions in binary operators #106253

Closed
Tracked by #21 ...
llvm-beanz opened this issue Aug 27, 2024 · 1 comment · Fixed by #108659 or #110195
Closed
Tracked by #21 ...

[HLSL] bitcasts emitted instead of vector conversions in binary operators #106253

llvm-beanz opened this issue Aug 27, 2024 · 1 comment · Fixed by #108659 or #110195
Assignees
Labels
clang:frontend Language frontend issues, e.g. anything involving "Sema" HLSL HLSL Language Support

Comments

@llvm-beanz
Copy link
Collaborator

llvm-beanz commented Aug 27, 2024

Clang currently is resolving different cast expressions for binary operator arguments than for function argument expressions. This causes bitcasts to be used instead of correct implicit conversion sequences.

See reproduction case: https://hlsl.godbolt.org/z/jKGcGbE4Y

This change will require the following:

@llvm-beanz llvm-beanz converted this from a draft issue Aug 27, 2024
@llvm-beanz llvm-beanz added HLSL HLSL Language Support and removed new issue labels Aug 27, 2024
@llvm-beanz llvm-beanz self-assigned this Sep 3, 2024
llvm-beanz added a commit to llvm-beanz/llvm-project that referenced this issue Sep 13, 2024
HLSL has a different set of usual arithmetic conversions for vector
types to resolve a common type for binary operator expressions.

This PR implements the current spec proposal from:
microsoft/hlsl-specs#311

There is one case that may need additional handling for implicitly
truncating `vector<T,1>` to `T` early to allow other transformations.

Fixes llvm#106253
@EugeneZelenko EugeneZelenko added the clang:frontend Language frontend issues, e.g. anything involving "Sema" label Sep 26, 2024
@llvmbot
Copy link
Member

llvmbot commented Sep 26, 2024

@llvm/issue-subscribers-clang-frontend

Author: Chris B (llvm-beanz)

Clang currently is resolving different cast expressions for binary operator arguments than for function argument expressions. This causes bitcasts to be used instead of correct implicit conversion sequences.

See reproduction case: https://hlsl.godbolt.org/z/jKGcGbE4Y

This change will require the following:

llvm-beanz added a commit to llvm-beanz/llvm-project that referenced this issue Sep 27, 2024
types to resolve a common type for binary operator expressions.

This PR implements the current spec proposal from:
microsoft/hlsl-specs#311

There is one case that may need additional handling for implicitly
truncating vector<T,1> to T early to allow other transformations.

Fixes llvm#106253

../clang/test/SemaHLSL/Language/UsualArithmeticConversions.hlsl
llvm-beanz added a commit that referenced this issue Sep 27, 2024
HLSL has a different set of usual arithmetic conversions for vector
types to resolve a common type for binary operator expressions.

This PR implements the current spec proposal from:
microsoft/hlsl-specs#311

There is one case that may need additional handling for implicitly
truncating vector<T,1> to T early to allow other transformations.

Fixes #106253

Re-lands #108659
Sterling-Augustine pushed a commit to Sterling-Augustine/llvm-project that referenced this issue Sep 27, 2024
HLSL has a different set of usual arithmetic conversions for vector
types to resolve a common type for binary operator expressions.

This PR implements the current spec proposal from:
microsoft/hlsl-specs#311

There is one case that may need additional handling for implicitly
truncating `vector<T,1>` to `T` early to allow other transformations.

Fixes llvm#106253
xgupta pushed a commit to xgupta/llvm-project that referenced this issue Oct 4, 2024
HLSL has a different set of usual arithmetic conversions for vector
types to resolve a common type for binary operator expressions.

This PR implements the current spec proposal from:
microsoft/hlsl-specs#311

There is one case that may need additional handling for implicitly
truncating `vector<T,1>` to `T` early to allow other transformations.

Fixes llvm#106253
xgupta pushed a commit to xgupta/llvm-project that referenced this issue Oct 4, 2024
HLSL has a different set of usual arithmetic conversions for vector
types to resolve a common type for binary operator expressions.

This PR implements the current spec proposal from:
microsoft/hlsl-specs#311

There is one case that may need additional handling for implicitly
truncating vector<T,1> to T early to allow other transformations.

Fixes llvm#106253

Re-lands llvm#108659
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
clang:frontend Language frontend issues, e.g. anything involving "Sema" HLSL HLSL Language Support
Projects
Status: No status
3 participants