[PATCH] D159247: [HLSL] Cleanup support for `this` as an l-value

2023-09-05 Thread Chris Bieneman via Phabricator via cfe-commits
This revision was landed with ongoing or failed builds. This revision was automatically updated to reflect the committed changes. Closed by commit rG400d3261a0da: [HLSL] Cleanup support for `this` as an l-value (authored by beanz). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION

[PATCH] D159247: [HLSL] Cleanup support for `this` as an l-value

2023-09-01 Thread Chris Bieneman via Phabricator via cfe-commits
beanz updated this revision to Diff 555380. beanz added a comment. Updating based on PR feedback. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D159247/new/ https://reviews.llvm.org/D159247 Files: clang/include/clang/AST/ExprCXX.h clang/lib/AST

[PATCH] D159247: [HLSL] Cleanup support for `this` as an l-value

2023-08-31 Thread Chris Bieneman via Phabricator via cfe-commits
beanz updated this revision to Diff 555118. beanz added a comment. Updating based on review feedback from @core3ntin. Thank you! Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D159247/new/ https://reviews.llvm.org/D159247 Files: clang/include/clan

[PATCH] D159247: [HLSL] Cleanup support for `this` as an l-value

2023-08-31 Thread Chris Bieneman via Phabricator via cfe-commits
beanz added a comment. Yea, we could do that approach. It will mean filtering about a few `getNonReferenceType()` calls, which is what I was trying to avoid. That said, it might be the better solution since it can be unconditional and will work for both deducing `this` and HLSL. I'll test it o

[PATCH] D159247: [HLSL] Cleanup support for `this` as an l-value

2023-08-30 Thread Chris Bieneman via Phabricator via cfe-commits
beanz added a comment. Full disclosure here, I need to write some more tests for this. It should be NFC for all languages other than HLSL, but I want to spend some time making sure that the tests adequately exercise the HLSL paths (which should also be mostly NFC). Repository: rG LLVM Githu

[PATCH] D159247: [HLSL] Cleanup support for `this` as an l-value

2023-08-30 Thread Chris Bieneman via Phabricator via cfe-commits
beanz created this revision. beanz added reviewers: cor3ntin, aaron.ballman, bogner. Herald added subscribers: Anastasia, ChuanqiXu, martong. Herald added a reviewer: shafik. Herald added a reviewer: NoQ. Herald added a project: All. beanz requested review of this revision. Herald added a project:

[PATCH] D159126: [Clang] Add captures to the instantiation scope of lambda call operators

2023-08-29 Thread Chris Bieneman via Phabricator via cfe-commits
beanz added a comment. Yea, the gist of it is that in HLSL `this` is a reference not a pointer, which means the `CXXThisExpr` is always an LValue. I think the right fix for this is to cleanup the `CXXThisExpr` creation code and create a `CXXThisExpr::Create` method like the other AST nodes. The

[PATCH] D159126: [Clang] Add captures to the instantiation scope of lambda call operators

2023-08-29 Thread Chris Bieneman via Phabricator via cfe-commits
beanz added a comment. @cor3ntin, I know what the problem is and I think I can put up a review for a fix tonight or (more likely) tomorrow. Is that okay? Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D159126/new/ https://reviews.llvm.org/D159126 _

[PATCH] D159126: [Clang] Add captures to the instantiation scope of lambda call operators

2023-08-29 Thread Chris Bieneman via Phabricator via cfe-commits
beanz added a comment. I'll apply this patch and debug the issue today. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D159126/new/ https://reviews.llvm.org/D159126 ___ cfe-commits mailing list cfe-commits

[PATCH] D158820: [Sema][HLSL] Fix naming of anyhit/closesthit shaders

2023-08-25 Thread Chris Bieneman via Phabricator via cfe-commits
beanz added inline comments. Comment at: clang/test/SemaHLSL/shader_type_attr.hlsl:30 // expected-error@+1 {{'shader' attribute parameters do not match the previous declaration}} +[shader("pixel")] bob80905 wrote: > bogner wrote: > > bob80905 wrote: > > > I d

[PATCH] D157149: [Option] Add "Visibility" field and clone the OptTable APIs to use it

2023-08-14 Thread Chris Bieneman via Phabricator via cfe-commits
beanz accepted this revision. beanz added a comment. LGTM. This is definitely an improvement over the awfulness we were doing. Thanks @bogner! Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D157149/new/ https://reviews.llvm.org/D157149

[PATCH] D156178: [HLSL] add pow library function

2023-07-24 Thread Chris Bieneman via Phabricator via cfe-commits
beanz added inline comments. Comment at: clang/test/CodeGenHLSL/builtins/pow.hlsl:6 +// RUN: dxil-pc-shadermodel6.3-library %s -emit-llvm -disable-llvm-passes \ +// RUN: -D__HLSL_ENABLE_16_BIT -o - | FileCheck %s --check-prefix=NO_HALF + Does this need to set

[PATCH] D151683: [clang] Enable C++11-style attributes in all language modes

