Skip to content

[HLSL] reenable add packoffset in AST #91474

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

Merged
merged 3 commits into from
May 9, 2024

Conversation

python3kgae
Copy link
Contributor

@python3kgae python3kgae commented May 8, 2024

This reapplies c5509fe "[HLSL] Support packoffset attribute in AST (#89836)" with a fix for the test failure caused by missing -fnative-half-type.

Since we have to parse the attribute manually in ParseHLSLAnnotations, we could create the ParsedAttribute with an integer offset parameter instead of string. This approach avoids parsing the string if the offset is saved as a string in HLSLPackOffsetAttr.

For #57914

@python3kgae python3kgae added the HLSL HLSL Language Support label May 8, 2024
@llvmbot llvmbot added the clang Clang issues not falling into any other category label May 8, 2024
@llvmbot
Copy link
Member

llvmbot commented May 8, 2024

@llvm/pr-subscribers-clang

@llvm/pr-subscribers-hlsl

Author: Xiang Li (python3kgae)

Changes

Fix the test fail caused by missing -fnative-half-type.

For #57914


Full diff: https://github.com/llvm/llvm-project/pull/91474.diff

2 Files Affected:

  • (modified) clang/test/AST/HLSL/packoffset.hlsl (+1-1)
  • (modified) clang/test/SemaHLSL/packoffset-invalid.hlsl (+1-1)
diff --git a/clang/test/AST/HLSL/packoffset.hlsl b/clang/test/AST/HLSL/packoffset.hlsl
index 9cfd88eeec330..060288c2f7f76 100644
--- a/clang/test/AST/HLSL/packoffset.hlsl
+++ b/clang/test/AST/HLSL/packoffset.hlsl
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -triple dxil-unknown-shadermodel6.3-library -S -finclude-default-header  -ast-dump  -x hlsl %s | FileCheck %s
+// RUN: %clang_cc1 -triple dxil-unknown-shadermodel6.3-library -S -finclude-default-header -fnative-half-type -ast-dump  -x hlsl %s | FileCheck %s
 
 
 // CHECK: HLSLBufferDecl {{.*}} cbuffer A
diff --git a/clang/test/SemaHLSL/packoffset-invalid.hlsl b/clang/test/SemaHLSL/packoffset-invalid.hlsl
index c5983f6fd7e07..526a511edf1f2 100644
--- a/clang/test/SemaHLSL/packoffset-invalid.hlsl
+++ b/clang/test/SemaHLSL/packoffset-invalid.hlsl
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -finclude-default-header -triple dxil-pc-shadermodel6.3-library -verify %s
+// RUN: %clang_cc1 -finclude-default-header -triple dxil-pc-shadermodel6.3-library -fnative-half-type -verify %s
 
 // expected-warning@+1{{cannot mix packoffset elements with nonpackoffset elements in a cbuffer}}
 cbuffer Mix

@llvmbot llvmbot added the clang:frontend Language frontend issues, e.g. anything involving "Sema" label May 8, 2024
@bogner
Copy link
Contributor

bogner commented May 8, 2024

When reapplying a change that was reverted, please include enough information in the description so that it can be understood without having to dig up the old change. Something like:

[HLSL] reenable add packoffset in AST

This reapplies c5509fe "[HLSL] Support packoffset attribute in AST (#89836)" with a fix for the test failure caused by missing -fnative-half-type.

Since we have to parse the attribute manually in ParseHLSLAnnotations, we could create the ParsedAttribute with a integer offset parameter instead of string. This approach avoids parsing the string if the offset is saved as a string in HLSLPackOffsetAttr.

@python3kgae
Copy link
Contributor Author

When reapplying a change that was reverted, please include enough information in the description so that it can be understood without having to dig up the old change. Something like:

[HLSL] reenable add packoffset in AST
This reapplies c5509fe "[HLSL] Support packoffset attribute in AST (#89836)" with a fix for the test failure caused by missing -fnative-half-type.
Since we have to parse the attribute manually in ParseHLSLAnnotations, we could create the ParsedAttribute with a integer offset parameter instead of string. This approach avoids parsing the string if the offset is saved as a string in HLSLPackOffsetAttr.

Update. Thanks a lot.

@python3kgae python3kgae merged commit 41f0574 into llvm:main May 9, 2024
5 checks passed
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" clang Clang issues not falling into any other category HLSL HLSL Language Support
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

4 participants