github-actions[bot] wrote:
@spall Congratulations on having your first Pull Request (PR) merged into the
LLVM Project!
Your changes will be combined with recent changes from other authors, then
tested by our [build bots](https://lab.llvm.org/buildbot/). If there is a
problem with a build, y
https://github.com/bogner closed
https://github.com/llvm/llvm-project/pull/107129
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/spall updated
https://github.com/llvm/llvm-project/pull/107129
>From 3e0cd3c450eb4aa28742c4879733987e9e2692e7 Mon Sep 17 00:00:00 2001
From: Sarah Spall
Date: Wed, 28 Aug 2024 01:44:35 +
Subject: [PATCH 1/9] implement select intrinsic
---
clang/include/clang/Basic/Built
github-actions[bot] wrote:
:warning: C/C++ code formatter, clang-format found issues in your code.
:warning:
You can test this locally with the following command:
``bash
git-clang-format --diff 15fa3ba547bc3ee04af5c32b8f723a97e3feefd8
44685a3cf034a9e5d7166b93b8021724bd8fd146 --e
https://github.com/bogner approved this pull request.
https://github.com/llvm/llvm-project/pull/107129
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/spall updated
https://github.com/llvm/llvm-project/pull/107129
>From 3e0cd3c450eb4aa28742c4879733987e9e2692e7 Mon Sep 17 00:00:00 2001
From: Sarah Spall
Date: Wed, 28 Aug 2024 01:44:35 +
Subject: [PATCH 1/8] implement select intrinsic
---
clang/include/clang/Basic/Built
@@ -1603,6 +1603,32 @@ double3 saturate(double3);
_HLSL_BUILTIN_ALIAS(__builtin_hlsl_elementwise_saturate)
double4 saturate(double4);
+//===--===//
+// select builtins
+//===---
@@ -0,0 +1,41 @@
+// RUN: %clang_cc1 -finclude-default-header -x hlsl -triple \
+// RUN: dxil-pc-shadermodel6.3-library %s -emit-llvm -disable-llvm-passes \
+// RUN: -o - | FileCheck %s --check-prefixes=CHECK
+
+// CHECK: %hlsl.select = select i1
+// CHECK: ret i32 %hlsl.selec
@@ -0,0 +1,41 @@
+// RUN: %clang_cc1 -finclude-default-header -x hlsl -triple \
+// RUN: dxil-pc-shadermodel6.3-library %s -emit-llvm -disable-llvm-passes \
+// RUN: -o - | FileCheck %s --check-prefixes=CHECK
+
+// CHECK: %hlsl.select = select i1
+// CHECK: ret i32 %hlsl.selec
@@ -0,0 +1,41 @@
+// RUN: %clang_cc1 -finclude-default-header -x hlsl -triple \
+// RUN: dxil-pc-shadermodel6.3-library %s -emit-llvm -disable-llvm-passes \
+// RUN: -o - | FileCheck %s --check-prefixes=CHECK
+
+// CHECK: %hlsl.select = select i1
+// CHECK: ret i32 %hlsl.selec
https://github.com/farzonl approved this pull request.
LGTM
https://github.com/llvm/llvm-project/pull/107129
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/farzonl edited
https://github.com/llvm/llvm-project/pull/107129
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -1512,6 +1512,83 @@ void SetElementTypeAsReturnType(Sema *S, CallExpr
*TheCall,
TheCall->setType(ReturnType);
}
+static bool CheckScalarOrVector(Sema *S, CallExpr *TheCall, QualType Scalar,
+ unsigned ArgIndex) {
+ assert(TheCall->getNumArg
@@ -0,0 +1,45 @@
+// RUN: %clang_cc1 -finclude-default-header -x hlsl -triple \
farzonl wrote:
nevermind, this isn't something the team is conserned about.
https://github.com/llvm/llvm-project/pull/107129
___
cfe-commi
https://github.com/spall deleted
https://github.com/llvm/llvm-project/pull/107129
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -0,0 +1,45 @@
+// RUN: %clang_cc1 -finclude-default-header -x hlsl -triple \
spall wrote:
How do I fix this?
https://github.com/llvm/llvm-project/pull/107129
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
@@ -1512,6 +1512,83 @@ void SetElementTypeAsReturnType(Sema *S, CallExpr
*TheCall,
TheCall->setType(ReturnType);
}
+static bool CheckScalarOrVector(Sema *S, CallExpr *TheCall, QualType Scalar,
+ unsigned ArgIndex) {
+ assert(TheCall->getNumArg
@@ -0,0 +1,129 @@
+// RUN: %clang_cc1 -finclude-default-header
+// -triple dxil-pc-shadermodel6.6-library %s -emit-llvm-only
+// -disable-llvm-passes -verify -verify-ignore-unexpected
+
+int test_no_arg() {
+ return select();
+ // expected-error@-1 {{no matching function for cal
https://github.com/spall updated
https://github.com/llvm/llvm-project/pull/107129
>From 3e0cd3c450eb4aa28742c4879733987e9e2692e7 Mon Sep 17 00:00:00 2001
From: Sarah Spall
Date: Wed, 28 Aug 2024 01:44:35 +
Subject: [PATCH 1/7] implement select intrinsic
---
clang/include/clang/Basic/Built
@@ -1512,6 +1512,83 @@ void SetElementTypeAsReturnType(Sema *S, CallExpr
*TheCall,
TheCall->setType(ReturnType);
}
+static bool CheckScalarOrVector(Sema *S, CallExpr *TheCall, QualType Scalar,
+ unsigned ArgIndex) {
+ assert(TheCall->getNumArg
@@ -1512,6 +1512,83 @@ void SetElementTypeAsReturnType(Sema *S, CallExpr
*TheCall,
TheCall->setType(ReturnType);
}
+static bool CheckScalarOrVector(Sema *S, CallExpr *TheCall, QualType Scalar,
+ unsigned ArgIndex) {
+ assert(TheCall->getNumArg
@@ -0,0 +1,129 @@
+// RUN: %clang_cc1 -finclude-default-header
+// -triple dxil-pc-shadermodel6.6-library %s -emit-llvm-only
+// -disable-llvm-passes -verify -verify-ignore-unexpected
+
+int test_no_arg() {
+ return select();
+ // expected-error@-1 {{no matching function for cal
@@ -0,0 +1,129 @@
+// RUN: %clang_cc1 -finclude-default-header
+// -triple dxil-pc-shadermodel6.6-library %s -emit-llvm-only
+// -disable-llvm-passes -verify -verify-ignore-unexpected
+
+int test_no_arg() {
+ return select();
+ // expected-error@-1 {{no matching function for cal
https://github.com/farzonl edited
https://github.com/llvm/llvm-project/pull/107129
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -0,0 +1,45 @@
+// RUN: %clang_cc1 -finclude-default-header -x hlsl -triple \
farzonl wrote:
This might be a DXism that doesn't apply going forward with upstream, but
select is an HLSL 2021 and above feature. It doesn't seem like we have the
proper gating if
@@ -0,0 +1,45 @@
+// RUN: %clang_cc1 -finclude-default-header -x hlsl -triple \
+// RUN: dxil-pc-shadermodel6.3-library %s -emit-llvm -disable-llvm-passes \
+// RUN: -o - | FileCheck %s --check-prefixes=CHECK
+
+// CHECK: %hlsl.select = select i1
+// CHECK: ret i32 %hlsl.selec
https://github.com/farzonl edited
https://github.com/llvm/llvm-project/pull/107129
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -0,0 +1,45 @@
+// RUN: %clang_cc1 -finclude-default-header -x hlsl -triple \
+// RUN: dxil-pc-shadermodel6.3-library %s -emit-llvm -disable-llvm-passes \
+// RUN: -o - | FileCheck %s --check-prefixes=CHECK
+
+// CHECK: %hlsl.select = select i1
+// CHECK: ret i32 %hlsl.selec
https://github.com/damyanp commented:
LGTM - would be good to get approval from @farzonl before completing.
https://github.com/llvm/llvm-project/pull/107129
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/
https://github.com/spall updated
https://github.com/llvm/llvm-project/pull/107129
>From 3e0cd3c450eb4aa28742c4879733987e9e2692e7 Mon Sep 17 00:00:00 2001
From: Sarah Spall
Date: Wed, 28 Aug 2024 01:44:35 +
Subject: [PATCH 1/6] implement select intrinsic
---
clang/include/clang/Basic/Built
https://github.com/farzonl deleted
https://github.com/llvm/llvm-project/pull/107129
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -18695,6 +18695,48 @@ case Builtin::BI__builtin_hlsl_elementwise_isinf: {
CGM.getHLSLRuntime().getSaturateIntrinsic(), ArrayRef{Op0},
nullptr, "hlsl.saturate");
}
+ case Builtin::BI__builtin_hlsl_select: {
+Value *OpCond = EmitScalarExpr(E->getArg(0));
@@ -1544,6 +1604,30 @@ bool SemaHLSL::CheckBuiltinFunctionCall(unsigned
BuiltinID, CallExpr *TheCall) {
return true;
break;
}
+ case Builtin::BI__builtin_hlsl_select: {
spall wrote:
I think it is slightly special. It is a template function, and t
@@ -0,0 +1,76 @@
+// RUN: %clang_cc1 -finclude-default-header -x hlsl -triple \
+// RUN: dxil-pc-shadermodel6.3-library %s -emit-llvm -disable-llvm-passes \
+// RUN: -o - | FileCheck %s --check-prefixes=CHECK
+
+// CHECK: %hlsl.select = select i1
+// CHECK: ret i32 %hlsl.selec
@@ -0,0 +1,76 @@
+// RUN: %clang_cc1 -finclude-default-header -x hlsl -triple \
+// RUN: dxil-pc-shadermodel6.3-library %s -emit-llvm -disable-llvm-passes \
+// RUN: -o - | FileCheck %s --check-prefixes=CHECK
+
+// CHECK: %hlsl.select = select i1
+// CHECK: ret i32 %hlsl.selec
https://github.com/damyanp edited
https://github.com/llvm/llvm-project/pull/107129
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -1512,6 +1512,66 @@ void SetElementTypeAsReturnType(Sema *S, CallExpr
*TheCall,
TheCall->setType(ReturnType);
}
+bool CheckBoolSelect(Sema *S, CallExpr *TheCall) {
damyanp wrote:
nit: it'd be good for these helpers that are only used from this cpp file
@@ -1544,6 +1604,30 @@ bool SemaHLSL::CheckBuiltinFunctionCall(unsigned
BuiltinID, CallExpr *TheCall) {
return true;
break;
}
+ case Builtin::BI__builtin_hlsl_select: {
+if (SemaRef.checkArgCount(TheCall, 3))
+ return true;
+QualType ArgTy = TheCall->
@@ -0,0 +1,90 @@
+// RUN: %clang_cc1 -finclude-default-header -triple
dxil-pc-shadermodel6.6-library %s -emit-llvm-only -disable-llvm-passes -verify
-verify-ignore-unexpected
+
+int test_no_arg() {
+ return select();
+ // expected-error@-1 {{no matching function for call to 's
@@ -1544,6 +1604,30 @@ bool SemaHLSL::CheckBuiltinFunctionCall(unsigned
BuiltinID, CallExpr *TheCall) {
return true;
break;
}
+ case Builtin::BI__builtin_hlsl_select: {
damyanp wrote:
This implementation has quite a different shape to the other b
@@ -0,0 +1,76 @@
+// RUN: %clang_cc1 -finclude-default-header -x hlsl -triple \
+// RUN: dxil-pc-shadermodel6.3-library %s -emit-llvm -disable-llvm-passes \
+// RUN: -o - | FileCheck %s --check-prefixes=CHECK
+
+// CHECK: %hlsl.select = select i1
+// CHECK: ret i32 %hlsl.selec
https://github.com/coopp approved this pull request.
This looks good to me.
https://github.com/llvm/llvm-project/pull/107129
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/spall updated
https://github.com/llvm/llvm-project/pull/107129
>From 3e0cd3c450eb4aa28742c4879733987e9e2692e7 Mon Sep 17 00:00:00 2001
From: Sarah Spall
Date: Wed, 28 Aug 2024 01:44:35 +
Subject: [PATCH 1/5] implement select intrinsic
---
clang/include/clang/Basic/Built
@@ -1545,6 +1605,30 @@ bool SemaHLSL::CheckBuiltinFunctionCall(unsigned
BuiltinID, CallExpr *TheCall) {
break;
}
case Builtin::BI__builtin_hlsl_elementwise_saturate:
coopp wrote:
Sounds good.
https://github.com/llvm/llvm-project/pull/107129
_
https://github.com/spall updated
https://github.com/llvm/llvm-project/pull/107129
>From 3e0cd3c450eb4aa28742c4879733987e9e2692e7 Mon Sep 17 00:00:00 2001
From: Sarah Spall
Date: Wed, 28 Aug 2024 01:44:35 +
Subject: [PATCH 1/4] implement select intrinsic
---
clang/include/clang/Basic/Built
@@ -1545,6 +1605,30 @@ bool SemaHLSL::CheckBuiltinFunctionCall(unsigned
BuiltinID, CallExpr *TheCall) {
break;
}
case Builtin::BI__builtin_hlsl_elementwise_saturate:
+ case Builtin::BI__builtin_hlsl_select: {
bharadwajy wrote:
This addition splits th
@@ -18695,6 +18695,50 @@ case Builtin::BI__builtin_hlsl_elementwise_isinf: {
CGM.getHLSLRuntime().getSaturateIntrinsic(), ArrayRef{Op0},
nullptr, "hlsl.saturate");
}
+ case Builtin::BI__builtin_hlsl_select: {
+Value *OpCond = EmitScalarExpr(E->getArg(0));
@@ -18695,6 +18695,50 @@ case Builtin::BI__builtin_hlsl_elementwise_isinf: {
CGM.getHLSLRuntime().getSaturateIntrinsic(), ArrayRef{Op0},
nullptr, "hlsl.saturate");
}
+ case Builtin::BI__builtin_hlsl_select: {
+Value *OpCond = EmitScalarExpr(E->getArg(0));
@@ -1545,6 +1605,30 @@ bool SemaHLSL::CheckBuiltinFunctionCall(unsigned
BuiltinID, CallExpr *TheCall) {
break;
}
case Builtin::BI__builtin_hlsl_elementwise_saturate:
spall wrote:
No I did not; It is supposed to fall through to the next case, so I will
@@ -1545,6 +1605,30 @@ bool SemaHLSL::CheckBuiltinFunctionCall(unsigned
BuiltinID, CallExpr *TheCall) {
break;
}
case Builtin::BI__builtin_hlsl_elementwise_saturate:
coopp wrote:
Did you mean for 'Builtin::BI__builtin_hlsl_elementwise_saturate' to fal
@@ -18695,6 +18695,50 @@ case Builtin::BI__builtin_hlsl_elementwise_isinf: {
CGM.getHLSLRuntime().getSaturateIntrinsic(), ArrayRef{Op0},
nullptr, "hlsl.saturate");
}
+ case Builtin::BI__builtin_hlsl_select: {
+Value *OpCond = EmitScalarExpr(E->getArg(0));
https://github.com/spall updated
https://github.com/llvm/llvm-project/pull/107129
>From 3e0cd3c450eb4aa28742c4879733987e9e2692e7 Mon Sep 17 00:00:00 2001
From: Sarah Spall
Date: Wed, 28 Aug 2024 01:44:35 +
Subject: [PATCH 1/3] implement select intrinsic
---
clang/include/clang/Basic/Built
llvmbot wrote:
@llvm/pr-subscribers-clang-codegen
Author: Sarah Spall (spall)
Changes
Implement support for HLSL intrinsic select.
This would close issue #75377
---
Full diff: https://github.com/llvm/llvm-project/pull/107129.diff
6 Files Affected:
- (modified) clang/include/clang/Basi
https://github.com/spall created
https://github.com/llvm/llvm-project/pull/107129
Implement support for HLSL intrinsic select.
This would close issue #75377
>From 226ea652f160b22922e9582c5a5c53511042d735 Mon Sep 17 00:00:00 2001
From: Sarah Spall
Date: Wed, 28 Aug 2024 01:44:35 +
Subject:
github-actions[bot] wrote:
Thank you for submitting a Pull Request (PR) to the LLVM Project!
This PR will be automatically labeled and the relevant teams will be notified.
If you wish to, you can add reviewers by using the "Reviewers" section on this
page.
If this is not working for you, it
55 matches
Mail list logo