[clang] [HLSL] Fix for build break introduced by #85662 (PR #85839)

2024-03-19 Thread Farzon Lotfi via cfe-commits

farzonl wrote:

builds should be back to green all 51 checks passed: 
https://github.com/llvm/llvm-project/commit/3ff67d8c8069b9f42efcbe90ad7edeb6d8117a31

https://github.com/llvm/llvm-project/pull/85839
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] [HLSL] Fix for build break introduced by #85662 (PR #85839)

2024-03-19 Thread Farzon Lotfi via cfe-commits

farzonl wrote:

I'm confident this change fixes the build break:

```bash
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%)
```

https://github.com/llvm/llvm-project/pull/85839
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] [HLSL] Fix for build break introduced by #85662 (PR #85839)

2024-03-19 Thread Justin Bogner via cfe-commits

bogner wrote:

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.

https://github.com/llvm/llvm-project/pull/85839
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] [HLSL] Fix for build break introduced by #85662 (PR #85839)

2024-03-19 Thread Justin Bogner via cfe-commits

https://github.com/bogner closed https://github.com/llvm/llvm-project/pull/85839
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] [HLSL] Fix for build break introduced by #85662 (PR #85839)

2024-03-19 Thread Justin Bogner via cfe-commits

https://github.com/bogner approved this pull request.


https://github.com/llvm/llvm-project/pull/85839
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] [HLSL] Fix for build break introduced by #85662 (PR #85839)

2024-03-19 Thread via cfe-commits

llvmbot wrote:




@llvm/pr-subscribers-clang

Author: Farzon Lotfi (farzonl)


Changes

This change fixes a test case failure caused by pr #85662 

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


2 Files Affected:

- (modified) clang/include/clang/AST/Type.h (+5) 
- (modified) clang/lib/Sema/SemaChecking.cpp (+2-4) 


``diff
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(PassedType)) {
-  clang::QualType BaseType = VecTy->getElementType();
-  return !BaseType->isHalfType() && !BaseType->isFloat32Type();
-}
+if (const auto *VecTy = PassedType->getAs())
+  return VecTy->getElementType()->isDoubleType();
 return false;
   };
   return CheckArgsTypesAreCorrect(S, TheCall, S->Context.FloatTy,

``




https://github.com/llvm/llvm-project/pull/85839
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] [HLSL] Fix for build break introduced by #85662 (PR #85839)

2024-03-19 Thread Farzon Lotfi via cfe-commits

https://github.com/farzonl created 
https://github.com/llvm/llvm-project/pull/85839

This change fixes a test case failure caused by pr #85662 

>From 7c2833dc32d8d2573454cba99b9a2c65a166d702 Mon Sep 17 00:00:00 2001
From: Farzon Lotfi 
Date: Tue, 19 Mar 2024 14:01:29 -0400
Subject: [PATCH] This change fixes a test case failure caused by pr #85662

---
 clang/include/clang/AST/Type.h  | 5 +
 clang/lib/Sema/SemaChecking.cpp | 6 ++
 2 files changed, 7 insertions(+), 4 deletions(-)

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(PassedType)) {
-  clang::QualType BaseType = VecTy->getElementType();
-  return !BaseType->isHalfType() && !BaseType->isFloat32Type();
-}
+if (const auto *VecTy = PassedType->getAs())
+  return VecTy->getElementType()->isDoubleType();
 return false;
   };
   return CheckArgsTypesAreCorrect(S, TheCall, S->Context.FloatTy,

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits