[clang] [clang] Accept lambdas in C++03 as an extensions (PR #73376)

2024-02-01 Thread Chris B via cfe-commits
https://github.com/llvm-beanz edited https://github.com/llvm/llvm-project/pull/73376 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[llvm] [clang] [clang-tools-extra] [HLSL] Vector standard conversions (PR #71098)

2024-02-05 Thread Chris B via cfe-commits
llvm-beanz wrote: @rjmccall, friendly ping 😄 https://github.com/llvm/llvm-project/pull/71098 ___ 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-01-24 Thread Chris B via cfe-commits
https://github.com/llvm-beanz created https://github.com/llvm/llvm-project/pull/79382 In HLSL function parameters are passed by value, including array parameters. This change introduces a new AST node to represent array temporary expressions. They behave as lvalues to temporary arrays and deca

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

2024-01-24 Thread Chris B via cfe-commits
@@ -10524,6 +10524,11 @@ Sema::PerformCopyInitialization(const InitializedEntity &Entity, Expr *InitE = Init.get(); assert(InitE && "No initialization expression?"); + if (LangOpts.HLSL) +if (auto AdjTy = dyn_cast(Entity.getType())) + if (AdjTy->getOriginalType(

[clang] [llvm] [clang-tools-extra] [DirectX] Rename DXILOperationCommon.h to DXILABI.h. NFC (PR #78224)

2024-01-29 Thread Chris B via cfe-commits
https://github.com/llvm-beanz approved this pull request. https://github.com/llvm/llvm-project/pull/78224 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [clang-tools-extra] [HLSL] Vector standard conversions (PR #71098)

2024-01-29 Thread Chris B via cfe-commits
llvm-beanz wrote: @rjmccall, ping https://github.com/llvm/llvm-project/pull/71098 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [CMake][PGO] Build Sema.cpp to generate profdata for PGO builds (PR #77347)

2024-01-12 Thread Chris B via cfe-commits
@@ -26,9 +30,23 @@ if(LLVM_BUILD_INSTRUMENTED) message(STATUS "To enable merging PGO data LLVM_PROFDATA has to point to llvm-profdata") else() add_custom_target(generate-profdata - COMMAND "${Python3_EXECUTABLE}" ${CMAKE_CURRENT_SOURCE_DIR}/perf-helper.py merge

[llvm] [clang] [CMake][PGO] Build Sema.cpp to generate profdata for PGO builds (PR #77347)

2024-01-12 Thread Chris B via cfe-commits
@@ -26,9 +30,23 @@ if(LLVM_BUILD_INSTRUMENTED) message(STATUS "To enable merging PGO data LLVM_PROFDATA has to point to llvm-profdata") else() add_custom_target(generate-profdata - COMMAND "${Python3_EXECUTABLE}" ${CMAKE_CURRENT_SOURCE_DIR}/perf-helper.py merge

[clang] [llvm] [CMake][PGO] Build Sema.cpp to generate profdata for PGO builds (PR #77347)

2024-01-12 Thread Chris B via cfe-commits
@@ -26,9 +30,23 @@ if(LLVM_BUILD_INSTRUMENTED) message(STATUS "To enable merging PGO data LLVM_PROFDATA has to point to llvm-profdata") else() add_custom_target(generate-profdata - COMMAND "${Python3_EXECUTABLE}" ${CMAKE_CURRENT_SOURCE_DIR}/perf-helper.py merge

[clang] [llvm] [HLSL][SPIR-V] Add Vulkan to target triple (PR #76749)

2024-01-18 Thread Chris B via cfe-commits
https://github.com/llvm-beanz approved this pull request. Sorry for my delayed review. LGTM. https://github.com/llvm/llvm-project/pull/76749 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-com

[clang] [NFC] Add API documentation and annotations (PR #78635)

2024-01-18 Thread Chris B via cfe-commits
https://github.com/llvm-beanz created https://github.com/llvm/llvm-project/pull/78635 This change adds SM 6.2 availability annotation to 16-bit APIs (16-bit types require SM 6.2), and adds Doxygen API documentation. >From 0e4a6081b17da6474b931dcf9250b001b95e23ff Mon Sep 17 00:00:00 2001 From:

[clang] [clang-tools-extra] [llvm] [HLSL] Vector standard conversions (PR #71098)

2024-01-19 Thread Chris B via cfe-commits
llvm-beanz wrote: @rjmccall, do my latest updates here cover all your concerns? https://github.com/llvm/llvm-project/pull/71098 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [HLSL][SPIR-V] Add support -fspv-target-env opt (PR #78611)

2024-01-19 Thread Chris B via cfe-commits
https://github.com/llvm-beanz approved this pull request. https://github.com/llvm/llvm-project/pull/78611 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[llvm] [clang] [CMake][PGO] Add option for using an external project to generate profile data (PR #78879)

2024-01-23 Thread Chris B via cfe-commits
https://github.com/llvm-beanz approved this pull request. LGTM https://github.com/llvm/llvm-project/pull/78879 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Windows] Add git-clang-format wrapper bat file (PR #69228)

2023-10-19 Thread Chris B via cfe-commits
https://github.com/llvm-beanz edited https://github.com/llvm/llvm-project/pull/69228 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Windows] Add git-clang-format wrapper bat file (PR #69228)

2023-10-19 Thread Chris B via cfe-commits
llvm-beanz wrote: > Can you open an issue and link to it from here? Filed #69643. > It seems `git clang-format` works in Command Prompt without this new batch > file. IIUC, `git clang-format` works if you have WSL installed, but not with a default Windows installation. We definitely have use

[clang] [Windows] Add git-clang-format wrapper bat file (PR #69228)

2023-10-20 Thread Chris B via cfe-commits
@@ -0,0 +1 @@ +py -3 git-clang-format %* llvm-beanz wrote: `py.exe` is the Windows python launcher. It comes with Python for Windows (not msys2 or cygwin where the shebang line would work). It is the Windows way of choosing which python version you want. You ne

[clang] [Windows] Add git-clang-format wrapper bat file (PR #69228)

2023-10-21 Thread Chris B via cfe-commits
https://github.com/llvm-beanz closed https://github.com/llvm/llvm-project/pull/69228 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [HLSL] Support vector swizzles on scalars (PR #67700)

2023-10-23 Thread Chris B via cfe-commits
@@ -930,7 +930,11 @@ NumericLiteralParser::NumericLiteralParser(StringRef TokSpelling, // and FP constants (specifically, the 'pp-number' regex), and assumes that // the byte at "*end" is both valid and not part of the regex. Because of // this, it doesn't have to check

[clang] [HLSL] Support vector swizzles on scalars (PR #67700)

2023-10-23 Thread Chris B via cfe-commits
@@ -0,0 +1,14 @@ +// RUN: %clang_cc1 -triple dxil-pc-shadermodel6.6-library -x hlsl -finclude-default-header -verify %s + + +int2 ToTwoInts(int V) { + return V.xy; // expected-error{{vector component access exceeds type 'int __attribute__((ext_vector_type(1)))' (vector of 1 'i

[clang] [HLSL] Support vector swizzles on scalars (PR #67700)

2023-10-23 Thread Chris B via cfe-commits
@@ -0,0 +1,78 @@ +// RUN: %clang_cc1 -triple dxil-pc-shadermodel6.6-library -x hlsl \ +// RUN: -finclude-default-header -ast-dump %s | FileCheck %s + + +// CHECK: ExtVectorElementExpr {{.*}} 'int __attribute__((ext_vector_type(2)))' xx +// CHECK-NEXT: ImplicitCastExpr {{.*}} '

[clang] [HLSL] Support vector swizzles on scalars (PR #67700)

2023-10-23 Thread Chris B via cfe-commits
https://github.com/llvm-beanz updated https://github.com/llvm/llvm-project/pull/67700 >From 2fa183da3991c0bc4da6163609331d198f4a37af Mon Sep 17 00:00:00 2001 From: Chris Bieneman Date: Tue, 26 Sep 2023 19:48:18 -0500 Subject: [PATCH 1/2] [HLSL] Support vector swizzles on scalars HLSL supports

[clang] [SPIRV] Add -spirv option to DXC driver (PR #65989)

2023-10-24 Thread Chris B via cfe-commits
https://github.com/llvm-beanz edited https://github.com/llvm/llvm-project/pull/65989 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [SPIRV] Add -spirv option to DXC driver (PR #65989)

2023-10-24 Thread Chris B via cfe-commits
@@ -2,8 +2,8 @@ // Supported targets // -// RUN: %clang -target dxil-unknown-shadermodel6.2-pixel %s -S -o /dev/null 2>&1 | FileCheck --check-prefix=CHECK-VALID %s -// RUN: %clang -target spirv-unknown-shadermodel6.2-library %s -S -o /dev/null 2>&1 | FileCheck --check-prefix

[clang] [HLSL] Support vector swizzles on scalars (PR #67700)

2023-10-24 Thread Chris B via cfe-commits
https://github.com/llvm-beanz updated https://github.com/llvm/llvm-project/pull/67700 >From 2fa183da3991c0bc4da6163609331d198f4a37af Mon Sep 17 00:00:00 2001 From: Chris Bieneman Date: Tue, 26 Sep 2023 19:48:18 -0500 Subject: [PATCH 1/3] [HLSL] Support vector swizzles on scalars HLSL supports

[clang] [Clang] Fix a crash when using ast-dump=json (PR #70224)

2023-10-26 Thread Chris B via cfe-commits
https://github.com/llvm-beanz edited https://github.com/llvm/llvm-project/pull/70224 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] Fix a crash when using ast-dump=json (PR #70224)

2023-10-26 Thread Chris B via cfe-commits
@@ -217,21 +221,21 @@ void i(); // CHECK-NEXT:"id": "0x{{.*}}", // CHECK-NEXT:"kind": "FunctionTemplateDecl", // CHECK-NEXT:"loc": { -// CHECK-NEXT: "offset": {{[0-9]+}}, +// CHECK-NEXT: "offset": 142, llvm-beanz wrote: To add a bit of cont

[clang] [HLSL] Support vector swizzles on scalars (PR #67700)

2023-10-27 Thread Chris B via cfe-commits
https://github.com/llvm-beanz updated https://github.com/llvm/llvm-project/pull/67700 >From 2fa183da3991c0bc4da6163609331d198f4a37af Mon Sep 17 00:00:00 2001 From: Chris Bieneman Date: Tue, 26 Sep 2023 19:48:18 -0500 Subject: [PATCH 1/4] [HLSL] Support vector swizzles on scalars HLSL supports

[clang] [HLSL] Support vector swizzles on scalars (PR #67700)

2023-09-28 Thread Chris B via cfe-commits
https://github.com/llvm-beanz created https://github.com/llvm/llvm-project/pull/67700 HLSL supports vector swizzles on scalars by implicitly converting the scalar to a single-element vector. This syntax is a convienent way to initialize vectors based on filling a scalar value. There are two p

[clang] [HLSL] Support vector swizzles on scalars (PR #67700)

2023-10-16 Thread Chris B via cfe-commits
llvm-beanz wrote: > This is the documentation i found. Can you confirm the intent is only to > support `.x???` and `r???` ? It alludes to more options. Maybe we need a > `isHLSLSwizzleStart` function to avoid comparing to `'x'` and `'r'` in > multiple places. The documentation for this is bad

[clang] [Windows] Add git-clang-format wrapper bat file (PR #69228)

2023-10-16 Thread Chris B via cfe-commits
https://github.com/llvm-beanz created https://github.com/llvm/llvm-project/pull/69228 This allows git-clang-format to be used on a Windows terminal without manually needing to find the path and invoke the python interpreter. We have a similar script for `scan-build`. >From 8d56f363230ff064fc3

[clang] d16c590 - Resolve possible test failure on Windows

2022-12-09 Thread Chris B via cfe-commits
Author: Chris Bieneman Date: 2022-12-09T13:43:52-06:00 New Revision: d16c59013056f1bf8844ded8faeb0cf01b1c3613 URL: https://github.com/llvm/llvm-project/commit/d16c59013056f1bf8844ded8faeb0cf01b1c3613 DIFF: https://github.com/llvm/llvm-project/commit/d16c59013056f1bf8844ded8faeb0cf01b1c3613.diff

[clang] ef783af - Move Clang's per-suite test targets into a folder

2022-12-09 Thread Chris B via cfe-commits
Author: Chris Bieneman Date: 2022-12-09T13:44:38-06:00 New Revision: ef783af0b9d299e0912a17f4841f74fae4352fee URL: https://github.com/llvm/llvm-project/commit/ef783af0b9d299e0912a17f4841f74fae4352fee DIFF: https://github.com/llvm/llvm-project/commit/ef783af0b9d299e0912a17f4841f74fae4352fee.diff

[clang] [NFC] Add API documentation and annotations (PR #78635)

2024-02-14 Thread Chris B via cfe-commits
@@ -570,7 +716,13 @@ double4 sin(double4); //===--===// // sqrt builtins //===--===// + +/// \fn T sqrt(T Val) +/// \brief Returns the squar

[clang] [NFC] Add API documentation and annotations (PR #78635)

2024-02-14 Thread Chris B via cfe-commits
https://github.com/llvm-beanz closed https://github.com/llvm/llvm-project/pull/78635 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [HLSL] Expose `half` types and intrinsics always (PR #81782)

2024-02-14 Thread Chris B via cfe-commits
https://github.com/llvm-beanz created https://github.com/llvm/llvm-project/pull/81782 We previously made an implmenetation error when adding `half` overloads for HLSL library functionalitly. The `half` type is always defined in HLSL and `half` intrinsics should not be conditionally included.

[clang] [HLSL] Vector standard conversions (PR #71098)

2024-02-14 Thread Chris B via cfe-commits
@@ -6432,7 +6432,7 @@ void InitializationSequence::InitializeFrom(Sema &S, // For HLSL ext vector types we allow list initialization behavior for C++ // constructor syntax. This is accomplished by converting initialization // arguments an InitListExpr late. - if (S.getLa

[clang] [HLSL] Expose `half` types and intrinsics always (PR #81782)

2024-02-15 Thread Chris B via cfe-commits
@@ -42,20 +49,20 @@ int16_t3 abs(int16_t3); _HLSL_AVAILABILITY(shadermodel, 6.2) _HLSL_BUILTIN_ALIAS(__builtin_elementwise_abs) int16_t4 abs(int16_t4); +#endif -_HLSL_AVAILABILITY(shadermodel, 6.2) +_HLSL_16BIT_AVAILABILITY(shadermodel, 6.2) llvm-beanz wrote:

[clang] [HLSL] Expose `half` types and intrinsics always (PR #81782)

2024-02-15 Thread Chris B via cfe-commits
https://github.com/llvm-beanz closed https://github.com/llvm/llvm-project/pull/81782 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [HLSL] Vector standard conversions (PR #71098)

2024-02-15 Thread Chris B via cfe-commits
https://github.com/llvm-beanz closed https://github.com/llvm/llvm-project/pull/71098 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] Revert "[HLSL] Vector standard conversions (#71098)" (PR #81944)

2024-02-15 Thread Chris B via cfe-commits
https://github.com/llvm-beanz approved this pull request. Sorry for the breakage. I'll investigate and re-land. https://github.com/llvm/llvm-project/pull/81944 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailm

[clang] [HLSL] Vector standard conversions (PR #71098)

2024-02-15 Thread Chris B via cfe-commits
llvm-beanz wrote: I pushed a speculative fix in 0065161c720c37e8ab545979aed6a03d944a3176. I think the assert I added was too aggressive. https://github.com/llvm/llvm-project/pull/71098 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://li

[clang] Revert "[HLSL] Vector standard conversions (#71098)" (PR #81944)

2024-02-15 Thread Chris B via cfe-commits
llvm-beanz wrote: I pushed a speculative fix in 0065161c720c37e8ab545979aed6a03d944a3176. https://github.com/llvm/llvm-project/pull/81944 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commit

[clang] Revert "[HLSL] Vector standard conversions (#71098)" (PR #81944)

2024-02-15 Thread Chris B via cfe-commits
llvm-beanz wrote: My fix seems to be righting the Linux bots. They should all be going green again. https://github.com/llvm/llvm-project/pull/81944 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo

[clang] [HLSL][Doc] Add doc about expected differences (PR #82395)

2024-02-20 Thread Chris B via cfe-commits
https://github.com/llvm-beanz created https://github.com/llvm/llvm-project/pull/82395 This document covers expected differences between Clang and the HLSL reference compiler implementations (FXC & DXC). The document is not intended to be exhaustive, but it should be a best effort to cover know

[clang] [HLSL][Doc] Add doc about expected differences (PR #82395)

2024-02-20 Thread Chris B via cfe-commits
https://github.com/llvm-beanz updated https://github.com/llvm/llvm-project/pull/82395 >From 558dd6182a4dc6fc5c5383358cac422289a7a90b Mon Sep 17 00:00:00 2001 From: Chris Bieneman Date: Tue, 20 Feb 2024 12:01:16 -0600 Subject: [PATCH 1/2] [HLSL][Doc] Add doc about expected differences This docu

[clang] [HLSL][Doc] Add doc about expected differences (PR #82395)

2024-02-20 Thread Chris B via cfe-commits
https://github.com/llvm-beanz updated https://github.com/llvm/llvm-project/pull/82395 >From 558dd6182a4dc6fc5c5383358cac422289a7a90b Mon Sep 17 00:00:00 2001 From: Chris Bieneman Date: Tue, 20 Feb 2024 12:01:16 -0600 Subject: [PATCH 1/3] [HLSL][Doc] Add doc about expected differences This docu

[clang] [HLSL][Doc] Add doc about expected differences (PR #82395)

2024-02-20 Thread Chris B via cfe-commits
https://github.com/llvm-beanz updated https://github.com/llvm/llvm-project/pull/82395 >From 558dd6182a4dc6fc5c5383358cac422289a7a90b Mon Sep 17 00:00:00 2001 From: Chris Bieneman Date: Tue, 20 Feb 2024 12:01:16 -0600 Subject: [PATCH 1/4] [HLSL][Doc] Add doc about expected differences This docu

[clang] [HLSL][Doc] Add doc about expected differences (PR #82395)

2024-02-20 Thread Chris B via cfe-commits
https://github.com/llvm-beanz updated https://github.com/llvm/llvm-project/pull/82395 >From 558dd6182a4dc6fc5c5383358cac422289a7a90b Mon Sep 17 00:00:00 2001 From: Chris Bieneman Date: Tue, 20 Feb 2024 12:01:16 -0600 Subject: [PATCH 1/5] [HLSL][Doc] Add doc about expected differences This docu

[clang] [HLSL][Doc] Add doc about expected differences (PR #82395)

2024-02-21 Thread Chris B via cfe-commits
https://github.com/llvm-beanz updated https://github.com/llvm/llvm-project/pull/82395 >From 558dd6182a4dc6fc5c5383358cac422289a7a90b Mon Sep 17 00:00:00 2001 From: Chris Bieneman Date: Tue, 20 Feb 2024 12:01:16 -0600 Subject: [PATCH 1/6] [HLSL][Doc] Add doc about expected differences This docu

[clang] [NFC][HLSL][DX] Update invalid environment tests (PR #81052)

2024-02-21 Thread Chris B via cfe-commits
https://github.com/llvm-beanz closed https://github.com/llvm/llvm-project/pull/81052 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [HLSL][Doc] Add doc about expected differences (PR #82395)

2024-02-22 Thread Chris B via cfe-commits
https://github.com/llvm-beanz closed https://github.com/llvm/llvm-project/pull/82395 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] Fix Default Asset File locator for clang docs (PR #97505)

2024-07-03 Thread Chris B via cfe-commits
@@ -167,7 +167,14 @@ llvm::Error getDefaultAssetFiles(const char *Argv0, llvm::SmallString<128> AssetsPath; AssetsPath = llvm::sys::path::parent_path(NativeClangDocPath); - llvm::sys::path::append(AssetsPath, "..", "share", "clang-doc"); + llvm::sys::path::append(AssetsP

[clang] [lldb] [HLSL] Implement intangible AST type (PR #97362)

2024-07-07 Thread Chris B via cfe-commits
https://github.com/llvm-beanz commented: Few comments, but mostly I really like this direction! https://github.com/llvm/llvm-project/pull/97362 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-

[clang] [lldb] [HLSL] Implement intangible AST type (PR #97362)

2024-07-07 Thread Chris B via cfe-commits
@@ -3428,6 +3428,12 @@ void CXXNameMangler::mangleType(const BuiltinType *T) { Out << 'u' << type_name.size() << type_name; \ break; #include "clang/Basic/AMDGPUTypes.def" +#define HLSL_INTANGIBLE_TYPE(Name, Id, SingletonId)

[clang] [lldb] [HLSL] Implement intangible AST type (PR #97362)

2024-07-07 Thread Chris B via cfe-commits
https://github.com/llvm-beanz edited https://github.com/llvm/llvm-project/pull/97362 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [lldb] [HLSL] Implement intangible AST type (PR #97362)

2024-07-07 Thread Chris B via cfe-commits
@@ -8001,6 +8001,12 @@ NamedDecl *Sema::ActOnVariableDeclarator( } } + if (getLangOpts().HLSL) { +if (R->isHLSLSpecificType() && !NewVD->isImplicit()) { + Diag(D.getBeginLoc(), diag::err_hlsl_intangible_type_cannot_be_declared); llvm-beanz wrot

[clang] [lldb] [HLSL] Implement intangible AST type (PR #97362)

2024-07-07 Thread Chris B via cfe-commits
@@ -12335,6 +12335,10 @@ def warn_hlsl_availability_unavailable : Warning, InGroup, DefaultError; +def err_hlsl_intangible_type_cannot_be_declared : Error< +"HLSL intangible type cannot be declared here">; +def err_hlsl_intangible_type_as_function_arg_or_return : Error< +"

[clang] [lldb] [HLSL] Implement intangible AST type (PR #97362)

2024-07-07 Thread Chris B via cfe-commits
@@ -0,0 +1,33 @@ +//===-- HLSLIntangibleTypes.def - HLSL standard intangible types *- C++ -*-===// +// +// 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:

[clang] [HLSL] set alwaysinline on HLSL functions (PR #106588)

2024-09-03 Thread Chris B via cfe-commits
@@ -290,8 +290,6 @@ struct BuiltinTypeDeclBuilder { SourceLocation())); MethodDecl->setLexicalDeclContext(Record); MethodDecl->setAccess(AccessSpecifier::AS_public); -MethodDecl->addAttr(AlwaysInlineAttr::CreateImplicit(

[clang] Make PCH's respect any VFS specified. (PR #106577)

2024-09-03 Thread Chris B via cfe-commits
@@ -1115,13 +1115,13 @@ void ASTWriter::WriteBlockInfoBlock() { } /// Prepares a path for being written to an AST file by converting it -/// to an absolute path and removing nested './'s. +/// to an absolute path and removing nested './'s and '../'s. /// /// \return \c true

[clang] Make PCH's respect any VFS specified. (PR #106577)

2024-09-03 Thread Chris B via cfe-commits
@@ -4772,6 +4772,23 @@ bool ASTWriter::PreparePathForOutput(SmallVectorImpl &Path) { Changed = true; } + // If we are generating a normal PCH (EG. not a C++ module). + if (!WritingModule) { +// Use the vfs overlay if it exists to translate paths. +auto &FileSy

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

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

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

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

[clang] [llvm] [HLSL] Implement '__builtin_hlsl_is_intangible' type trait (PR #104544)

2024-09-04 Thread Chris B via cfe-commits
@@ -249,4 +249,8 @@ FIELD(HasDeclaredCopyAssignmentWithConstParam, 1, MERGE_OR) /// base classes or fields have a no-return destructor FIELD(IsAnyDestructorNoReturn, 1, NO_MERGE) +/// Whether the record type is intangible (if any base classes or fields have +/// type that is i

[clang] [llvm] [HLSL] Implement '__builtin_hlsl_is_intangible' type trait (PR #104544)

2024-09-04 Thread Chris B via cfe-commits
https://github.com/llvm-beanz approved this pull request. Overall looks good. I think that in the places outside SemaHLSL we should try to refer to the trait as `HLSLIntangible` to make it clear that it is a language-mode specific feature. We don't need to repeat HLSL a million times in SemaHL

[clang] Adding `asuint` implementation to hlsl (PR #107292)

2024-09-06 Thread Chris B via cfe-commits
https://github.com/llvm-beanz commented: One question I have about this is do we actually need new builtins? These are just doing bit casts correct? Could we implement them entirely in the header? Something like: ```hlsl template T bit_cast(U Val) { return __builtin_bit_cast(T, Val); } uint

[clang] [HLSL] Allow truncation to scalar (PR #104844)

2024-09-06 Thread Chris B via cfe-commits
@@ -673,9 +673,6 @@ float dot(float3, float3); _HLSL_BUILTIN_ALIAS(__builtin_hlsl_dot) float dot(float4, float4); -_HLSL_BUILTIN_ALIAS(__builtin_hlsl_dot) -double dot(double, double); - llvm-beanz wrote: Oh, I think this can stay in once this PR lands: https

[clang] Fix implicit conversion rank ordering (PR #106811)

2024-09-09 Thread Chris B via cfe-commits
https://github.com/llvm-beanz closed https://github.com/llvm/llvm-project/pull/106811 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [HLSL] Allow truncation to scalar (PR #104844)

2024-09-09 Thread Chris B via cfe-commits
@@ -2032,26 +2032,42 @@ static bool IsVectorConversion(Sema &S, QualType FromType, QualType ToType, if (S.Context.hasSameUnqualifiedType(FromType, ToType)) return false; + // HLSL allows implicit truncation of vector types. + if (S.getLangOpts().HLSL) { +auto *ToE

[clang] [HLSL] Allow truncation to scalar (PR #104844)

2024-09-09 Thread Chris B via cfe-commits
https://github.com/llvm-beanz updated https://github.com/llvm/llvm-project/pull/104844 >From 1a1a92aff834aa2f6f12d3de001714d8338dd274 Mon Sep 17 00:00:00 2001 From: Chris Bieneman Date: Tue, 13 Aug 2024 15:51:34 -0500 Subject: [PATCH 1/3] [HLSL] Allow truncation to scalar HLSL allows implicit

[clang] [HLSL] Allow truncation to scalar (PR #104844)

2024-09-09 Thread Chris B via cfe-commits
@@ -4828,18 +4830,23 @@ Sema::PerformImplicitConversion(Expr *From, QualType ToType, } case ICK_HLSL_Vector_Truncation: { // Note: HLSL built-in vectors are ExtVectors. Since this truncates a - // vector to a smaller vector, this can only operate on argument

[clang] [HLSL] set alwaysinline on HLSL functions (PR #106588)

2024-09-09 Thread Chris B via cfe-commits
@@ -2471,11 +2471,14 @@ void CodeGenModule::SetLLVMFunctionAttributesForDefinition(const Decl *D, B.addAttribute(llvm::Attribute::StackProtectReq); if (!D) { +// HLSL functions must always be inlined +if (getLangOpts().HLSL && !F->hasFnAttribute("hlsl.shader"))

[clang] [HLSL] set alwaysinline on HLSL functions (PR #106588)

2024-09-09 Thread Chris B via cfe-commits
@@ -2471,11 +2471,14 @@ void CodeGenModule::SetLLVMFunctionAttributesForDefinition(const Decl *D, B.addAttribute(llvm::Attribute::StackProtectReq); if (!D) { +// HLSL functions must always be inlined llvm-beanz wrote: nit: we do try have comments b

[clang] [HLSL] set alwaysinline on HLSL functions (PR #106588)

2024-09-09 Thread Chris B via cfe-commits
https://github.com/llvm-beanz edited https://github.com/llvm/llvm-project/pull/106588 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [HLSL] set alwaysinline on HLSL functions (PR #106588)

2024-09-09 Thread Chris B via cfe-commits
@@ -2502,9 +2505,12 @@ void CodeGenModule::SetLLVMFunctionAttributesForDefinition(const Decl *D, ShouldAddOptNone &= !D->hasAttr(); ShouldAddOptNone &= !D->hasAttr(); - // Add optnone, but do so only if the function isn't always_inline. - if ((ShouldAddOptNone || D->has

[clang] [HLSL] Allow truncation to scalar (PR #104844)

2024-09-10 Thread Chris B via cfe-commits
https://github.com/llvm-beanz updated https://github.com/llvm/llvm-project/pull/104844 >From 1a1a92aff834aa2f6f12d3de001714d8338dd274 Mon Sep 17 00:00:00 2001 From: Chris Bieneman Date: Tue, 13 Aug 2024 15:51:34 -0500 Subject: [PATCH 1/4] [HLSL] Allow truncation to scalar HLSL allows implicit

[clang] [HLSL] Allow truncation to scalar (PR #104844)

2024-09-10 Thread Chris B via cfe-commits
llvm-beanz wrote: > ExprConstant.cpp currently assumes that an CK_HLSLVectorTruncation can't > return a scalar type. Thank you for catching this! I've updated the PR and included a test that constant evaluates some vector truncations in static asserts. https://github.com/llvm/llvm-project/pul

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

2024-09-10 Thread Chris B via cfe-commits
https://github.com/llvm-beanz created https://github.com/llvm/llvm-project/pull/108097 HLSL 202x inherits from C++11, which generates additional loop hint information for loops that must progress. Since HLSL 202x is going to be the default for Clang we want to make sure all our tests pass with

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

2024-09-10 Thread Chris B via cfe-commits
https://github.com/llvm-beanz edited https://github.com/llvm/llvm-project/pull/108097 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

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

2024-09-10 Thread Chris B via cfe-commits
llvm-beanz wrote: > 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? Just a few more. Most of the tests don't change when 202x is the default. https://github.com/llvm/llvm-project/pull/108097

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

2024-09-11 Thread Chris B via cfe-commits
https://github.com/llvm-beanz closed https://github.com/llvm/llvm-project/pull/108097 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [HLSL][Doc] Document multi-argument resolution (PR #104474)

2024-08-15 Thread Chris B via cfe-commits
https://github.com/llvm-beanz created https://github.com/llvm/llvm-project/pull/104474 This updates the expected diffferences document to capture the difference in multi-argument overload resolution between Clang and DXC. Fixes #99530 >From d00a28b19bebec1f48144f777ca60bff94190650 Mon Sep 17

[clang] [HLSL] Add __is_scalarized_layout_compatible (PR #102227)

2024-08-15 Thread Chris B via cfe-commits
llvm-beanz wrote: > Is this the expected behaviour: > > ```c++ > struct EmptyPadding : Empty { Empty e; int X; }; > struct Repeated : Empty, DerivedEmpty { int X; }; // expected-warning > {{inaccessible due to ambiguity}} > _Static_assert(sizeof(EmptyPadding) == 8, ""); > _Static_assert(sizeof(

[clang] [HLSL] Add __is_scalarized_layout_compatible (PR #102227)

2024-08-15 Thread Chris B via cfe-commits
@@ -1142,3 +1142,85 @@ bool SemaHLSL::CheckBuiltinFunctionCall(unsigned BuiltinID, CallExpr *TheCall) { } return false; } + +static void BuildFlattenedTypeList(QualType BaseTy, + llvm::SmallVectorImpl &List) { + llvm::SmallVector WorkList

[clang] [HLSL] Add __is_scalarized_layout_compatible (PR #102227)

2024-08-15 Thread Chris B via cfe-commits
@@ -1142,3 +1142,85 @@ bool SemaHLSL::CheckBuiltinFunctionCall(unsigned BuiltinID, CallExpr *TheCall) { } return false; } + +static void BuildFlattenedTypeList(QualType BaseTy, + llvm::SmallVectorImpl &List) { + llvm::SmallVector WorkList

[clang] [HLSL] Flesh out basic type typedefs (PR #104479)

2024-08-15 Thread Chris B via cfe-commits
https://github.com/llvm-beanz created https://github.com/llvm/llvm-project/pull/104479 We had a few missing typedefs that are supported by DXC. Specifically 1-element vectors, size-explicit 32-bit types and size-explicit floating point types. This adds the typedefs and a test file that just ve

[clang] [HLSL][Doc] Document multi-argument resolution (PR #104474)

2024-08-15 Thread Chris B via cfe-commits
https://github.com/llvm-beanz updated https://github.com/llvm/llvm-project/pull/104474 >From d00a28b19bebec1f48144f777ca60bff94190650 Mon Sep 17 00:00:00 2001 From: Chris Bieneman Date: Thu, 15 Aug 2024 12:03:55 -0500 Subject: [PATCH 1/2] [HLSL][Doc] Document multi-argument resolution This upd

[clang] [HLSL] Add __is_scalarized_layout_compatible (PR #102227)

2024-08-15 Thread Chris B via cfe-commits
https://github.com/llvm-beanz updated https://github.com/llvm/llvm-project/pull/102227 >From 5361c74f0130839870dae2b84abd9d9e75cf787b Mon Sep 17 00:00:00 2001 From: Chris Bieneman Date: Mon, 5 Aug 2024 13:22:47 -0500 Subject: [PATCH 1/2] [HLSL] Add __is_scalarized_layout_compatible HLSL tends

[clang] [HLSL] Flesh out basic type typedefs (PR #104479)

2024-08-15 Thread Chris B via cfe-commits
https://github.com/llvm-beanz updated https://github.com/llvm/llvm-project/pull/104479 >From 12bc3fcd5a72f3d1900055c772409f912d85df21 Mon Sep 17 00:00:00 2001 From: Chris Bieneman Date: Thu, 15 Aug 2024 12:04:14 -0500 Subject: [PATCH 1/2] [HLSL] Flesh out basic type typedefs We had a few missi

[clang] [HLSL][Doc] Document multi-argument resolution (PR #104474)

2024-08-15 Thread Chris B via cfe-commits
https://github.com/llvm-beanz updated https://github.com/llvm/llvm-project/pull/104474 >From a68223e1d0ee5e1b41ea7ec2385c9d581c901e70 Mon Sep 17 00:00:00 2001 From: Chris Bieneman Date: Thu, 15 Aug 2024 12:03:55 -0500 Subject: [PATCH] [HLSL][Doc] Document multi-argument resolution This updates

[clang] [HLSL] Add __is_scalarized_layout_compatible (PR #102227)

2024-08-15 Thread Chris B via cfe-commits
https://github.com/llvm-beanz updated https://github.com/llvm/llvm-project/pull/102227 >From 5361c74f0130839870dae2b84abd9d9e75cf787b Mon Sep 17 00:00:00 2001 From: Chris Bieneman Date: Mon, 5 Aug 2024 13:22:47 -0500 Subject: [PATCH 1/3] [HLSL] Add __is_scalarized_layout_compatible HLSL tends

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

2024-08-16 Thread Chris B via cfe-commits
@@ -1121,3 +1121,99 @@ bool SemaHLSL::CheckBuiltinFunctionCall(unsigned BuiltinID, CallExpr *TheCall) { } return false; } + +bool SemaHLSL::CheckCompatibleParameterABI(FunctionDecl *New, + FunctionDecl *Old) { + if (New->getNumPar

[clang] [HLSL][Doc] Document multi-argument resolution (PR #104474)

2024-08-16 Thread Chris B via cfe-commits
https://github.com/llvm-beanz updated https://github.com/llvm/llvm-project/pull/104474 >From a68223e1d0ee5e1b41ea7ec2385c9d581c901e70 Mon Sep 17 00:00:00 2001 From: Chris Bieneman Date: Thu, 15 Aug 2024 12:03:55 -0500 Subject: [PATCH 1/2] [HLSL][Doc] Document multi-argument resolution This upd

[clang] [HLSL] Flesh out basic type typedefs (PR #104479)

2024-08-16 Thread Chris B via cfe-commits
https://github.com/llvm-beanz closed https://github.com/llvm/llvm-project/pull/104479 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] Implement resource binding type prefix mismatch errors (PR #87578)

2024-04-04 Thread Chris B via cfe-commits
@@ -7367,6 +7367,75 @@ static void handleHLSLResourceBindingAttr(Sema &S, Decl *D, return; } + VarDecl *VD = dyn_cast(D); + HLSLBufferDecl *BD = dyn_cast(D); + + if (VD || BD) { +llvm::hlsl::ResourceClass RC; +std::string varTy = ""; +if (VD) { + + c

[clang] Implement resource binding type prefix mismatch errors (PR #87578)

2024-04-04 Thread Chris B via cfe-commits
@@ -7367,6 +7367,75 @@ static void handleHLSLResourceBindingAttr(Sema &S, Decl *D, return; } + VarDecl *VD = dyn_cast(D); + HLSLBufferDecl *BD = dyn_cast(D); + + if (VD || BD) { +llvm::hlsl::ResourceClass RC; +std::string varTy = ""; +if (VD) { + + c

[clang] [llvm] [HLSL][DXIL][SPIRV] Implementation of an abstraction for intrinsic selection of HLSL backends (PR #87171)

2024-04-04 Thread Chris B via cfe-commits
@@ -0,0 +1,47 @@ + +//===- CGHLSLUtils.h - Utility functions for HLSL CodeGen ---*- C++ -*-===// +// +// 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: A

[clang] [llvm] [HLSL][DXIL][SPIRV] Implementation of an abstraction for intrinsic selection of HLSL backends (PR #87171)

2024-04-04 Thread Chris B via cfe-commits
https://github.com/llvm-beanz approved this pull request. https://github.com/llvm/llvm-project/pull/87171 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] Implement resource binding type prefix mismatch errors (PR #87578)

2024-04-04 Thread Chris B via cfe-commits
@@ -7403,41 +7403,36 @@ static void handleHLSLResourceBindingAttr(Sema &S, Decl *D, } switch (RC) { case llvm::hlsl::ResourceClass::SRV: { - if (Slot.substr(0, 1) != "t") + if (Slot[0] != 't') S.Diag(ArgLoc, diag::err_hlsl_mismatching_register_ty

<    1   2   3   4   5   6   7   8   9   10   >