2023-06-09 Thread Chris Bieneman via Phabricator via cfe-commits
beanz added inline comments. Comment at: clang/test/ParserHLSL/group_shared.hlsl:14 -// expected-error@+1 {{expected expression}} float groupshared [[]] i = 12; philnik wrote: > beanz wrote: > > aaron.ballman wrote: > > > philnik wrote: > > > > Should this als

[PATCH] D151683: [clang] Enable C++11-style attributes in all language modes

2023-06-09 Thread Chris Bieneman via Phabricator via cfe-commits
beanz added inline comments. Comment at: clang/test/ParserHLSL/group_shared.hlsl:14 -// expected-error@+1 {{expected expression}} float groupshared [[]] i = 12; aaron.ballman wrote: > philnik wrote: > > Should this also get an extension warning/should attribut

[PATCH] D143553: [Clang][CMake] Use perf-training for Clang-BOLT

2023-05-13 Thread Chris Bieneman via Phabricator via cfe-commits
beanz accepted this revision. beanz added a comment. This revision is now accepted and ready to land. LGTM. Sorry for the delays reviewing! Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D143553/new/ https://reviews.llvm.org/D143553 ___

[PATCH] D149119: [CMake] Use LLVM own tools in extract_symbols.py

2023-05-09 Thread Chris Bieneman via Phabricator via cfe-commits
beanz added a comment. One potential area of concern here: If `llvm-driver` is ever extended to work as a plugin loader (thus exporting its symbols), removing support for the pre-installed host tools could cause a cyclic dependency. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D149119/

[PATCH] D145270: Add codegen for llvm exp/exp2 elementwise builtins

2023-03-07 Thread Chris Bieneman via Phabricator via cfe-commits
beanz added inline comments. Comment at: clang/docs/LanguageExtensions.rst:642 T __builtin_elementwise_log10(T x) return the base 10 logarithm of x floating point types + T __builtin_elementwise_exp(T x)returns the base-e exp

[PATCH] D143208: Repair sphinx doc generation

2023-02-02 Thread Chris Bieneman via Phabricator via cfe-commits
beanz accepted this revision. beanz added a comment. This revision is now accepted and ready to land. LGTM Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D143208/new/ https://reviews.llvm.org/D143208 ___ c

[PATCH] D140489: Add builtin_elementwise_log

2023-01-31 Thread Chris Bieneman via Phabricator via cfe-commits
beanz accepted this revision. beanz added a comment. This revision is now accepted and ready to land. LGTM. This looks pretty straightforward and similar to other changes you've been making. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D140489/new/

[PATCH] D141705: [HLSL] [Dirver] add dxv as a Driver Action Job

2023-01-27 Thread Chris Bieneman via Phabricator via cfe-commits
beanz added inline comments. Comment at: clang/include/clang/Driver/Types.def:110 TYPE("api-information", API_INFO, INVALID, "json", phases::Precompile) +TYPE("dx-container", DX_CONTAINER, INVALID, "dxc", phases::Compile, phases::B

[PATCH] D141705: [HLSL] [Dirver] add dxv as a Driver Action Job

2023-01-26 Thread Chris Bieneman via Phabricator via cfe-commits
beanz added inline comments. Comment at: clang/include/clang/Basic/DiagnosticDriverKinds.td:687 +def warn_drv_dxc_missing_dxv : Warning<"dxv not found." +" Resulting DXIL will not be signed for use in release environments.">; Not all `dxv` binaries can sign

[PATCH] D136031: [DirectX backend] support ConstantBuffer to DXILResource.h

2023-01-18 Thread Chris Bieneman via Phabricator via cfe-commits
beanz added a comment. @python3kgae, this change introduced a bunch of warning spew because it is using an API that was deprecated shortly before the change merged. Can you please address this? Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D136031/

[PATCH] D131052: [CMake] Allow setting the location of host tools with LLVM_NATIVE_TOOL_DIR

2023-01-18 Thread Chris Bieneman via Phabricator via cfe-commits
beanz accepted this revision. beanz added a comment. This revision is now accepted and ready to land. LGTM! Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D131052/new/ https://reviews.llvm.org/D131052 ___

[PATCH] D141705: [HLSL] [Dirver] add dxv as a VerifyDebug Job

2023-01-17 Thread Chris Bieneman via Phabricator via cfe-commits
beanz added inline comments. Comment at: clang/lib/Driver/Driver.cpp:4215 + // Call validator for dxc. + if (IsDXCMode()) { +Action *LastAction = Actions.back(); Shouldn't the validator only run if we are targeting DXIL? Also we should probably add the `-V

[PATCH] D141705: [HLSL] [Dirver] add dxv as a VerifyDebug Job

2023-01-17 Thread Chris Bieneman via Phabricator via cfe-commits
beanz added a comment. Re-using the `VerifyDebug` action really doesn't make sense. That's not what the DXIL validator does, and it will be a source of confusion forever. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D141705/new/ https://reviews.ll

[PATCH] D131052: [CMake] Allow setting the location of host tools with LLVM_NATIVE_TOOL_DIR

2023-01-13 Thread Chris Bieneman via Phabricator via cfe-commits
beanz added a comment. The convention that `find_program` uses is to cache the variables, which causes them to be defined at global scope. That also avoids needing to recompute filesystem lookups in incremental builds, which is desirable. Repository: rG LLVM Github Monorepo CHANGES SINCE LA

[PATCH] D131052: [CMake] Allow setting the location of host tools with LLVM_NATIVE_TOOL_DIR

2023-01-13 Thread Chris Bieneman via Phabricator via cfe-commits
beanz added inline comments. Comment at: llvm/cmake/modules/AddLLVM.cmake:2401 + +macro(setup_host_tool tool_name setting_name exe_var_name target_var_name) + cmake_parse_arguments(ARG "" "SCOPE" "" ${ARGN}) Please make this a `function` instead of a `macro`. In

[PATCH] D136031: [DirectX backend] support ConstantBuffer to DXILResource.h

2023-01-12 Thread Chris Bieneman via Phabricator via cfe-commits
beanz accepted this revision. beanz added a comment. This revision is now accepted and ready to land. LGTM Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D136031/new/ https://reviews.llvm.org/D136031 ___ c

[PATCH] D136031: [DirectX backend] support ConstantBuffer to DXILResource.h

2023-01-03 Thread Chris Bieneman via Phabricator via cfe-commits
beanz added a comment. It is probably worth adding some unit tests to test the `CBufferDataLayout` class. I think the meat of this change is fine. This code mixes `unsigned` and `uint32_t` interchangeably. They aren't required by the language to be the same. I have a general preference toward

[PATCH] D139137: add floor library function

2022-12-05 Thread Chris Bieneman via Phabricator via cfe-commits
beanz accepted this revision. beanz added a comment. This revision is now accepted and ready to land. LGTM. @bob80905 if you haven't already, you should follow the steps here (https://www.llvm.org/docs/DeveloperPolicy.html#obtaining-commit-access) to get commit access. Repository: rG LLVM Gi

[PATCH] D135721: [HLSL] Added HLSL this as a reference

2022-11-04 Thread Chris Bieneman via Phabricator via cfe-commits
beanz added inline comments. Comment at: clang/test/AST/HLSL/RWBuffer-AST.hlsl:49-50 // CHECK-NEXT: ArraySubscriptExpr 0x{{[0-9A-Fa-f]+}} <> 'element_type' lvalue -// CHECK-NEXT: MemberExpr 0x{{[0-9A-Fa-f]+}} <> 'element_type *' lvalue ->h 0x{{[0-9A-Fa-f]+}} -// CHECK-NEXT: CX

[PATCH] D135721: [HLSL] Added HLSL this as a reference

2022-11-03 Thread Chris Bieneman via Phabricator via cfe-commits
beanz added inline comments. Comment at: clang/lib/Sema/HLSLExternalSemaSource.cpp:179 +AST, SourceLocation(), +Constructor->getThisType().getTypePtr()->getPointeeType(), true); +This->setValueKind(ExprValueKind::VK_LValue); aaron.ballman wrot

[PATCH] D136271: [HLSL] Remove unused frontend-generated ID

2022-10-21 Thread Chris Bieneman via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rG4c7218e77026: [HLSL] Remove unused frontend-generated ID (authored by beanz). Changed prior to commit: https://reviews.llvm.org/D136271?vs=468961&id=469681#toc Repository: rG LLVM Github Monorepo CH

[PATCH] D136134: [NFC] [DirectX backend] move ResourceClass into llvm.

2022-10-20 Thread Chris Bieneman via Phabricator via cfe-commits
beanz added inline comments. Comment at: clang/lib/Sema/HLSLExternalSemaSource.cpp:20 #include "clang/Sema/Sema.h" +#include "llvm/Frontend/HLSL/HLSLResource.h" python3kgae wrote: > python3kgae wrote: > > beanz wrote: > > > You need to add FrontendHLSL to the

[PATCH] D136134: [NFC] [DirectX backend] move ResourceClass into llvm.

2022-10-20 Thread Chris Bieneman via Phabricator via cfe-commits
beanz added inline comments. Comment at: clang/lib/Sema/HLSLExternalSemaSource.cpp:20 #include "clang/Sema/Sema.h" +#include "llvm/Frontend/HLSL/HLSLResource.h" You need to add FrontendHLSL to the Sema/CMakeLists.txt file too. Repository: rG LLVM Github Mo

[PATCH] D136271: [HLSL] Remove unused frontend-generated ID

2022-10-19 Thread Chris Bieneman via Phabricator via cfe-commits
beanz created this revision. beanz added a reviewer: python3kgae. Herald added subscribers: Anastasia, hiraditya. Herald added a project: All. beanz requested review of this revision. Herald added projects: clang, LLVM. Herald added a subscriber: llvm-commits. As @python3kgae pointed out we're goi

[PATCH] D135973: Move HLSL builtins into hlsl namespace

2022-10-19 Thread Chris Bieneman via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rGd146a5241c50: Move HLSL builtins into hlsl namespace (authored by beanz). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D135973/new/ https://reviews.llvm.org

[PATCH] D135429: [HLSL] [DirectX backend] Move generateGlobalCtorDtorCalls into DirectX backend.

