[clang] [llvm] [SPIRV][RFC] Rework / extend support for memory scopes (PR #106429)

2024-09-06 Thread Vyacheslav Levytskyy via cfe-commits
VyacheslavLevytskyy wrote: Thank you for the PR! I'd like to better understand motivation and justification of SPIR-V BE-related changes though. The goal would be to understand whether AllSvmDevices is indeed a better choice (for whom?) than Device as a default mem scope value in SPIR-V BE.

[clang] [llvm] [SPIR-V] Add SPIR-V structurizer (PR #107408)

2024-09-11 Thread Vyacheslav Levytskyy via cfe-commits
Nathan =?utf-8?q?Gauër?= , Nathan =?utf-8?q?Gauër?= , Nathan =?utf-8?q?Gauër?= , Nathan =?utf-8?q?Gauër?= , Nathan =?utf-8?q?Gauër?= , Nathan =?utf-8?q?Gauër?= , Nathan =?utf-8?q?Gauër?= , Nathan =?utf-8?q?Gauër?= , Nathan =?utf-8?q?Gauër?= , Nathan =?utf-8?q?Gauër?= Message-ID: In-Reply-To: ==

[clang] [llvm] [SPIR-V] Add SPIR-V structurizer (PR #107408)

2024-09-11 Thread Vyacheslav Levytskyy via cfe-commits
Nathan =?utf-8?q?Gauër?= , Nathan =?utf-8?q?Gauër?= , Nathan =?utf-8?q?Gauër?= , Nathan =?utf-8?q?Gauër?= , Nathan =?utf-8?q?Gauër?= , Nathan =?utf-8?q?Gauër?= , Nathan =?utf-8?q?Gauër?= , Nathan =?utf-8?q?Gauër?= , Nathan =?utf-8?q?Gauër?= , Nathan =?utf-8?q?Gauër?= Message-ID: In-Reply-To: ht

[clang] [llvm] [SPIRV][RFC] Rework / extend support for memory scopes (PR #106429)

2024-09-11 Thread Vyacheslav Levytskyy via cfe-commits
VyacheslavLevytskyy wrote: Thank you @AlexVlx for answering some of my questions. It was exactly my point in the comment that clang is not the only available FE and SPIRV BE should remain agnostic towards vendors, frameworks, etc., so it's nice to be on the same page wrt. vendor-specific choic

[clang] [llvm] [SPIR-V] Add SPIR-V structurizer (PR #107408)

2024-09-11 Thread Vyacheslav Levytskyy via cfe-commits
Nathan =?utf-8?q?Gauër?= , Nathan =?utf-8?q?Gauër?= , Nathan =?utf-8?q?Gauër?= , Nathan =?utf-8?q?Gauër?= , Nathan =?utf-8?q?Gauër?= , Nathan =?utf-8?q?Gauër?= , Nathan =?utf-8?q?Gauër?= , Nathan =?utf-8?q?Gauër?= , Nathan =?utf-8?q?Gauër?= , Nathan =?utf-8?q?Gauër?= Message-ID: In-Reply-To: Vy

[clang] [llvm] [SPIR-V] Add SPIR-V structurizer (PR #107408)

2024-09-11 Thread Vyacheslav Levytskyy via cfe-commits
Nathan =?utf-8?q?Gauër?= , Nathan =?utf-8?q?Gauër?= , Nathan =?utf-8?q?Gauër?= , Nathan =?utf-8?q?Gauër?= , Nathan =?utf-8?q?Gauër?= , Nathan =?utf-8?q?Gauër?= , Nathan =?utf-8?q?Gauër?= , Nathan =?utf-8?q?Gauër?= , Nathan =?utf-8?q?Gauër?= , Nathan =?utf-8?q?Gauër?= Message-ID: In-Reply-To: ==

[clang] [llvm] [SPIR-V] Add SPIR-V structurizer (PR #107408)

2024-09-11 Thread Vyacheslav Levytskyy via cfe-commits
Nathan =?utf-8?q?Gauër?= , Nathan =?utf-8?q?Gauër?= , Nathan =?utf-8?q?Gauër?= , Nathan =?utf-8?q?Gauër?= , Nathan =?utf-8?q?Gauër?= , Nathan =?utf-8?q?Gauër?= , Nathan =?utf-8?q?Gauër?= , Nathan =?utf-8?q?Gauër?= , Nathan =?utf-8?q?Gauër?= , Nathan =?utf-8?q?Gauër?= Message-ID: In-Reply-To: ht

[clang] [llvm] [SPIR-V] Add SPIR-V structurizer (PR #107408)

2024-09-11 Thread Vyacheslav Levytskyy via cfe-commits
Nathan =?utf-8?q?Gauër?= , Nathan =?utf-8?q?Gauër?= , Nathan =?utf-8?q?Gauër?= , Nathan =?utf-8?q?Gauër?= , Nathan =?utf-8?q?Gauër?= , Nathan =?utf-8?q?Gauër?= , Nathan =?utf-8?q?Gauër?= , Nathan =?utf-8?q?Gauër?= , Nathan =?utf-8?q?Gauër?= , Nathan =?utf-8?q?Gauër?= Message-ID: In-Reply-To: ht

[clang] [llvm] [SPIR-V] Add SPIR-V structurizer (PR #107408)

2024-09-11 Thread Vyacheslav Levytskyy via cfe-commits
Nathan =?utf-8?q?Gauër?= , Nathan =?utf-8?q?Gauër?= , Nathan =?utf-8?q?Gauër?= , Nathan =?utf-8?q?Gauër?= , Nathan =?utf-8?q?Gauër?= , Nathan =?utf-8?q?Gauër?= , Nathan =?utf-8?q?Gauër?= , Nathan =?utf-8?q?Gauër?= , Nathan =?utf-8?q?Gauër?= , Nathan =?utf-8?q?Gauër?= Message-ID: In-Reply-To: Vy

[clang] [llvm] [SPIR-V] Add SPIR-V structurizer (PR #107408)

2024-09-11 Thread Vyacheslav Levytskyy via cfe-commits
Nathan =?utf-8?q?Gau=C3=ABr?= , Nathan =?utf-8?q?Gau=C3=ABr?= , Nathan =?utf-8?q?Gau=C3=ABr?= , Nathan =?utf-8?q?Gau=C3=ABr?= , Nathan =?utf-8?q?Gau=C3=ABr?= , Nathan =?utf-8?q?Gau=C3=ABr?= , Nathan =?utf-8?q?Gau=C3=ABr?= , Nathan =?utf-8?q?Gau=C3=ABr?= , Nathan =?utf-8?q?Gau=C3=ABr?= , Nathan =?ut

[clang] [llvm] [HLSL][DXIL][SPIRV] Create llvm dot intrinsic and use for HLSL (PR #102872)

2024-08-13 Thread Vyacheslav Levytskyy via cfe-commits
@@ -380,6 +383,20 @@ bool SPIRVInstructionSelector::spvSelect(Register ResVReg, MIB.addImm(V); return MIB.constrainAllUses(TII, TRI, RBI); } + + case TargetOpcode::G_FDOTPROD: { +MachineBasicBlock &BB = *I.getParent(); +return BuildMI(BB, I, I.getDebugLoc()

[clang] [llvm] [HLSL][SPIRV] Add any intrinsic lowering (PR #88325)

2024-04-12 Thread Vyacheslav Levytskyy via cfe-commits
https://github.com/VyacheslavLevytskyy approved this pull request. https://github.com/llvm/llvm-project/pull/88325 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [clang][SPIR-V] Add support for AMDGCN flavoured SPIRV (PR #89796)

2024-06-06 Thread Vyacheslav Levytskyy via cfe-commits
@@ -114,15 +118,17 @@ Example: ``-target spirv64v1.0`` can be used to compile for SPIR-V version 1.0 with 64-bit pointer width. +``-target spirv64-amd-amdhsa`` can be used to compile for AMDGCN flavoured SPIR-V version 1.6 with 64-bit pointer width Vyachesl

[clang] [llvm] [clang][SPIR-V] Add support for AMDGCN flavoured SPIRV (PR #89796)

2024-06-06 Thread Vyacheslav Levytskyy via cfe-commits
@@ -0,0 +1,35 @@ +; RUN: llc -O0 -mtriple=spirv64-amd-amdhsa --spirv-ext=+SPV_INTEL_function_pointers %s -o - | FileCheck %s +; TODO: %if spirv-tools %{ llc -O0 -mtriple=spirv64-amd-amdhsa %s -o - -filetype=obj | spirv-val %} + +; CHECK-DAG: OpCapability Int8 +; CHECK-DAG: OpCap

[clang] [llvm] [clang][SPIR-V] Add support for AMDGCN flavoured SPIRV (PR #89796)

2024-06-06 Thread Vyacheslav Levytskyy via cfe-commits
@@ -0,0 +1,35 @@ +; RUN: llc -O0 -mtriple=spirv64-amd-amdhsa --spirv-ext=+SPV_INTEL_function_pointers %s -o - | FileCheck %s +; TODO: %if spirv-tools %{ llc -O0 -mtriple=spirv64-amd-amdhsa %s -o - -filetype=obj | spirv-val %} + +; CHECK-DAG: OpCapability Int8 +; CHECK-DAG: OpCap

[clang] [llvm] [clang][SPIR-V] Add support for AMDGCN flavoured SPIRV (PR #89796)

2024-06-06 Thread Vyacheslav Levytskyy via cfe-commits
@@ -0,0 +1,35 @@ +; RUN: llc -O0 -mtriple=spirv64-amd-amdhsa --spirv-ext=+SPV_INTEL_function_pointers %s -o - | FileCheck %s +; TODO: %if spirv-tools %{ llc -O0 -mtriple=spirv64-amd-amdhsa %s -o - -filetype=obj | spirv-val %} + +; CHECK-DAG: OpCapability Int8 +; CHECK-DAG: OpCap

[clang] [llvm] [clang][SPIR-V] Add support for AMDGCN flavoured SPIRV (PR #89796)

2024-06-06 Thread Vyacheslav Levytskyy via cfe-commits
https://github.com/VyacheslavLevytskyy approved this pull request. LGTM, thank you https://github.com/llvm/llvm-project/pull/89796 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [flang] [libcxx] [llvm] [mlir] [SPIR-V] Introduce support of llvm.ptr.annotation to SPIR-V Backend and implement extensions which make use of spirv.Decorations (PR #93479)

2024-05-28 Thread Vyacheslav Levytskyy via cfe-commits
Stefan =?utf-8?q?Gränitz?= ,Shengchen Kan ,David Green ,josel-amd <166385423+josel-...@users.noreply.github.com>,Matt Arsenault ,Kelvin Li ,Artem Kroviakov <71938912+akrovia...@users.noreply.github.com>,Benjamin Kramer ,Shengchen Kan ,Nico Weber ,Tom Eccles ,Sayan Saha ,Aaron Ballman ,Tyker

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

2024-04-18 Thread Vyacheslav Levytskyy via cfe-commits
@@ -58,4 +58,6 @@ let TargetPrefix = "spv" in { Intrinsic<[ llvm_ptr_ty ], [llvm_i8_ty], [IntrWillReturn]>; def int_spv_all : DefaultAttrsIntrinsic<[llvm_i1_ty], [llvm_any_ty]>; def int_spv_any : DefaultAttrsIntrinsic<[llvm_i1_ty], [llvm_any_ty]>; + def int_spv_lerp

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

2024-04-18 Thread Vyacheslav Levytskyy via cfe-commits
VyacheslavLevytskyy wrote: LGTM, just one question about documentation 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] [SPIRV][HLSL] map lerp to Fmix (PR #88976)

2024-04-18 Thread Vyacheslav Levytskyy via cfe-commits
https://github.com/VyacheslavLevytskyy approved this pull request. 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] [SPIRV][HLSL] Add mad intrinsic lowering for spirv (PR #89130)

2024-04-18 Thread Vyacheslav Levytskyy via cfe-commits
https://github.com/VyacheslavLevytskyy approved this pull request. https://github.com/llvm/llvm-project/pull/89130 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][CodeGen][SPIR-V][AMDGPU] Tweak AMDGCNSPIRV ABI to allow for the correct handling of aggregates passed to kernels / functions. (PR #102776)

2024-08-20 Thread Vyacheslav Levytskyy via cfe-commits
VyacheslavLevytskyy wrote: > @VyacheslavLevytskyy @michalpaszkowski any objections / thoughts on this? Thank you for pinging me. I have no objections and no valuable advices wrt. this particular subject. https://github.com/llvm/llvm-project/pull/102776 _

[clang] [llvm] [SPIR-V] Add SPIR-V structurizer (PR #107408)

2024-09-12 Thread Vyacheslav Levytskyy via cfe-commits
Nathan =?utf-8?q?Gauër?= , Nathan =?utf-8?q?Gauër?= , Nathan =?utf-8?q?Gauër?= , Nathan =?utf-8?q?Gauër?= , Nathan =?utf-8?q?Gauër?= , Nathan =?utf-8?q?Gauër?= , Nathan =?utf-8?q?Gauër?= , Nathan =?utf-8?q?Gauër?= , Nathan =?utf-8?q?Gauër?= , Nathan =?utf-8?q?Gauër?= Message-ID: In-Reply-To: Vy

[clang] [llvm] [SPIR-V] Add SPIR-V structurizer (PR #107408)

2024-09-12 Thread Vyacheslav Levytskyy via cfe-commits
Nathan =?utf-8?q?Gauër?= , Nathan =?utf-8?q?Gauër?= , Nathan =?utf-8?q?Gauër?= , Nathan =?utf-8?q?Gauër?= , Nathan =?utf-8?q?Gauër?= , Nathan =?utf-8?q?Gauër?= , Nathan =?utf-8?q?Gauër?= , Nathan =?utf-8?q?Gauër?= , Nathan =?utf-8?q?Gauër?= , Nathan =?utf-8?q?Gauër?= Message-ID: In-Reply-To: Vy

[clang] [llvm] [SPIRV][RFC] Rework / extend support for memory scopes (PR #106429)

2024-09-13 Thread Vyacheslav Levytskyy via cfe-commits
@@ -58,7 +58,35 @@ class SPIRVTargetCodeGenInfo : public CommonSPIRTargetCodeGenInfo { SPIRVTargetCodeGenInfo(CodeGen::CodeGenTypes &CGT) : CommonSPIRTargetCodeGenInfo(std::make_unique(CGT)) {} void setCUDAKernelCallingConvention(const FunctionType *&FT) const overri

[clang] [llvm] [SPIRV][RFC] Rework / extend support for memory scopes (PR #106429)

2024-09-13 Thread Vyacheslav Levytskyy via cfe-commits
VyacheslavLevytskyy wrote: With the full respect to @AlexVlx work I created https://github.com/llvm/llvm-project/pull/108528 just as an utility to discuss and agree about memory scoped issues. https://github.com/llvm/llvm-project/pull/106429 ___ cfe-

[clang] [llvm] [SPIRV][RFC] Rework / extend support for memory scopes (PR #106429)

2024-09-16 Thread Vyacheslav Levytskyy via cfe-commits
@@ -33,7 +33,8 @@ #include "llvm/Support/Debug.h" namespace { VyacheslavLevytskyy wrote: @AlexVlx Let's remove all references to `struct SyncScopeIDs` from the whole `SPIRVInstructionSelector.cpp` module. We will insert `getOrInsertSyncScopeID()` in the `ge

[clang] [llvm] [SPIRV][RFC] Rework / extend support for memory scopes (PR #106429)

2024-09-16 Thread Vyacheslav Levytskyy via cfe-commits
@@ -251,6 +251,24 @@ SPIRV::MemorySemantics::MemorySemantics getMemSemantics(AtomicOrdering Ord) { llvm_unreachable(nullptr); } +SPIRV::Scope::Scope getMemScope(const LLVMContext &Ctx, SyncScope::ID ID) { VyacheslavLevytskyy wrote: @AlexVlx If you don't mi

[clang] [llvm] [SPIRV][RFC] Rework / extend support for memory scopes (PR #106429)

2024-09-16 Thread Vyacheslav Levytskyy via cfe-commits
@@ -251,6 +251,24 @@ SPIRV::MemorySemantics::MemorySemantics getMemSemantics(AtomicOrdering Ord) { llvm_unreachable(nullptr); } +SPIRV::Scope::Scope getMemScope(const LLVMContext &Ctx, SyncScope::ID ID) { VyacheslavLevytskyy wrote: I'd say that removal of

[clang] [llvm] [SPIRV][RFC] Rework / extend support for memory scopes (PR #106429)

2024-09-16 Thread Vyacheslav Levytskyy via cfe-commits
@@ -75,6 +75,8 @@ getMemSemanticsForStorageClass(SPIRV::StorageClass::StorageClass SC); SPIRV::MemorySemantics::MemorySemantics getMemSemantics(AtomicOrdering Ord); +SPIRV::Scope::Scope getMemScope(const LLVMContext &Ctx, SyncScope::ID ID); VyacheslavLevytsk

[clang] [llvm] [SPIRV][RFC] Rework / extend support for memory scopes (PR #106429)

2024-09-16 Thread Vyacheslav Levytskyy via cfe-commits
VyacheslavLevytskyy wrote: @AlexVlx I don't see much objections against https://github.com/llvm/llvm-project/pull/108528 on a conceptual level, so what do you think about merging it into this PR in a way that I commented above, by changing getmemScope() and moving init into its static vars? h

[clang] [llvm] [SPIRV][RFC] Rework / extend support for memory scopes (PR #106429)

2024-09-16 Thread Vyacheslav Levytskyy via cfe-commits
VyacheslavLevytskyy wrote: > > @AlexVlx I don't see much objections against #108528 on a conceptual level, > > so what do you think about merging it into this PR in a way that I > > commented above, by changing `getMemScope()` and moving > > `getOrInsertSyncScopeID()` into its static vars init

[clang] [llvm] [clang][llvm][SPIR-V] Explicitly encode native integer widths for SPIR-V (PR #110695)

2024-10-08 Thread Vyacheslav Levytskyy via cfe-commits
@@ -1,12 +1,14 @@ ; This test aims to check ability to support "Arithmetic with Overflow" intrinsics ; in the special case when those intrinsics are being generated by the CodeGenPrepare; -; pass during translations with optimization (note -O3 in llc arguments). +; pass during

[clang] [llvm] [clang][llvm][SPIR-V] Explicitly encode native integer widths for SPIR-V (PR #110695)

2024-10-10 Thread Vyacheslav Levytskyy via cfe-commits
@@ -1,12 +1,14 @@ ; This test aims to check ability to support "Arithmetic with Overflow" intrinsics ; in the special case when those intrinsics are being generated by the CodeGenPrepare; -; pass during translations with optimization (note -O3 in llc arguments). +; pass during

[clang] [llvm] [clang][llvm][SPIR-V] Explicitly encode native integer widths for SPIR-V (PR #110695)

2024-10-11 Thread Vyacheslav Levytskyy via cfe-commits
@@ -1,12 +1,14 @@ ; This test aims to check ability to support "Arithmetic with Overflow" intrinsics ; in the special case when those intrinsics are being generated by the CodeGenPrepare; -; pass during translations with optimization (note -O3 in llc arguments). +; pass during

[clang] [llvm] [clang][llvm][SPIR-V] Explicitly encode native integer widths for SPIR-V (PR #110695)

2024-11-05 Thread Vyacheslav Levytskyy via cfe-commits
https://github.com/VyacheslavLevytskyy approved this pull request. Thanks, sorry for the delay https://github.com/llvm/llvm-project/pull/110695 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-

[clang] [llvm] [HLSL][SPIRV][DXIL] Implement `dot4add_i8packed` intrinsic (PR #113623)

2024-11-05 Thread Vyacheslav Levytskyy via cfe-commits
VyacheslavLevytskyy wrote: Thank you @inbelic , @s-perron , @dneto0 , it makes sense to me. https://github.com/llvm/llvm-project/pull/113623 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-com

[clang] [llvm] [HLSL][SPIRV][DXIL] Implement `dot4add_i8packed` intrinsic (PR #113623)

2024-11-05 Thread Vyacheslav Levytskyy via cfe-commits
https://github.com/VyacheslavLevytskyy approved this pull request. https://github.com/llvm/llvm-project/pull/113623 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [HLSL] implement elementwise firstbithigh hlsl builtin (PR #111082)

2024-11-05 Thread Vyacheslav Levytskyy via cfe-commits
@@ -0,0 +1,107 @@ +; RUN: llc -verify-machineinstrs -O0 -mtriple=spirv-unknown-unknown %s -o - | FileCheck %s +; RUN: %if spirv-tools %{ llc -O0 -mtriple=spirv-unknown-unknown %s -o - -filetype=obj | spirv-val %} + +; CHECK: OpMemoryModel Logical GLSL450 +; CHECK: [[Z:%.*]] = Op

[clang] [llvm] [HLSL] implement elementwise firstbithigh hlsl builtin (PR #111082)

2024-11-05 Thread Vyacheslav Levytskyy via cfe-commits
https://github.com/VyacheslavLevytskyy approved this pull request. https://github.com/llvm/llvm-project/pull/111082 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][CodeGen][SPIR-V] Fix incorrect SYCL usage, implement missing interface (PR #109415)

2024-09-23 Thread Vyacheslav Levytskyy via cfe-commits
VyacheslavLevytskyy wrote: @asudarsa Can you please have a look? https://github.com/llvm/llvm-project/pull/109415 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [SPIRV][RFC] Rework / extend support for memory scopes (PR #106429)

2024-09-24 Thread Vyacheslav Levytskyy via cfe-commits
https://github.com/VyacheslavLevytskyy approved this pull request. https://github.com/llvm/llvm-project/pull/106429 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [SPIRV][RFC] Rework / extend support for memory scopes (PR #106429)

2024-09-20 Thread Vyacheslav Levytskyy via cfe-commits
@@ -1,7 +1,7 @@ ; RUN: llc -O0 -mtriple=spirv32-unknown-unknown %s -o - | FileCheck %s --check-prefix=CHECK-SPIRV ; CHECK-SPIRV: %[[#Int:]] = OpTypeInt 32 0 -; CHECK-SPIRV-DAG: %[[#MemScope_Device:]] = OpConstant %[[#Int]] 1 +; CHECK-SPIRV-DAG: %[[#MemScope_AllSvmDevic

[clang] [llvm] [SPIRV][RFC] Rework / extend support for memory scopes (PR #106429)

2024-09-20 Thread Vyacheslav Levytskyy via cfe-commits
@@ -5,8 +5,8 @@ ; RUN: %if spirv-tools %{ llc -O0 -mtriple=spirv32-unknown-unknown %s -o - -filetype=obj | spirv-val %} ; CHECK: %[[#Int:]] = OpTypeInt 32 0 -; CHECK-DAG: %[[#Scope_Device:]] = OpConstant %[[#Int]] 1{{$}} -; CHECK-DAG: %[[#MemSem_Relaxed:]] = OpConstant %[

[clang] [llvm] [SPIRV][RFC] Rework / extend support for memory scopes (PR #106429)

2024-09-20 Thread Vyacheslav Levytskyy via cfe-commits
https://github.com/VyacheslavLevytskyy edited https://github.com/llvm/llvm-project/pull/106429 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [SPIRV][RFC] Rework / extend support for memory scopes (PR #106429)

2024-09-20 Thread Vyacheslav Levytskyy via cfe-commits
@@ -0,0 +1,163 @@ +; RUN: llc -verify-machineinstrs -O0 -mtriple=spirv64-unknown-unknown %s -o - | FileCheck %s +; RUN: %if spirv-tools %{ llc -O0 -mtriple=spirv64-unknown-unknown %s -o - -filetype=obj | spirv-val %} + +; RUN: llc -verify-machineinstrs -O0 -mtriple=spirv32-unkno

[clang] [llvm] [SPIRV][RFC] Rework / extend support for memory scopes (PR #106429)

2024-09-20 Thread Vyacheslav Levytskyy via cfe-commits
@@ -766,8 +766,19 @@ static void EmitAtomicOp(CodeGenFunction &CGF, AtomicExpr *Expr, Address Dest, // LLVM atomic instructions always have synch scope. If clang atomic // expression has no scope operand, use default LLVM synch scope. if (!ScopeModel) { +llvm::SyncSc

[clang] [llvm] [SPIRV][RFC] Rework / extend support for memory scopes (PR #106429)

2024-09-20 Thread Vyacheslav Levytskyy via cfe-commits
@@ -251,6 +251,24 @@ SPIRV::MemorySemantics::MemorySemantics getMemSemantics(AtomicOrdering Ord) { llvm_unreachable(nullptr); } +SPIRV::Scope::Scope getMemScope(const LLVMContext &Ctx, SyncScope::ID ID) { VyacheslavLevytskyy wrote: No problems, I'm quite h

[clang] [llvm] [SPIRV][RFC] Rework / extend support for memory scopes (PR #106429)

2024-09-20 Thread Vyacheslav Levytskyy via cfe-commits
@@ -58,7 +58,35 @@ class SPIRVTargetCodeGenInfo : public CommonSPIRTargetCodeGenInfo { SPIRVTargetCodeGenInfo(CodeGen::CodeGenTypes &CGT) : CommonSPIRTargetCodeGenInfo(std::make_unique(CGT)) {} void setCUDAKernelCallingConvention(const FunctionType *&FT) const overri

[clang] [llvm] [clang][llvm][SPIR-V] Explicitly encode native integer widths for SPIR-V (PR #110695)

2024-10-01 Thread Vyacheslav Levytskyy via cfe-commits
@@ -1,56 +0,0 @@ -; This test aims to check ability to support "Arithmetic with Overflow" intrinsics VyacheslavLevytskyy wrote: @AlexVlx I'm strongly against deleting this test case. https://github.com/llvm/llvm-project/pull/110695 _

[clang] [llvm] [clang][llvm][SPIR-V] Explicitly encode native integer widths for SPIR-V (PR #110695)

2024-10-01 Thread Vyacheslav Levytskyy via cfe-commits
@@ -1,56 +0,0 @@ -; This test aims to check ability to support "Arithmetic with Overflow" intrinsics VyacheslavLevytskyy wrote: The main objection is that the code base should switch from one stable state to another, without losing current coverage, stability,

[clang] [clang][CodeGen][SPIR-V] Fix incorrect SYCL usage, implement missing interface (PR #109415)

2024-09-25 Thread Vyacheslav Levytskyy via cfe-commits
https://github.com/VyacheslavLevytskyy approved this pull request. https://github.com/llvm/llvm-project/pull/109415 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [SPIR-V] Add SPIR-V structurizer (PR #107408)

2024-09-17 Thread Vyacheslav Levytskyy via cfe-commits
Nathan =?utf-8?q?Gauër?= , Nathan =?utf-8?q?Gauër?= , Nathan =?utf-8?q?Gauër?= , Nathan =?utf-8?q?Gauër?= , Nathan =?utf-8?q?Gauër?= , Nathan =?utf-8?q?Gauër?= , Nathan =?utf-8?q?Gauër?= , Nathan =?utf-8?q?Gauër?= , Nathan =?utf-8?q?Gauër?= , Nathan =?utf-8?q?Gauër?= , Nathan =?utf-8?q?Gauër?= , Na

[clang] [llvm] [SPIR-V] Add SPIR-V structurizer (PR #107408)

2024-09-17 Thread Vyacheslav Levytskyy via cfe-commits
Nathan =?utf-8?q?Gauër?= , Nathan =?utf-8?q?Gauër?= , Nathan =?utf-8?q?Gauër?= , Nathan =?utf-8?q?Gauër?= , Nathan =?utf-8?q?Gauër?= , Nathan =?utf-8?q?Gauër?= , Nathan =?utf-8?q?Gauër?= , Nathan =?utf-8?q?Gauër?= , Nathan =?utf-8?q?Gauër?= , Nathan =?utf-8?q?Gauër?= , Nathan =?utf-8?q?Gauër?= , Na

[clang] [llvm] [SPIR-V] Add SPIR-V structurizer (PR #107408)

2024-09-17 Thread Vyacheslav Levytskyy via cfe-commits
Nathan =?utf-8?q?Gau=C3=ABr?= , Nathan =?utf-8?q?Gau=C3=ABr?= , Nathan =?utf-8?q?Gau=C3=ABr?= , Nathan =?utf-8?q?Gau=C3=ABr?= , Nathan =?utf-8?q?Gau=C3=ABr?= , Nathan =?utf-8?q?Gau=C3=ABr?= , Nathan =?utf-8?q?Gau=C3=ABr?= , Nathan =?utf-8?q?Gau=C3=ABr?= , Nathan =?utf-8?q?Gau=C3=ABr?= , Nathan =?ut

[clang] [llvm] [SPIR-V] Fixup storage class for global private (PR #116636)

2024-12-02 Thread Vyacheslav Levytskyy via cfe-commits
Nathan =?utf-8?q?Gau=C3=ABr?= Message-ID: In-Reply-To: https://github.com/VyacheslavLevytskyy approved this pull request. https://github.com/llvm/llvm-project/pull/116636 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org

[clang] [llvm] [SPIRV] Add Target Builtins using Distance ext as an example (PR #121598)

2025-01-07 Thread Vyacheslav Levytskyy via cfe-commits
@@ -6757,6 +6757,8 @@ static Value *EmitTargetArchBuiltinExpr(CodeGenFunction *CGF, case llvm::Triple::riscv32: case llvm::Triple::riscv64: return CGF->EmitRISCVBuiltinExpr(BuiltinID, E, ReturnValue); + case llvm::Triple::spirv: +return CGF->EmitSPIRVBuiltinExpr(B

[clang] [llvm] [SPIRV] add pre legalization instruction combine (PR #122839)

2025-01-16 Thread Vyacheslav Levytskyy via cfe-commits
VyacheslavLevytskyy wrote: > > I see also some problems in test cases > > @VyacheslavLevytskyy the SPIRV test case failures are not related to my > change. They are also failing on main. I will check now. For one the reason is clear, https://github.com/llvm/llvm-project/pull/123191 https://g

[clang] [llvm] [SPIRV] add pre legalization instruction combine (PR #122839)

2025-01-16 Thread Vyacheslav Levytskyy via cfe-commits
VyacheslavLevytskyy wrote: > > > I see also some problems in test cases > > > > > > @VyacheslavLevytskyy the SPIRV test case failures are not related to my > > change. They are also failing on main. > > I will check now. For one the reason is clear, #123191 I can't reproduce two other fails

[clang] [llvm] [SPIRV] add pre legalization instruction combine (PR #122839)

2025-01-16 Thread Vyacheslav Levytskyy via cfe-commits
VyacheslavLevytskyy wrote: @farzonl Thank you for adding instcombine/pattern matching capabilities. LGTM overall. Maybe we should also document each transformation a bit in comments to the corresponding function, so that we clearly see what kind of input we expect to see to run the substitutio

[clang] [llvm] [SPIRV] add pre legalization instruction combine (PR #122839)

2025-01-16 Thread Vyacheslav Levytskyy via cfe-commits
VyacheslavLevytskyy wrote: I see also some problems in test cases https://github.com/llvm/llvm-project/pull/122839 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [SPIRV] add pre legalization instruction combine (PR #122839)

2025-01-17 Thread Vyacheslav Levytskyy via cfe-commits
VyacheslavLevytskyy wrote: @farzonl Was enabled GISelCSEAnalysisWrapperPass a reason of problems with inline_asm? https://github.com/llvm/llvm-project/pull/122839 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/m

[clang] [llvm] [SPIRV] add pre legalization instruction combine (PR #122839)

2025-01-17 Thread Vyacheslav Levytskyy via cfe-commits
https://github.com/VyacheslavLevytskyy approved this pull request. https://github.com/llvm/llvm-project/pull/122839 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [SPIRV] add pre legalization instruction combine (PR #122839)

2025-01-17 Thread Vyacheslav Levytskyy via cfe-commits
@@ -1,33 +1,44 @@ -; RUN: llc -O0 -mtriple=spirv-unknown-unknown %s -o - | FileCheck %s -; RUN: %if spirv-tools %{ llc -O0 -mtriple=spirv-unknown-unknown %s -o - -filetype=obj | spirv-val %} - -; Make sure SPIRV operation function calls for distance are lowered correctly. - -; CH

[clang] [llvm] [SPIRV] add pre legalization instruction combine (PR #122839)

2025-01-17 Thread Vyacheslav Levytskyy via cfe-commits
@@ -0,0 +1,140 @@ +; RUN: llc -mtriple=spirv-unknown-unknown -debug-pass=Structure < %s -o /dev/null 2>&1 | \ VyacheslavLevytskyy wrote: Just as a thought aloud, I wonder how stable this list can be at this stage of SPIR-V Backend development? I guess this test

[clang] [llvm] [SPIRV] add pre legalization instruction combine (PR #122839)

2025-01-16 Thread Vyacheslav Levytskyy via cfe-commits
VyacheslavLevytskyy wrote: > I rebased and the tests are passing locally. but they are still failing in ci. It's the strange part. The thing is when I created a new https://github.com/llvm/llvm-project/pull/123191 today, I see all tests passing in CI before I press Merged. That's why I thought

[clang] [clang][SPIR-V] Use the SPIR-V backend by default (PR #129545)

2025-03-07 Thread Vyacheslav Levytskyy via cfe-commits
https://github.com/VyacheslavLevytskyy approved this pull request. https://github.com/llvm/llvm-project/pull/129545 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][SPIR-V] Use the SPIR-V backend by default (PR #129545)

2025-03-10 Thread Vyacheslav Levytskyy via cfe-commits
VyacheslavLevytskyy wrote: > LGTM, thanks! In what regards the translator use in the HIP Toolchain, from > the AMD side we're looking at transitioning to the BE as soon as possible, > but it will probably be some time until we have fully validated it. I'd gladly hear about priorities (and mayb

[clang] [SYCL][SPIR-V Backend][clang-sycl-linker] Add SPIR-V backend support inside clang-sycl-linker (PR #133967)

2025-04-02 Thread Vyacheslav Levytskyy via cfe-commits
https://github.com/VyacheslavLevytskyy approved this pull request. https://github.com/llvm/llvm-project/pull/133967 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits