-
Notifications
You must be signed in to change notification settings - Fork 11.8k
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] Fix for build break introduced by #85662 #85839
Conversation
@llvm/pr-subscribers-clang Author: Farzon Lotfi (farzonl) ChangesThis change fixes a test case failure caused by pr #85662 Full diff: https://github.com/llvm/llvm-project/pull/85839.diff 2 Files Affected:
diff --git a/clang/include/clang/AST/Type.h b/clang/include/clang/AST/Type.h
index 10916053cdfbf5..be18535e3e4c8c 100644
--- a/clang/include/clang/AST/Type.h
+++ b/clang/include/clang/AST/Type.h
@@ -2245,6 +2245,7 @@ class alignas(TypeAlignment) Type : public ExtQualsTypeCommonBase {
bool isHalfType() const; // OpenCL 6.1.1.1, NEON (IEEE 754-2008 half)
bool isFloat16Type() const; // C11 extension ISO/IEC TS 18661
bool isFloat32Type() const;
+ bool isDoubleType() const;
bool isBFloat16Type() const;
bool isFloat128Type() const;
bool isIbm128Type() const;
@@ -7457,6 +7458,10 @@ inline bool Type::isFloat32Type() const {
return isSpecificBuiltinType(BuiltinType::Float);
}
+inline bool Type::isDoubleType() const {
+ return isSpecificBuiltinType(BuiltinType::Double);
+}
+
inline bool Type::isBFloat16Type() const {
return isSpecificBuiltinType(BuiltinType::BFloat16);
}
diff --git a/clang/lib/Sema/SemaChecking.cpp b/clang/lib/Sema/SemaChecking.cpp
index f9112a29027acd..ef3ab16ba29b41 100644
--- a/clang/lib/Sema/SemaChecking.cpp
+++ b/clang/lib/Sema/SemaChecking.cpp
@@ -5486,10 +5486,8 @@ bool CheckFloatOrHalfRepresentations(Sema *S, CallExpr *TheCall) {
bool CheckNoDoubleVectors(Sema *S, CallExpr *TheCall) {
auto checkDoubleVector = [](clang::QualType PassedType) -> bool {
- if (const auto *VecTy = dyn_cast<VectorType>(PassedType)) {
- clang::QualType BaseType = VecTy->getElementType();
- return !BaseType->isHalfType() && !BaseType->isFloat32Type();
- }
+ if (const auto *VecTy = PassedType->getAs<VectorType>())
+ return VecTy->getElementType()->isDoubleType();
return false;
};
return CheckArgsTypesAreCorrect(S, TheCall, S->Context.FloatTy,
|
I've gone ahead and merged this since it fixes the build break. In the future when you see a build break, please just revert the breaking change to get the build green again and then work on the fixed patch. It's unfair to others using trunk to have to wait on a fix for an obvious build break. |
I'm confident this change fixes the build break: python ../debug-llvm-build/bin/llvm-lit -sv clang/test/SemaHLSL/
llvm-lit: /mnt/DevDrive/projects/llvm-project/llvm/utils/lit/lit/llvm/config.py:502: note: using clang: /mnt/DevDrive/projects/debug-llvm-build/bin/clang
Testing Time: 0.67s
Total Discovered Tests: 43
Passed : 42 (97.67%)
Expectedly Failed: 1 (2.33%)
python ../debug-llvm-build/bin/llvm-lit -sv clang/test/CodeGenHLSL/
llvm-lit: /mnt/DevDrive/projects/llvm-project/llvm/utils/lit/lit/llvm/config.py:502: note: using clang: /mnt/DevDrive/projects/debug-llvm-build/bin/clang
Testing Time: 0.88s
Total Discovered Tests: 63
Passed: 63 (100.00%)
python ../debug-llvm-build/bin/llvm-lit -sv clang/test/Sema
llvm-lit: /mnt/DevDrive/projects/llvm-project/llvm/utils/lit/lit/llvm/config.py:502: note: using clang: /mnt/DevDrive/projects/debug-llvm-build/bin/clang
Testing Time: 26.09s
Total Discovered Tests: 979
Unsupported: 1 (0.10%)
Passed : 978 (99.90%) |
builds should be back to green all 51 checks passed: 3ff67d8 |
This change fixes a test case failure caused by pr llvm#85662
…383d383cb Local branch amd-gfx fb6383d Merged main:d9c31ee9568277e4303715736b40925e41503596 into amd-gfx:a79be10fda42 Remote branch main 3ff67d8 [HLSL] Fix for build break introduced by llvm#85662 (llvm#85839)
This change fixes a test case failure caused by pr #85662