2022-10-19 Thread Chris Bieneman via Phabricator via cfe-commits
beanz added inline comments. Comment at: clang/lib/CodeGen/CGHLSLRuntime.cpp:193 - -void CGHLSLRuntime::generateGlobalCtorDtorCalls() { - llvm::Module &M = CGM.getModule(); I think you've been a bit too aggressive about what code you're moving. The code that ge

[PATCH] D135429: [HLSL] [DirectX backend] Move generateGlobalCtorDtorCalls into DirectX backend.

2022-10-19 Thread Chris Bieneman via Phabricator via cfe-commits
beanz added a comment. In addition to restoring the test cases that you deleted, I think you should also reduce and simplify the test cases you're adding. These new tests are very large blobs of IR generated by clang. They include a lot of extra instructions that aren't needed to exercise the c

[PATCH] D135429: [HLSL] [DirectX backend] Move generateGlobalCtorDtorCalls into DirectX backend.

2022-10-19 Thread Chris Bieneman via Phabricator via cfe-commits
beanz added a comment. I don’t think you should be deleting all those frontend tests. Those tests existed before your change to remove the global constructor global variable, they provide valuable coverage of the frontend constructor generation. Repository: rG LLVM Github Monorepo CHANGES S

[PATCH] D133983: [HLSL] Add SV_DispatchThreadID

2022-10-18 Thread Chris Bieneman via Phabricator via cfe-commits
beanz accepted this revision. beanz added a comment. LGTM Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D133983/new/ https://reviews.llvm.org/D133983 ___ cfe-commits mailing list cfe-commits@lists.llvm.or

[PATCH] D135110: [NFC] [HLSL] Move common metadata to LLVMFrontend

2022-10-18 Thread Chris Bieneman via Phabricator via cfe-commits
beanz added a comment. The llvm-config test issue should be resolved in rGa4b010034f57 Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D135110/new/ https://reviews.llvm.org/D135110

[PATCH] D135110: [NFC] [HLSL] Move common metadata to LLVMFrontend

2022-10-18 Thread Chris Bieneman via Phabricator via cfe-commits
beanz added a comment. I think I have a fix for this and I'll get it up today. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D135110/new/ https://reviews.llvm.org/D135110 ___ cfe-commits mailing list cfe-

[PATCH] D130951: [HLSL] CodeGen hlsl resource binding.

2022-10-17 Thread Chris Bieneman via Phabricator via cfe-commits
beanz accepted this revision. beanz added inline comments. This revision is now accepted and ready to land. Comment at: clang/lib/CodeGen/CGHLSLRuntime.h:73 CodeGenModule &CGM; uint32_t ResourceCounters[static_cast( hlsl::ResourceClass::NumClasses)] = {0}; --

[PATCH] D130951: [HLSL] CodeGen hlsl resource binding.

2022-10-17 Thread Chris Bieneman via Phabricator via cfe-commits
beanz added inline comments. Comment at: clang/lib/CodeGen/CGHLSLRuntime.h:73 CodeGenModule &CGM; uint32_t ResourceCounters[static_cast( hlsl::ResourceClass::NumClasses)] = {0}; The `ResourceCounters` here was a stand-in for allocating resource indic

[PATCH] D130951: [HLSL] CodeGen hlsl resource binding.

2022-10-14 Thread Chris Bieneman via Phabricator via cfe-commits
beanz added inline comments. Comment at: clang/include/clang/Basic/HLSLRuntime.h:31 +// NOTE: keep sync with ResourceBase::Kinds in DirectX backend. +enum class ResourceKind : uint32_t { + Invalid = 0, If this is only used in the clangCodeGen library, we can mov

[PATCH] D135110: [NFC] [HLSL] Move common metadata to LLVMFrontend

2022-10-14 Thread Chris Bieneman via Phabricator via cfe-commits
This revision was landed with ongoing or failed builds. This revision was automatically updated to reflect the committed changes. Closed by commit rG911d2dc23035: [NFC] [HLSL] Move common metadata to LLVMFrontend (authored by beanz). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTIO

[PATCH] D135973: Move HLSL builtins into hlsl namespace

2022-10-14 Thread Chris Bieneman via Phabricator via cfe-commits
beanz created this revision. beanz added reviewers: python3kgae, pow2clk, bob80905. Herald added a subscriber: Anastasia. Herald added a project: All. beanz requested review of this revision. Herald added a project: clang. Should have done this from the start. Since all the injected AST types are

[PATCH] D135110: [NFC] [HLSL] Move common metadata to LLVMFrontend

2022-10-13 Thread Chris Bieneman via Phabricator via cfe-commits
beanz added inline comments. Comment at: llvm/lib/Target/DirectX/DXILResource.h:46 // can only be added to the end, and not removed. enum class Kinds : uint32_t { Invalid = 0, python3kgae wrote: > Could we move ResourceBase::Kinds to Frontend/HLSL/HLSL

[PATCH] D135110: [NFC] [HLSL] Move common metadata to LLVMFrontend

2022-10-13 Thread Chris Bieneman via Phabricator via cfe-commits
beanz updated this revision to Diff 467606. beanz added a comment. Rebasing Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D135110/new/ https://reviews.llvm.org/D135110 Files: clang/lib/CodeGen/CGHLSLRuntime.cpp clang/lib/CodeGen/CMakeLists.txt

[PATCH] D135060: [HLSL] Add groupshare address space.

2022-10-12 Thread Chris Bieneman via Phabricator via cfe-commits
beanz added inline comments. Comment at: clang/test/ParserHLSL/group_shared.hlsl:11 +// expected-warning@+1 {{'auto' type specifier is a C++11 extension}} +auto l = []() groupshared {}; + What happens to this if you set the language standard to hlsl 202x? I setu

[PATCH] D135060: [HLSL] Add groupshare address space.

2022-10-12 Thread Chris Bieneman via Phabricator via cfe-commits
beanz added inline comments. Comment at: clang/include/clang/Basic/Attr.td:4063 + let Spellings = [Keyword<"groupshared">]; + let Documentation = [HLSLGroupSharedAddressSpaceDocs]; +} Shouldn't this have `let Subjects = SubjectList<[Var]>;`? I don't think we s

