[clang] [HLSL] Allow narrowing in initialization lists (PR #108035)

2024-09-12 Thread Cooper Partin via cfe-commits
https://github.com/coopp approved this pull request. looks fine. Curious, why is this extra RUN: line added? Doesn't the other one already contain the same parameters `-ast-dump -o - %s | FileCheck %s` ? RUN: %clang_cc1 -triple dxil-pc-shadermodel6.0-compute -ast-dump -o - %s | FileCheck %s

[clang] [NFC] [HLSL] Update test for HLSL 202x (PR #108097)

2024-09-10 Thread Cooper Partin via cfe-commits
https://github.com/coopp approved this pull request. Looks fine to me. Am I correct that there will be quite a few more incoming changes for the other tests that use hlsl2021 or older settings? https://github.com/llvm/llvm-project/pull/108097 ___ cfe

[clang] [HLSL] Implement support for HLSL intrinsic - select (PR #107129)

2024-09-03 Thread Cooper Partin via cfe-commits
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

[clang] [HLSL] Implement support for HLSL intrinsic - select (PR #107129)

2024-09-03 Thread Cooper Partin via cfe-commits
@@ -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 _

[clang] [HLSL] Implement support for HLSL intrinsic - select (PR #107129)

2024-09-03 Thread Cooper Partin via cfe-commits
@@ -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));

[clang] [HLSL] Implement support for HLSL intrinsic - select (PR #107129)

2024-09-03 Thread Cooper Partin via cfe-commits
@@ -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

[clang] [HLSL] Implement support for HLSL intrinsic - select (PR #107129)

2024-09-03 Thread Cooper Partin via cfe-commits
@@ -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));

[clang] [HLSL] update default validator version to 1.8. (PR #104040)

2024-08-15 Thread Cooper Partin via cfe-commits
https://github.com/coopp approved this pull request. Looks good. https://github.com/llvm/llvm-project/pull/104040 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [HLSL] update default validator version to 1.8. (PR #104040)

2024-08-14 Thread Cooper Partin via cfe-commits
@@ -283,14 +283,6 @@ HLSLToolChain::TranslateArgs(const DerivedArgList &Args, StringRef BoundArch, DAL->append(A); } - // Add default validator version if not set. coopp wrote: This was removed. Do we still need to fallback to a default here or does

[clang] [HLSL] Implement output parameter (PR #101083)

2024-08-07 Thread Cooper Partin via cfe-commits
https://github.com/coopp approved this pull request. That was a lot!. Didn't see anything to call out, so it looks good to me. https://github.com/llvm/llvm-project/pull/101083 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.

[clang] [llvm] [SPIRV][HLSL] Add lowering of frac to SPIR-V (PR #97111)

2024-07-23 Thread Cooper Partin via cfe-commits
https://github.com/coopp approved this pull request. Looks good to me. https://github.com/llvm/llvm-project/pull/97111 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Doc][HLSL] Add documentation for root signature (PR #88781)

2024-07-17 Thread Cooper Partin via cfe-commits
@@ -0,0 +1,292 @@ + +HLSL Root Signatures + + +.. contents:: + :local: + +Usage += + +In HLSL, the `root signature +`_ +defines what types of resources are bou

[clang] [Doc][HLSL] Add documentation for root signature (PR #88781)

2024-07-17 Thread Cooper Partin via cfe-commits
@@ -0,0 +1,292 @@ + +HLSL Root Signatures + + +.. contents:: + :local: + +Usage += + +In HLSL, the `root signature +`_ +defines what types of resources are bou

[clang] [HLSL] Use llvm::Triple::EnvironmentType instead of HLSLShaderAttr::ShaderType (PR #93847)

2024-05-30 Thread Cooper Partin via cfe-commits
https://github.com/coopp approved this pull request. Looks great! I like how clean this change is! https://github.com/llvm/llvm-project/pull/93847 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/

[clang] [llvm] [clang] Add tanf16 builtin and support for tan constrained intrinsic (PR #93314)

2024-05-28 Thread Cooper Partin via cfe-commits
https://github.com/coopp approved this pull request. Looks good to me. https://github.com/llvm/llvm-project/pull/93314 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [HLSL][CMake] Cache files don't have generator vars (PR #92793)

2024-05-20 Thread Cooper Partin via cfe-commits
https://github.com/coopp approved this pull request. Looks good to me. https://github.com/llvm/llvm-project/pull/92793 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] HLSL availability diagnostics design doc (PR #92207)

2024-05-15 Thread Cooper Partin via cfe-commits
https://github.com/coopp approved this pull request. This looks good to me. https://github.com/llvm/llvm-project/pull/92207 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] HLSL availability diagnostics design doc (PR #92207)

2024-05-15 Thread Cooper Partin via cfe-commits
@@ -0,0 +1,53 @@ += +HLSL Availability Diagnostics += + +.. contents:: + :local: + +Introduction + + +HLSL availability diagnostics emits errors or warning when unavailable shader APIs are used. Unavailable sha

[clang] HLSL availability diagnostics design doc (PR #92207)

2024-05-15 Thread Cooper Partin via cfe-commits
@@ -0,0 +1,53 @@ += +HLSL Availability Diagnostics += + +.. contents:: + :local: + +Introduction + + +HLSL availability diagnostics emits errors or warning when unavailable shader APIs are used. Unavailable sha

[clang] HLSL availability diagnostics design doc (PR #92207)

2024-05-15 Thread Cooper Partin via cfe-commits
@@ -0,0 +1,53 @@ += +HLSL Availability Diagnostics += + +.. contents:: + :local: + +Introduction + + +HLSL availability diagnostics emits errors or warning when unavailable shader APIs are used. Unavailable sha

[clang] HLSL availability diagnostics design doc (PR #92207)

2024-05-15 Thread Cooper Partin via cfe-commits
@@ -0,0 +1,53 @@ += +HLSL Availability Diagnostics += + +.. contents:: + :local: + +Introduction + + +HLSL availability diagnostics emits errors or warning when unavailable shader APIs are used. Unavailable sha

[clang] Enable unguarded availability diagnostic on instantiated template functions (PR #91699)

2024-05-10 Thread Cooper Partin via cfe-commits
https://github.com/coopp approved this pull request. Looks fine to me. I assume this doesn't impact other test passes right? Now there is work being done when before it was doing an early out for template instantiations. https://github.com/llvm/llvm-project/pull/91699 ___

[clang] Enable unguarded availability diagnostic on instantiated template functions (PR #91699)

2024-05-10 Thread Cooper Partin via cfe-commits
https://github.com/coopp edited https://github.com/llvm/llvm-project/pull/91699 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] Enable unguarded availability diagnostic on instantiated template functions (PR #91699)

2024-05-10 Thread Cooper Partin via cfe-commits
@@ -177,16 +177,19 @@ void justAtAvailable(void) { #ifdef OBJCPP -int f(char) AVAILABLE_10_12; +int f(char) AVAILABLE_10_12; // #f_char_def int f(int); template int use_f() { - // FIXME: We should warn here! - return f(T()); + // expected-warning@#f_call {{'f' is only

[clang] [HLSL] Shore up floating point conversions (PR #90222)

2024-05-01 Thread Cooper Partin via cfe-commits
https://github.com/coopp approved this pull request. Looks good. Took me a while to go through all of the tests. Looks like everything is covered! https://github.com/llvm/llvm-project/pull/90222 ___ cfe-commits mailing list cfe-commits@lists.llvm.or

[clang] [NFC][HLSL] Cleanup TargetInfo handling (PR #90694)

2024-05-01 Thread Cooper Partin via cfe-commits
https://github.com/coopp approved this pull request. Just a small nit from me about switch( ) statement formatting in existing code. Not the new code. Looks good to me. https://github.com/llvm/llvm-project/pull/90694 ___ cfe-commits mailing list cfe

[clang] [NFC][HLSL] Cleanup TargetInfo handling (PR #90694)

2024-05-01 Thread Cooper Partin via cfe-commits
@@ -1612,15 +1612,7 @@ const llvm::fltSemantics &ASTContext::getFloatTypeSemantics(QualType T) const { case BuiltinType::Float16: return Target->getHalfFormat(); case BuiltinType::Half: -// For HLSL, when the native half type is disabled, half will be treat as -

[clang] [NFC] Rename hlsl semantics to hlsl annotations (PR #89309)

2024-04-18 Thread Cooper Partin via cfe-commits
https://github.com/coopp approved this pull request. Looks good https://github.com/llvm/llvm-project/pull/89309 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [NFC] Rename hlsl semantics to hlsl annotations (PR #89309)

2024-04-18 Thread Cooper Partin via cfe-commits
@@ -4890,15 +4890,16 @@ class SpellingList { } void add(const Record &Attr, FlattenedSpelling Spelling) { -SpellingKind Kind = StringSwitch(Spelling.variety()) -.Case("GNU", SpellingKind::GNU) -.Case("CXX11", Spel

[clang] [clang][CodeGen] Fix shift-exponent ubsan check for signed _BitInt (PR #88004)

2024-04-18 Thread Cooper Partin via cfe-commits
https://github.com/coopp approved this pull request. Looks good to me. https://github.com/llvm/llvm-project/pull/88004 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][CodeGen] Fix shift-exponent ubsan check for signed _BitInt (PR #88004)

2024-04-18 Thread Cooper Partin via cfe-commits
@@ -146,6 +146,15 @@ struct BinOpInfo { return UnOp->getSubExpr()->getType()->isFixedPointType(); return false; } + + /// Check if the RHS has a signed integer representation. coopp wrote: Extra '/' in comment line. https://github.com/llvm/llvm-p

[clang] [clang][SPIR-V] Set AS for the SPIR-V logical triple (PR #88939)

2024-04-16 Thread Cooper Partin via cfe-commits
https://github.com/coopp commented: Looks good https://github.com/llvm/llvm-project/pull/88939 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [SPIRV][HLSL] map lerp to Fmix (PR #88976)

2024-04-16 Thread Cooper Partin via cfe-commits
https://github.com/coopp approved this pull request. Looks good to me. https://github.com/llvm/llvm-project/pull/88976 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [HLSL] move rcp to cgbuiltins (PR #88401)

2024-04-11 Thread Cooper Partin via cfe-commits
https://github.com/coopp approved this pull request. Looks good to me https://github.com/llvm/llvm-project/pull/88401 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [HLSL] Implement array temporary support (PR #79382)

2024-03-29 Thread Cooper Partin via cfe-commits
https://github.com/coopp approved this pull request. WOW.. This was pretty big. I went through it twice and didn't see anything that jumped out. Looks good to me. https://github.com/llvm/llvm-project/pull/79382 ___ cfe-commits mailing list cfe-commi

[clang] [NFC] Refactor ConstantArrayType size storage (PR #85716)

2024-03-26 Thread Cooper Partin via cfe-commits
https://github.com/coopp approved this pull request. Looks good to me for what I can see in the code. I took special care to make sure places where noticed the old size accessor (CAT->getSize().getZExtValue() ) being called, was now using (CAT->getZExtSize()). https://github.com/llvm/llvm-pr

[clang] [CMake][HLSL] Add SPIRV to target list for build (PR #86323)

2024-03-22 Thread Cooper Partin via cfe-commits
https://github.com/coopp approved this pull request. SPIRV in the house! https://github.com/llvm/llvm-project/pull/86323 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [DXIL] `exp`, `any`, `lerp`, & `rcp` Intrinsic Lowering (PR #84526)

2024-03-15 Thread Cooper Partin via cfe-commits
@@ -0,0 +1,186 @@ +//===- DXILIntrinsicExpansion.cpp - Prepare LLVM Module for DXIL encoding--===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Ap

[clang] [llvm] [DXIL] `exp`, `any`, `lerp`, & `rcp` Intrinsic Lowering (PR #84526)

2024-03-15 Thread Cooper Partin via cfe-commits
https://github.com/coopp approved this pull request. Looks good to me for what I can understand. https://github.com/llvm/llvm-project/pull/84526 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe

[clang] [llvm] [DXIL] `exp`, `any`, `lerp`, & `rcp` Intrinsic Lowering (PR #84526)

2024-03-15 Thread Cooper Partin via cfe-commits
https://github.com/coopp edited https://github.com/llvm/llvm-project/pull/84526 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [DirectX] Fix HLSL bitshifts to leverage the OpenCL pipeline for bitshifting (PR #81030)

2024-02-08 Thread Cooper Partin via cfe-commits
coopp wrote: > What is the output before this change? It would be nice to add more > information to the PR description. I added a description that shows a before/after output for this change. https://github.com/llvm/llvm-project/pull/81030 ___ cfe-co

[clang] [DirectX] Fix HLSL bitshifts to leverage the OpenCL pipeline for bitshifting (PR #81030)

2024-02-08 Thread Cooper Partin via cfe-commits
https://github.com/coopp edited https://github.com/llvm/llvm-project/pull/81030 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [DirectX] Fix HLSL bitshifts to leverage the OpenCL pipeline for bitshifting (PR #81030)

2024-02-08 Thread Cooper Partin via cfe-commits
https://github.com/coopp edited https://github.com/llvm/llvm-project/pull/81030 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [DirectX] Fix HLSL bitshifts to leverage the OpenCL pipeline for bitshifting Fixes #55106 In HLSL bit shifts are defined to shift by shift size % type size. This contains the following changes

2024-02-08 Thread Cooper Partin via cfe-commits
https://github.com/coopp edited https://github.com/llvm/llvm-project/pull/81030 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [DirectX] Fix HLSL bitshifts to leverage the OpenCL pipeline for bitshifting (PR #81030)

2024-02-08 Thread Cooper Partin via cfe-commits
https://github.com/coopp edited https://github.com/llvm/llvm-project/pull/81030 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [DirectX] Fix HLSL bitshifts to leverage the OpenCL pipeline for bitshifting (#55106) (PR #81030)

2024-02-08 Thread Cooper Partin via cfe-commits
https://github.com/coopp updated https://github.com/llvm/llvm-project/pull/81030 >From eb6c7e6e9d4ccaf6e63714d2d94a518cc00bcc82 Mon Sep 17 00:00:00 2001 From: Cooper Partin Date: Wed, 7 Feb 2024 11:32:56 -0800 Subject: [PATCH 1/2] [DirectX] Fix HLSL bitshifts to leverage the OpenCL pipeline for

[clang] [DirectX] Fix HLSL bitshifts to leverage the OpenCL pipeline for bitshifting (#55106) (PR #81030)

2024-02-07 Thread Cooper Partin via cfe-commits
https://github.com/coopp created https://github.com/llvm/llvm-project/pull/81030 None >From eb6c7e6e9d4ccaf6e63714d2d94a518cc00bcc82 Mon Sep 17 00:00:00 2001 From: Cooper Partin Date: Wed, 7 Feb 2024 11:32:56 -0800 Subject: [PATCH] [DirectX] Fix HLSL bitshifts to leverage the OpenCL pipeline f