[PATCH] D135595: [HLSL] Add utility to convert environment to stage

2022-10-12 Thread Chris Bieneman via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rG19a0a5674911: [HLSL] Add utility to convert environment to stage (authored by beanz). Herald added a project: LLVM. Herald added a subscriber: llvm-commits. Changed prior to commit: https://reviews.llvm

[PATCH] D135595: [HLSL] Add utility to convert environment to stage

2022-10-12 Thread Chris Bieneman via Phabricator via cfe-commits
beanz added inline comments. Comment at: clang/include/clang/Basic/HLSLRuntime.h:39 + return static_cast(Pipeline); +} + bogner wrote: > You're not actually introducing the dependency here (it was already there), > but neither `ShaderStage` in LangOptions.h nor

[PATCH] D135721: [HLSL] Added HLSL this as a reference

2022-10-11 Thread Chris Bieneman via Phabricator via cfe-commits
beanz added a reviewer: aaron.ballman. beanz added a subscriber: aaron.ballman. beanz added a comment. Looping in @aaron.ballman here too because this is a bit of a fun one... I know Aaron loves when we show him the best of HLSL 😄 Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION

[PATCH] D135595: [HLSL] Add utility to convert environment to stage

2022-10-10 Thread Chris Bieneman via Phabricator via cfe-commits
beanz added a comment. We should absolutely add utility functions when we have uses for them. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D135595/new/ https://reviews.llvm.org/D135595 ___ cfe-commits ma

[PATCH] D133668: [HLSL] Use _BitInt(16) for int16_t to avoid promote to int.

2022-10-10 Thread Chris Bieneman via Phabricator via cfe-commits
beanz added a comment. In D133668#3847871 , @rjmccall wrote: > But that's purely on the implementation level, right? Everything is > implicitly vectorized and you're just specifying the computation of a single > lane, but as far as that lane-wise compu

[PATCH] D133668: [HLSL] Use _BitInt(16) for int16_t to avoid promote to int.

2022-10-10 Thread Chris Bieneman via Phabricator via cfe-commits
beanz added a comment. In D133668#3847163 , @rjmccall wrote: > Sure, but it's extremely easy to unpromote that arithmetic for most > operators, and I'm sure LLVM already has a pass that will do that. Okay... but HLSL explicitly doesn't promote. Having t

[PATCH] D135595: [HLSL] Add utility to convert environment to stage

2022-10-10 Thread Chris Bieneman via Phabricator via cfe-commits
beanz added a comment. Worth noting, we do have a similar set of static_asserts in Triple.cpp to validate the ordering of enum cases and that the subtraction results in the appropriate values: https://github.com/llvm/llvm-project/blob/main/llvm/lib/Support/Triple.cpp#L1942 Repository: rG LL

[PATCH] D135595: [HLSL] Add utility to convert environment to stage

2022-10-10 Thread Chris Bieneman via Phabricator via cfe-commits
beanz added a comment. In D135595#3847056 , @python3kgae wrote: > Backend needs the same thing. > Is it possible to move this to llvm and share it between frontend and backend? This translates the triple to a clang-defined enum... so strictly speaking n

[PATCH] D135595: [HLSL] Add utility to convert environment to stage

2022-10-10 Thread Chris Bieneman via Phabricator via cfe-commits
beanz created this revision. beanz added reviewers: aaron.ballman, MaskRay, klimek, python3kgae, pow2clk. Herald added subscribers: Anastasia, StephenFan. Herald added a project: All. beanz requested review of this revision. Herald added a project: clang. We had a bunch of places in the code where

[PATCH] D133668: [HLSL] Use _BitInt(16) for int16_t to avoid promote to int.

2022-10-09 Thread Chris Bieneman via Phabricator via cfe-commits
beanz added a comment. Avoiding argument promotion is one part of what we need, but not all of it. For example if you take this trial code: const RWBuffer In; RWBuffer Out; [numthreads(1,1,1)] void main(uint GI : SV_GroupIndex) { Out[GI] = In[GI].x + In[GI].y; } Following C rul

[PATCH] D133983: [HLSL] Add SV_DispatchThreadID

2022-10-07 Thread Chris Bieneman via Phabricator via cfe-commits
beanz added inline comments. Comment at: clang/lib/CodeGen/CGHLSLRuntime.cpp:135 +llvm::Function *DxThreadID = CGM.getIntrinsic(Intrinsic::dx_thread_id); +// dx_thread_id +return buildVectorInput(B, DxThreadID, Ty); nit: this comment doesn't add value

[PATCH] D133993: [HLSL] Remove global ctor/dtor variable for non-lib profile.

2022-10-06 Thread Chris Bieneman via Phabricator via cfe-commits
beanz added a comment. @efriedma, I think that's a great suggestion. @python3kgae, if you don't adjust this patch, can you file an issue for that so that we don't lose that feedback? Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D133993/new/ https:

[PATCH] D133993: [HLSL] Remove global ctor/dtor variable for non-lib profile.

2022-10-06 Thread Chris Bieneman via Phabricator via cfe-commits
beanz added a comment. In D133993#3816526 , @efriedma wrote: > Why are we using different mechanisms for global constructors in "libraries" > vs. other code? If we need a mechanism in LLVM already, we might as well use > it all the time? To elaborate

[PATCH] D130131: [HLSL] CodeGen hlsl cbuffer/tbuffer.

2022-10-04 Thread Chris Bieneman via Phabricator via cfe-commits
beanz added a reviewer: asl. beanz added a subscriber: asl. beanz added a comment. +@asl for codegen owner perspective. This LGTM too. The changes here are well isolated to HLSL, so they should have no adverse impact on other language support. @efriedma, @asl & @rjmccall any feedback? Reposit

[PATCH] D134330: [Docs] [HLSL] Add note about PCH support

2022-10-04 Thread Chris Bieneman via Phabricator via cfe-commits
beanz added inline comments. Comment at: clang/docs/HLSL/HLSLSupport.rst:98 +``HLSLExternalSemaSource`` will create new decls and use the old decls as +argument for setPreviousDecl. + We can probably generalize this to something like: ``` When precompiled headers

[PATCH] D135110: [NFC] [HLSL] Move common metadata to LLVMFrontend

2022-10-04 Thread Chris Bieneman via Phabricator via cfe-commits
beanz added a comment. In D135110#3832728 , @tschuett wrote: > The OpenMP frontend is mainly an IRBuilder. It is a different layering than > for HLSL. Are there plans for an HLSL(IR)Builder? HLSL and OpenMP are different in a lot of ways. HLSL's code ge

[PATCH] D135110: [NFC] [HLSL] Move common metadata to LLVMFrontend

2022-10-03 Thread Chris Bieneman via Phabricator via cfe-commits
beanz created this revision. beanz added reviewers: python3kgae, tschuett, jdoerfert, bogner, pow2clk, tex3d, Anastasia, efriedma. Herald added a subscriber: hiraditya. Herald added a project: All. beanz requested review of this revision. Herald added projects: clang, LLVM. This change pulls some

[PATCH] D133983: [HLSL] Add SV_DispatchThreadID

2022-09-30 Thread Chris Bieneman via Phabricator via cfe-commits
beanz added inline comments. Comment at: clang/lib/CodeGen/CGHLSLRuntime.cpp:167 + for (const auto &Param : Fn->args()) { +if (Param.hasStructRetAttr()) { + // FIXME: support output. python3kgae wrote: > beanz wrote: > > I might be missing something, bu

[PATCH] D133983: [HLSL] Add SV_DispatchThreadID

2022-09-30 Thread Chris Bieneman via Phabricator via cfe-commits
beanz added inline comments. Comment at: clang/lib/CodeGen/CGHLSLRuntime.cpp:167 + for (const auto &Param : Fn->args()) { +if (Param.hasStructRetAttr()) { + // FIXME: support output. I might be missing something, but I'm not seeing a test that exercises

[PATCH] D134637: clang-tblgen build: avoid duplicate inclusion of libLLVMSupport

2022-09-28 Thread Chris Bieneman via Phabricator via cfe-commits
beanz added a comment. I think this approach mostly looks sane to me. @phosek, and @Ericson2314 may have different feedback. Comment at: clang/lib/Support/CMakeLists.txt:23 + # libLLVM-*.so). + llvm_add_library(clangSupport_tablegen +STATIC Unless there

[PATCH] D134693: [CMake] Add `CLANG_ENABLE_HLSL` CMake option

2022-09-27 Thread Chris Bieneman via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rGe432108bf254: [CMake] Add `CLANG_ENABLE_HLSL` CMake option (authored by beanz). Changed prior to commit: https://reviews.llvm.org/D134693?vs=463079&id=463275#toc Repository: rG LLVM Github Monorepo

[PATCH] D134693: [CMake] Add `CLANG_ENABLE_HLSL` CMake option

2022-09-26 Thread Chris Bieneman via Phabricator via cfe-commits
beanz created this revision. beanz added reviewers: phosek, smeenai, compnerd. Herald added a subscriber: Anastasia. Herald added a project: All. beanz requested review of this revision. Herald added a project: clang. The HLSL support in clang is in proress and not fully functioning. As such we do

[PATCH] D134304: [Docs] [HLSL] Add IR reference for HLSL

2022-09-23 Thread Chris Bieneman via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rGd20f9f8d2177: [Docs] [HLSL] Add IR reference for HLSL (authored by beanz). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D134304/new/ https://reviews.llvm.or

[PATCH] D134304: [Docs] [HLSL] Add IR reference for HLSL

2022-09-22 Thread Chris Bieneman via Phabricator via cfe-commits
beanz updated this revision to Diff 462299. beanz added a comment. Updating documentation for `hlsl.uavs`, thanks @python3kgae! Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D134304/new/ https://reviews.llvm.org/D134304 Files: clang/docs/HLSL/HLS

[PATCH] D131799: [HLSL] clang codeGen for HLSLNumThreadsAttr

2022-09-22 Thread Chris Bieneman via Phabricator via cfe-commits
beanz accepted this revision. beanz added a comment. This revision is now accepted and ready to land. LGTM Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D131799/new/ https://reviews.llvm.org/D131799 ___ c

[PATCH] D130131: [HLSL] CodeGen hlsl cbuffer/tbuffer.

2022-09-22 Thread Chris Bieneman via Phabricator via cfe-commits
beanz added a comment. This is looking great. Thank you for all your work iterating on this. Please update the description to reflect the changes in implementation. Comment at: clang/lib/CodeGen/CGHLSLRuntime.cpp:120 + +void addResourceBinding(GlobalVariable *GV, CGHLSLRuntime

[PATCH] D134326: [HLSL] Allow SV_GroupIndex for lib profile.

2022-09-21 Thread Chris Bieneman via Phabricator via cfe-commits
beanz accepted this revision. beanz added a comment. This revision is now accepted and ready to land. LGTM. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D134326/new/ https://reviews.llvm.org/D134326 ___

[PATCH] D134326: [HLSL] Allow SV_GroupIndex for lib profile.

2022-09-21 Thread Chris Bieneman via Phabricator via cfe-commits
beanz added inline comments. Comment at: clang/lib/Sema/SemaDeclAttr.cpp:6901 +// FIXME: it is OK for a compute shader entry and pixel shader entry live in +// same HLSL file. uint32_t Pipeline = I think the underlying issue here is that some attrib

[PATCH] D134319: [HLSL] add ceil library function

2022-09-20 Thread Chris Bieneman via Phabricator via cfe-commits
beanz added a comment. For this builtin you should be able to use `__builtin_elementwise_ceil` for all the overload cases, and you should be able to add the vector cases too. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D134319/new/ https://review

[PATCH] D133993: [HLSL] Remove global ctor/dtor variable for non-lib profile.

2022-09-20 Thread Chris Bieneman via Phabricator via cfe-commits
beanz added inline comments. Comment at: clang/lib/CodeGen/CGHLSLRuntime.cpp:208 + // ctors/dtors added for entry. + Triple T(M.getTargetTriple()); + if (T.getEnvironment() != Triple::EnvironmentType::Library) { python3kgae wrote: > beanz wrote: > > I question

[PATCH] D133993: [HLSL] Remove global ctor/dtor variable for non-lib profile.

2022-09-20 Thread Chris Bieneman via Phabricator via cfe-commits
beanz added inline comments. Comment at: clang/lib/CodeGen/CGHLSLRuntime.cpp:208 + // ctors/dtors added for entry. + Triple T(M.getTargetTriple()); + if (T.getEnvironment() != Triple::EnvironmentType::Library) { I question whether we should do this early or la

[PATCH] D134312: [HLSL] remove unnecessary abs attributes

2022-09-20 Thread Chris Bieneman via Phabricator via cfe-commits
This revision was landed with ongoing or failed builds. This revision was automatically updated to reflect the committed changes. Closed by commit rGd76c654d02b6: [HLSL] remove unnecessary abs attributes (authored by bob80905, committed by beanz). Repository: rG LLVM Github Monorepo CHANGES SI

[PATCH] D134312: [HLSL] remove unnecessary abs attributes

2022-09-20 Thread Chris Bieneman via Phabricator via cfe-commits
beanz accepted this revision. beanz added a comment. This revision is now accepted and ready to land. Doh... I should have caught this before I pushed your last change. Thanks! Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D134312/new/ https://revie

[PATCH] D134304: [Docs] [HLSL] Add IR reference for HLSL

2022-09-20 Thread Chris Bieneman via Phabricator via cfe-commits
beanz added inline comments. Comment at: clang/docs/HLSL/HLSLIRReference.rst:20 + +The ``hlsl.uavs`` metadata is a list of all the global variables that represent +to UAV resources. python3kgae wrote: > Maybe only external global variables? > Do they have to be

[PATCH] D132711: [HLSL] add sqrt library function

2022-09-20 Thread Chris Bieneman via Phabricator via cfe-commits
This revision was landed with ongoing or failed builds. This revision was automatically updated to reflect the committed changes. Closed by commit rGb95c57444a8a: [HLSL] add sqrt library function (authored by bob80905, committed by beanz). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST

[PATCH] D134304: [Docs] [HLSL] Add IR reference for HLSL

2022-09-20 Thread Chris Bieneman via Phabricator via cfe-commits
beanz added inline comments. Comment at: clang/docs/HLSL/HLSLIRReference.rst:12 +The goal of this document is to provide a reference for all the special purpose +IR metadata and attributes used by the HLSL code generation path. + python3kgae wrote: > Once we docu

[PATCH] D132421: [HLSL] Support PCH for cc1 mode

2022-09-20 Thread Chris Bieneman via Phabricator via cfe-commits
beanz accepted this revision. beanz added a comment. This revision is now accepted and ready to land. One small nit, otherwise looks good. Comment at: clang/include/clang/Sema/HLSLExternalSemaSource.h:18 #include "clang/Sema/ExternalSemaSource.h" +#include "clang/Sema/Multiple

[PATCH] D134304: [Docs] [HLSL] Add IR reference for HLSL

2022-09-20 Thread Chris Bieneman via Phabricator via cfe-commits
beanz created this revision. beanz added reviewers: pow2clk, python3kgae. Herald added a subscriber: Anastasia. Herald added a project: All. beanz requested review of this revision. Herald added a project: clang. HLSL uses a variety of named IR metadata and attributes to convey additional informat

[PATCH] D132711: [HLSL] add sqrt library function

2022-09-20 Thread Chris Bieneman via Phabricator via cfe-commits
beanz accepted this revision. beanz added a comment. This revision is now accepted and ready to land. LGTM Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D132711/new/ https://reviews.llvm.org/D132711 ___ c

[PATCH] D133958: [HLSL] Pass flags to cc1 based on language

2022-09-20 Thread Chris Bieneman via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rG0c89b343371f: [HLSL] Pass flags to cc1 based on language (authored by beanz). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D133958/new/ https://reviews.llvm

[PATCH] D133993: [HLSL] Remove global ctor/dtor variable for non-lib profile.

2022-09-19 Thread Chris Bieneman via Phabricator via cfe-commits
beanz added a comment. We should also have a library test case that verifies that the `global_dtors` variable is kept. Comment at: clang/lib/CodeGen/CGHLSLRuntime.h:50 void annotateHLSLResource(const VarDecl *D, llvm::GlobalVariable *GV); - void generateGlobalCtorDtorCalls

[PATCH] D134067: [HLSL] Enable availability attribute

2022-09-16 Thread Chris Bieneman via Phabricator via cfe-commits
This revision was landed with ongoing or failed builds. This revision was automatically updated to reflect the committed changes. Closed by commit rG10378c45055f: [HLSL] Enable availability attribute (authored by beanz). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://r

[PATCH] D134067: [HLSL] Enable availability attribute

2022-09-16 Thread Chris Bieneman via Phabricator via cfe-commits
beanz updated this revision to Diff 460879. beanz added a comment. Updating test cases to use labels and sort the matches. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D134067/new/ https://reviews.llvm.org/D134067 Files: clang/include/clang/Basi

[PATCH] D134067: [HLSL] Enable availability attribute

2022-09-16 Thread Chris Bieneman via Phabricator via cfe-commits
beanz added inline comments. Comment at: clang/test/SemaHLSL/AvailabilityMarkup.hlsl:15 +void fn() { +// expected-warning@+2 {{'fn6_0' is only available on HLSL ShaderModel 6.0 or newer}} +// expected-note@+1 {{enclose 'fn6_0' in a __builtin_available check to silence t

[PATCH] D134067: [HLSL] Enable availability attribute

2022-09-16 Thread Chris Bieneman via Phabricator via cfe-commits
beanz updated this revision to Diff 460869. beanz added a comment. Updating based on feedback from @erichkeane. Thank you for the fast feedback! - Moved ShaderModel check into a switch case. - Added additional self-contained test case with more variations. Repository: rG LLVM Github Monorepo

[PATCH] D134067: [HLSL] Enable availability attribute

2022-09-16 Thread Chris Bieneman via Phabricator via cfe-commits
beanz created this revision. beanz added reviewers: MaskRay, erichkeane, rnk, arphaman, python3kgae, pow2clk, tex3d. Herald added a reviewer: aaron.ballman. Herald added subscribers: Anastasia, StephenFan. Herald added a project: All. beanz requested review of this revision. Herald added a project

[PATCH] D128462: [HLSL] add -I option for dxc mode.

2022-09-16 Thread Chris Bieneman via Phabricator via cfe-commits
beanz added a comment. I understand your frustration with the regression, but let’s try to constructive. We all care about quality and we’re all working hard to do the best we can. In D128462#3794868 , @kadircet wrote: > My main complaint here's around

[PATCH] D128462: [HLSL] add -I option for dxc mode.

2022-09-15 Thread Chris Bieneman via Phabricator via cfe-commits
beanz added a comment. I think we had no expectation that DXC-mode would be supported by the tooling APIs at this point. For context, DXC is the HLSL compiler that is based on clang-3.7. The DXC mode provides interface compatibility with it. DXC doesn't work with any of the clang tooling infra

  1   2   3   4   5   6   >