[clang] [libc] [llvm] [AMDGPU] Use COV6 by default (PR #118515)

2024-12-03 Thread Shilei Tian via cfe-commits
shiltian wrote: The OpenMP failure has nothing to do with this PR. Please update ROCm to a version that supports COV6. https://github.com/llvm/llvm-project/pull/118515 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-

[clang] [llvm] [openmp] [OpenMP] Use generic IR for the OpenMP DeviceRTL (PR #119091)

2024-12-08 Thread Shilei Tian via cfe-commits
shiltian wrote: > The IR is a representation of what goes on a final .o. It is not really > intended to enable new features or make the program portable. My .02 is, it depends on how to think about it. If we eliminate the "unwanted" part (especially those that could potentially affect ABI) at

[clang] [llvm] [AMDGPU] Infer amdgpu-no-flat-scratch-init attribute in AMDGPUAttributor (PR #118907)

2024-12-05 Thread Shilei Tian via cfe-commits
shiltian wrote: Supposedly you can revert the revert to get the reapply. https://github.com/llvm/llvm-project/pull/118907 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [OpenMP] Use generic IR for the OpenMP DeviceRTL (PR #119091)

2024-12-07 Thread Shilei Tian via cfe-commits
shiltian wrote: Worth a bullet point in release note, both clang and openmp/offload. https://github.com/llvm/llvm-project/pull/119091 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [openmp] [OpenMP] Use generic IR for the OpenMP DeviceRTL (PR #119091)

2024-12-08 Thread Shilei Tian via cfe-commits
shiltian wrote: > This probably should retain separate wave32/wave64 builds. Additionally, > should have extension points for subtarget specific implementations Does wave32/wave64 affect the lowering from front end source code to middle end IR, if we don't use certain functions, such as wave l

[clang] [llvm] [OpenMP] Use generic IR for the OpenMP DeviceRTL (PR #119091)

2024-12-07 Thread Shilei Tian via cfe-commits
@@ -141,20 +109,21 @@ set(bc_flags -c -foffload-lto -std=c++17 -fvisibility=hidden # first create an object target add_library(omptarget.devicertl.all_objs OBJECT IMPORTED) -function(compileDeviceRTLLibrary target_cpu target_name target_triple) +function(compileDeviceRTLLibra

[clang] [llvm] [OpenMP] Use generic IR for the OpenMP DeviceRTL (PR #119091)

2024-12-07 Thread Shilei Tian via cfe-commits
@@ -141,20 +109,21 @@ set(bc_flags -c -foffload-lto -std=c++17 -fvisibility=hidden # first create an object target add_library(omptarget.devicertl.all_objs OBJECT IMPORTED) -function(compileDeviceRTLLibrary target_cpu target_name target_triple) +function(compileDeviceRTLLibra

[clang] [llvm] [OpenMP] Use generic IR for the OpenMP DeviceRTL (PR #119091)

2024-12-07 Thread Shilei Tian via cfe-commits
https://github.com/shiltian commented: I like this method, but just out of curiosity, did we use anything in AMDGPU implementation that has target dependent lowering in the front end? If not, this is totally fine I'd say. https://github.com/llvm/llvm-project/pull/119091 ___

[clang] [llvm] [OpenMP] Use generic IR for the OpenMP DeviceRTL (PR #119091)

2024-12-07 Thread Shilei Tian via cfe-commits
@@ -74,49 +72,53 @@ static int32_t nvptx_parallel_reduce_nowait(void *reduce_data, uint32_t NumThreads = omp_get_num_threads(); if (NumThreads == 1) return 1; -/* - * This reduce function handles reduction within a team. It handles - * parallel regions in b

[clang] [llvm] [openmp] [OpenMP] Use generic IR for the OpenMP DeviceRTL (PR #119091)

2024-12-07 Thread Shilei Tian via cfe-commits
https://github.com/shiltian approved this pull request. it seems like there are some test failures but I think the PR looks good https://github.com/llvm/llvm-project/pull/119091 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm

[clang] clang/AMDGPU: Set amdgpu-max-num-workgroups to disable Y/Z by default (PR #119009)

2024-12-07 Thread Shilei Tian via cfe-commits
shiltian wrote: > So this is wrong. It was correct for openmp. Even OpenMP is discussing to introduce multi-dim support, though in LLVM I already implemented it as an extension. :-) https://github.com/llvm/llvm-project/pull/119009 ___ cfe-commits mai

[clang] [llvm] [OpenMP] Use generic IR for the OpenMP DeviceRTL (PR #119091)

2024-12-07 Thread Shilei Tian via cfe-commits
shiltian wrote: > > I like this method, but just out of curiosity, did we use anything in > > AMDGPU implementation that has target dependent lowering in the front end? > > If not, this is totally fine I'd say. > > We used to use the `__AMDGCN_WAVEFRONT_SIZE` but that was removed for > unrela

[clang] [llvm] [Driver][SYCL] Add initial SYCL offload compilation support (PR #117268)

2025-01-06 Thread Shilei Tian via cfe-commits
shiltian wrote: This PR introduced a new compile warning when compiling using clang. Please fix it. ``` llvm-project/clang/lib/Driver/ToolChains/SYCL.cpp:35:10: warning: returning address of local temporary object [-Wreturn-stack-address] 35 | return { | ^ 36 | opt

[clang] [Clang] Remove 3-element vector load and store special handling (PR #104661)

2025-01-06 Thread Shilei Tian via cfe-commits
https://github.com/shiltian updated https://github.com/llvm/llvm-project/pull/104661 >From 76db8c65328736fae39bd6f7585f8274e9f34143 Mon Sep 17 00:00:00 2001 From: Shilei Tian Date: Tue, 17 Dec 2024 23:50:06 -0500 Subject: [PATCH] [Clang] Remove 3-element vector load and store special handling

[clang] [Clang] Remove 3-element vector load and store special handling (PR #104661)

2025-01-07 Thread Shilei Tian via cfe-commits
@@ -52,6 +52,12 @@ class AMDGPUABIInfo final : public DefaultABIInfo { void computeInfo(CGFunctionInfo &FI) const override; RValue EmitVAArg(CodeGenFunction &CGF, Address VAListAddr, QualType Ty, AggValueSlot Slot) const override; + + llvm::FixedVectorTy

[clang] [Clang] Remove 3-element vector load and store special handling (PR #104661)

2025-01-07 Thread Shilei Tian via cfe-commits
@@ -1,77 +0,0 @@ -// RUN: %clang_cc1 %s -emit-llvm -o - -triple spir-unknown-unknown -fpreserve-vec3-type | FileCheck %s - -typedef char char3 __attribute__((ext_vector_type(3))); shiltian wrote: The point of the test is for preserving vec3, as the name of the f

[clang] [Clang] Remove 3-element vector load and store special handling (PR #104661)

2025-01-07 Thread Shilei Tian via cfe-commits
@@ -94,43 +94,43 @@ typedef double __attribute__((ext_vector_type(16))) double16; // CHECK-LABEL: @local_memory_alignment_global( // CHECK: store volatile i8 0, ptr addrspace(3) @local_memory_alignment_global.lds_i8, align 1 // CHECK: store volatile <2 x i8> zeroinitializer,

[clang] [Clang] Remove 3-element vector load and store special handling (PR #104661)

2025-01-07 Thread Shilei Tian via cfe-commits
https://github.com/shiltian edited https://github.com/llvm/llvm-project/pull/104661 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] Remove 3-element vector load and store special handling (PR #104661)

2025-01-07 Thread Shilei Tian via cfe-commits
https://github.com/shiltian updated https://github.com/llvm/llvm-project/pull/104661 >From e4759cadf07aa883ca0d9ca8582dbd02fc028478 Mon Sep 17 00:00:00 2001 From: Shilei Tian Date: Tue, 7 Jan 2025 13:20:00 -0500 Subject: [PATCH] [Clang] Remove 3-element vector load and store special handling

[clang] [Clang] Remove 3-element vector load and store special handling (PR #104661)

2025-01-06 Thread Shilei Tian via cfe-commits
shiltian wrote: ping @arsenm @topperc https://github.com/llvm/llvm-project/pull/104661 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] Remove 3-element vector load and store special handling (PR #104661)

2024-12-29 Thread Shilei Tian via cfe-commits
https://github.com/shiltian updated https://github.com/llvm/llvm-project/pull/104661 >From 9dfb68ddc02bb70b3c9ff9d5aeedabbc2feed258 Mon Sep 17 00:00:00 2001 From: Shilei Tian Date: Tue, 17 Dec 2024 23:50:06 -0500 Subject: [PATCH] [Clang] Remove 3-element vector load and store special handling

[clang] 49331ab - [NFC][Clang] Auto generate check lines for `clang/test/CodeGenCXX/matrix-vector-bit-int.cpp`

2024-12-29 Thread Shilei Tian via cfe-commits
Author: Shilei Tian Date: 2024-12-29T22:28:14-05:00 New Revision: 49331ab0b9a41f925153fe03cd7e0d4a33b7c3d4 URL: https://github.com/llvm/llvm-project/commit/49331ab0b9a41f925153fe03cd7e0d4a33b7c3d4 DIFF: https://github.com/llvm/llvm-project/commit/49331ab0b9a41f925153fe03cd7e0d4a33b7c3d4.diff L

[clang] [Clang] Make `-Xarch_` handling generic for all toolchains (PR #125421)

2025-02-03 Thread Shilei Tian via cfe-commits
@@ -1115,14 +1117,13 @@ def fno_convergent_functions : Flag<["-"], "fno-convergent-functions">, // Common offloading options let Group = offload_Group in { -def offload_arch_EQ : Joined<["--"], "offload-arch=">, Flags<[NoXarchOption]>, shiltian wrote: then @

[clang] [Clang] Make `-Xarch_` handling generic for all toolchains (PR #125421)

2025-02-03 Thread Shilei Tian via cfe-commits
@@ -1115,14 +1117,13 @@ def fno_convergent_functions : Flag<["-"], "fno-convergent-functions">, // Common offloading options let Group = offload_Group in { -def offload_arch_EQ : Joined<["--"], "offload-arch=">, Flags<[NoXarchOption]>, shiltian wrote: If tha

[clang] [Clang] Make `-Xarch_` handling generic for all toolchains (PR #125421)

2025-02-03 Thread Shilei Tian via cfe-commits
@@ -1115,14 +1117,13 @@ def fno_convergent_functions : Flag<["-"], "fno-convergent-functions">, // Common offloading options let Group = offload_Group in { -def offload_arch_EQ : Joined<["--"], "offload-arch=">, Flags<[NoXarchOption]>, shiltian wrote: I thou

[clang] [Clang] Make OpenMP offloading consistently use the bound architecture (PR #125135)

2025-01-31 Thread Shilei Tian via cfe-commits
https://github.com/shiltian approved this pull request. https://github.com/llvm/llvm-project/pull/125135 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [OpenMP] Remove 'libomptarget.devicertl.a' fatbinary and use static library (PR #126143)

2025-02-09 Thread Shilei Tian via cfe-commits
shiltian wrote: > We already have a host-side libomptarget: +1, though as @jhuber6 mentioned, we did name it prefix with `libomptarget-nvptx64` or `libomptarget-amdgcn` before. I think this is a great opportunity to make it more appropriate. However, I don't have strong opinion against it. h

[clang] [OpenMP] Fix infinite recursion on global initializers (PR #126269)

2025-02-07 Thread Shilei Tian via cfe-commits
@@ -22819,8 +22819,12 @@ class GlobalDeclRefChecker final : public StmtVisitor { void declareTargetInitializer(Decl *TD) { A = TD->getAttr(); DeclVector.push_back(cast(TD)); +llvm::DenseSet Visited; while (!DeclVector.empty()) { VarDecl *TargetVarDecl

[clang] [OpenMP] Fix infinite recursion on global initializers (PR #126269)

2025-02-07 Thread Shilei Tian via cfe-commits
shiltian wrote: The fix looks reasonable to me. @alexey-bataev WDYT? https://github.com/llvm/llvm-project/pull/126269 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [OpenMP] Remove 'libomptarget.devicertl.a' fatbinary and use static library (PR #126143)

2025-02-09 Thread Shilei Tian via cfe-commits
https://github.com/shiltian approved this pull request. Hope the bot will be happy as well https://github.com/llvm/llvm-project/pull/126143 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-comm

[clang] [llvm] [OffloadBundler] Rework the ctor of `OffloadTargetInfo` to support AMDGPU's generic target (PR #122629)

2025-02-10 Thread Shilei Tian via cfe-commits
https://github.com/shiltian updated https://github.com/llvm/llvm-project/pull/122629 >From 00756872a2521510b2d4012a65d8fd6f21d07843 Mon Sep 17 00:00:00 2001 From: Shilei Tian Date: Thu, 16 Jan 2025 11:59:06 -0500 Subject: [PATCH] [OffloadBundler] Rework the ctor of `OffloadTargetInfo` to suppo

[clang] [libc] [Clang] Add width handling for shuffle helper (PR #125896)

2025-02-05 Thread Shilei Tian via cfe-commits
https://github.com/shiltian commented: test? https://github.com/llvm/llvm-project/pull/125896 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][test][OpenMP] Fix test assumptions of libomp and clang paths (PR #125891)

2025-02-05 Thread Shilei Tian via cfe-commits
@@ -1,49 +1,49 @@ // REQUIRES: x86-registered-target, amdgpu-registered-target // Fail on invalid ROCm Path. -// RUN: not %clang -### --target=x86_64-unknown-linux-gnu -fopenmp --offload-arch=gfx908:xnack+ -fsanitize=address -fgpu-sanitize -nogpuinc --rocm-path=%S/Inputs/r

[clang] [clang][test][OpenMP] Fix test assumptions of libomp and clang paths (PR #125891)

2025-02-05 Thread Shilei Tian via cfe-commits
https://github.com/shiltian approved this pull request. https://github.com/llvm/llvm-project/pull/125891 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][test][OpenMP] Fix test assumptions of libomp and clang paths (PR #125891)

2025-02-05 Thread Shilei Tian via cfe-commits
@@ -1,49 +1,49 @@ // REQUIRES: x86-registered-target, amdgpu-registered-target // Fail on invalid ROCm Path. -// RUN: not %clang -### --target=x86_64-unknown-linux-gnu -fopenmp --offload-arch=gfx908:xnack+ -fsanitize=address -fgpu-sanitize -nogpuinc --rocm-path=%S/Inputs/r

[clang] [llvm] [OpenMP] Remove 'libomptarget.devicertl.a' fatbinary and use static library (PR #126143)

2025-02-06 Thread Shilei Tian via cfe-commits
shiltian wrote: I'm not sure if calling it `libomp.a` is a good idea. I personally find it confusing because "libomp" is already an established name—it refers to the OpenMP host runtime contributed by Intel, just as "libgomp" is the OpenMP host runtime for GCC. These names are well-recognized.

[clang] [WIP][OpenMP] dispatch directive semantics/codegen (PR #126914)

2025-02-12 Thread Shilei Tian via cfe-commits
https://github.com/shiltian edited https://github.com/llvm/llvm-project/pull/126914 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [AMDGPU] Adding the amdgpu-num-work-groups function attribute (PR #79035)

2024-12-11 Thread Shilei Tian via cfe-commits
shiltian wrote: @krzysz00 Do you suggest that the actual value doesn't matter? Like, 128 is not better or worse than 256. https://github.com/llvm/llvm-project/pull/79035 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cg

[clang] [llvm] [AMDGPU] Adding the amdgpu-num-work-groups function attribute (PR #79035)

2024-12-11 Thread Shilei Tian via cfe-commits
shiltian wrote: What is the best case (from the compiler optimization perspective) that we can expect from `amdgpu-max-num-workgroups`? For example, is a smaller value better? I’d imagine that with a smaller value, the compiler can assume each workgroup has access to more resources. If that’s

[clang] [llvm] [NVPTX] Add NVVMUpgradeAnnotations pass to cleanup legacy annotations (PR #119261)

2024-12-10 Thread Shilei Tian via cfe-commits
@@ -1270,77 +1270,21 @@ exit: ; MODULE: attributes #[[ATTR1:[0-9]+]] = { convergent nocallback nounwind } ; MODULE: attributes #[[ATTR2:[0-9]+]] = { convergent nocallback nofree nounwind willreturn } ; MODULE: attributes #[[ATTR3:[0-9]+]] = { nocallback nofree nosync nounwind

[clang] [llvm] [NVPTX] Add NVVMUpgradeAnnotations pass to cleanup legacy annotations (PR #119261)

2024-12-10 Thread Shilei Tian via cfe-commits
@@ -1270,77 +1270,21 @@ exit: ; MODULE: attributes #[[ATTR1:[0-9]+]] = { convergent nocallback nounwind } ; MODULE: attributes #[[ATTR2:[0-9]+]] = { convergent nocallback nofree nounwind willreturn } ; MODULE: attributes #[[ATTR3:[0-9]+]] = { nocallback nofree nosync nounwind

[clang] [llvm] [Clang][OpenMP] Support for dispatch construct (Sema & Codegen) support (PR #117904)

2024-12-10 Thread Shilei Tian via cfe-commits
@@ -5965,6 +5967,266 @@ static bool teamsLoopCanBeParallelFor(Stmt *AStmt, Sema &SemaRef) { return Checker.teamsLoopCanBeParallelFor(); } +static Expr *getInitialExprFromCapturedExpr(Expr *Cond) { + + Expr *SubExpr = Cond->IgnoreParenImpCasts(); + + if (auto *DeclRef = dy

[clang] [llvm] [Clang][OpenMP] Support for dispatch construct (Sema & Codegen) support (PR #117904)

2024-12-10 Thread Shilei Tian via cfe-commits
@@ -10520,11 +10794,22 @@ StmtResult SemaOpenMP::ActOnOpenMPSectionDirective(Stmt *AStmt, DSAStack->isCancelRegion()); } +/// PseudoObjectExpr is a Trait for dispatch containing the +/// function and its variant. Returning only the functio

[clang] [llvm] [Clang][OpenMP] Support for dispatch construct (Sema & Codegen) support (PR #117904)

2024-12-10 Thread Shilei Tian via cfe-commits
@@ -5965,6 +5967,266 @@ static bool teamsLoopCanBeParallelFor(Stmt *AStmt, Sema &SemaRef) { return Checker.teamsLoopCanBeParallelFor(); } +static Expr *getInitialExprFromCapturedExpr(Expr *Cond) { + + Expr *SubExpr = Cond->IgnoreParenImpCasts(); + + if (auto *DeclRef = dy

[clang] [llvm] [Clang][OpenMP] Support for dispatch construct (Sema & Codegen) support (PR #117904)

2024-12-10 Thread Shilei Tian via cfe-commits
@@ -5965,6 +5967,266 @@ static bool teamsLoopCanBeParallelFor(Stmt *AStmt, Sema &SemaRef) { return Checker.teamsLoopCanBeParallelFor(); } +static Expr *getInitialExprFromCapturedExpr(Expr *Cond) { + + Expr *SubExpr = Cond->IgnoreParenImpCasts(); + + if (auto *DeclRef = dy

[clang] [llvm] [Clang][OpenMP] Support for dispatch construct (Sema & Codegen) support (PR #117904)

2024-12-10 Thread Shilei Tian via cfe-commits
https://github.com/shiltian edited https://github.com/llvm/llvm-project/pull/117904 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [Clang][OpenMP] Support for dispatch construct (Sema & Codegen) support (PR #117904)

2024-12-10 Thread Shilei Tian via cfe-commits
@@ -7209,8 +7482,9 @@ ExprResult SemaOpenMP::ActOnOpenMPCall(ExprResult Call, Scope *Scope, Exprs.erase(Exprs.begin() + BestIdx); } while (!VMIs.empty()); - if (!NewCall.isUsable()) + if (!NewCall.isUsable()) { return Call; + } shiltian wrote:

[clang] [llvm] [Clang][OpenMP] Support for dispatch construct (Sema & Codegen) support (PR #117904)

2024-12-10 Thread Shilei Tian via cfe-commits
@@ -10556,15 +10841,18 @@ SemaOpenMP::ActOnOpenMPDispatchDirective(ArrayRef Clauses, E = E->IgnoreParenCasts()->IgnoreImplicit(); if (auto *BO = dyn_cast(E)) { - if (BO->getOpcode() == BO_Assign) + if (BO->getOpcode() == BO_Assign) { TargetCall = ge

[clang] [llvm] [Clang][OpenMP] Support for dispatch construct (Sema & Codegen) support (PR #117904)

2024-12-10 Thread Shilei Tian via cfe-commits
@@ -5979,6 +6241,17 @@ StmtResult SemaOpenMP::ActOnOpenMPExecutableDirective( OMPExecutableDirective::getSingleClause(Clauses)) BindKind = BC->getBindKind(); + if ((Kind == OMPD_dispatch) && (Clauses.size() > 0)) { shiltian wrote: ```suggestion

[clang] [llvm] [Clang][OpenMP] Support for dispatch construct (Sema & Codegen) support (PR #117904)

2024-12-10 Thread Shilei Tian via cfe-commits
@@ -5965,6 +5967,266 @@ static bool teamsLoopCanBeParallelFor(Stmt *AStmt, Sema &SemaRef) { return Checker.teamsLoopCanBeParallelFor(); } +static Expr *getInitialExprFromCapturedExpr(Expr *Cond) { + + Expr *SubExpr = Cond->IgnoreParenImpCasts(); + + if (auto *DeclRef = dy

[clang] [llvm] [Clang][OpenMP] Support for dispatch construct (Sema & Codegen) support (PR #117904)

2024-12-10 Thread Shilei Tian via cfe-commits
@@ -5965,6 +5967,266 @@ static bool teamsLoopCanBeParallelFor(Stmt *AStmt, Sema &SemaRef) { return Checker.teamsLoopCanBeParallelFor(); } +static Expr *getInitialExprFromCapturedExpr(Expr *Cond) { + + Expr *SubExpr = Cond->IgnoreParenImpCasts(); + + if (auto *DeclRef = dy

[clang] [llvm] [NVPTX] Add NVVMUpgradeAnnotations pass to cleanup legacy annotations (PR #119261)

2024-12-10 Thread Shilei Tian via cfe-commits
https://github.com/shiltian edited https://github.com/llvm/llvm-project/pull/119261 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] Recover necessary AddrSpaceCast (PR #119246)

2024-12-12 Thread Shilei Tian via cfe-commits
@@ -0,0 +1,11 @@ +// REQUIRES: asserts + +// RUN: %clang_cc1 -triple x86_64-unknown-linux-gnu -target-cpu x86-64 -disable-llvm-passes -fopenmp-targets=amdgcn-amd-amdhsa -x c++ -emit-llvm-bc %s -o %t-x86-host.bc +// RUN: %clang_cc1 -triple amdgcn-amd-amdhsa -aux-triple x86_64-un

[clang] [Clang] Remove 3-element vector load and store special handling (PR #104661)

2024-12-15 Thread Shilei Tian via cfe-commits
shiltian wrote: gentle ping https://github.com/llvm/llvm-project/pull/104661 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] Remove 3-element vector load and store special handling (PR #104661)

2024-12-15 Thread Shilei Tian via cfe-commits
@@ -1,4 +1,5 @@ set(LLVM_LINK_COMPONENTS + Core shiltian wrote: > This shouldn't be necessary. I think this code is in the wrong place, I would > expect it to go in lib/CodeGen/Targets, not lib/Basic And then to have clang depend on LLVM's CodeGen component?

[clang] [Clang] Remove 3-element vector load and store special handling (PR #104661)

2024-12-16 Thread Shilei Tian via cfe-commits
https://github.com/shiltian updated https://github.com/llvm/llvm-project/pull/104661 >From f01858b4850cef77794959a36ec704e125838b73 Mon Sep 17 00:00:00 2001 From: Shilei Tian Date: Mon, 16 Dec 2024 21:51:53 -0500 Subject: [PATCH] [Clang] Remove 3-element vector load and store special handling

[clang] [Clang] Remove 3-element vector load and store special handling (PR #104661)

2024-12-16 Thread Shilei Tian via cfe-commits
https://github.com/shiltian updated https://github.com/llvm/llvm-project/pull/104661 >From 9e23538a7cac72fe456fb039b5e0f321a0f3e142 Mon Sep 17 00:00:00 2001 From: Shilei Tian Date: Mon, 16 Dec 2024 21:51:53 -0500 Subject: [PATCH] [Clang] Remove 3-element vector load and store special handling

[clang] [Clang] Remove 3-element vector load and store special handling (PR #104661)

2024-12-16 Thread Shilei Tian via cfe-commits
@@ -1846,6 +1846,16 @@ class TargetInfo : public TransferrableTargetInfo, return std::make_pair(64, 64); } + /// Returns the optimal vector type elements based on the provided vector + /// type. For example, on some targets, a vector with 3 elements may be + /// treat

[clang] [llvm] [OpenMP]Initial parsing/sema support for target_device selector set (PR #118471)

2024-12-17 Thread Shilei Tian via cfe-commits
@@ -2903,7 +2903,10 @@ TargetOMPContext::TargetOMPContext( const FunctionDecl *CurrentFunctionDecl, ArrayRef ConstructTraits) : OMPContext(ASTCtx.getLangOpts().OpenMPIsTargetDevice, - ASTCtx.getTargetInfo().getTriple()), + ASTCtx.getT

[clang] [llvm] [NVPTX] Auto-Upgrade some nvvm.annotations to attributes (PR #119261)

2024-12-13 Thread Shilei Tian via cfe-commits
https://github.com/shiltian edited https://github.com/llvm/llvm-project/pull/119261 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] Remove 3-element vector load and store special handling (PR #104661)

2024-12-12 Thread Shilei Tian via cfe-commits
https://github.com/shiltian updated https://github.com/llvm/llvm-project/pull/104661 >From c422624756e9b40b3fee02c6b3bb49d3355a1bbe Mon Sep 17 00:00:00 2001 From: Shilei Tian Date: Fri, 13 Dec 2024 00:35:28 -0500 Subject: [PATCH] [Clang] Remove 3-element vector load and store special handling

[clang] [Clang] Remove 3-element vector load and store special handling (PR #104661)

2024-12-12 Thread Shilei Tian via cfe-commits
@@ -1846,6 +1846,16 @@ class TargetInfo : public TransferrableTargetInfo, return std::make_pair(64, 64); } + /// Returns the optimal vector type elements based on the provided vector + /// type. For example, on some targets, a vector with 3 elements may be + /// treat

[clang] [Clang] Remove 3-element vector load and store special handling (PR #104661)

2024-12-12 Thread Shilei Tian via cfe-commits
https://github.com/shiltian updated https://github.com/llvm/llvm-project/pull/104661 >From 007818c271c18d96c112fc1835b4175ab6d509f3 Mon Sep 17 00:00:00 2001 From: Shilei Tian Date: Fri, 13 Dec 2024 00:37:55 -0500 Subject: [PATCH] [Clang] Remove 3-element vector load and store special handling

[clang] [Clang] Remove 3-element vector load and store special handling (PR #104661)

2024-12-12 Thread Shilei Tian via cfe-commits
@@ -1,4 +1,5 @@ set(LLVM_LINK_COMPONENTS + Core shiltian wrote: This is needed because `TargetInfo.cpp` now needs LLVM types. https://github.com/llvm/llvm-project/pull/104661 ___ cfe-commits mailing list cfe-commits@

[clang] [Clang] Remove 3-element vector load and store special handling (PR #104661)

2024-12-12 Thread Shilei Tian via cfe-commits
@@ -45,7 +45,7 @@ void test3(packedfloat3 *p) { *p = (packedfloat3) { 3.2f, 2.3f, 0.1f }; } // CHECK: @test3( -// CHECK: store <4 x float> {{.*}}, align 4 +// CHECK: store <3 x float> {{.*}}, align 4 shiltian wrote: Eventually we might do it like: ``` bool

[clang] [Clang] Remove 3-element vector load and store special handling (PR #104661)

2024-12-12 Thread Shilei Tian via cfe-commits
https://github.com/shiltian updated https://github.com/llvm/llvm-project/pull/104661 >From e4b3028885112cd33206051292b3b397f90a3d5c Mon Sep 17 00:00:00 2001 From: Shilei Tian Date: Fri, 13 Dec 2024 00:38:50 -0500 Subject: [PATCH] [Clang] Remove 3-element vector load and store special handling

[clang] [Clang] Remove 3-element vector load and store special handling (PR #104661)

2024-12-12 Thread Shilei Tian via cfe-commits
@@ -45,7 +45,7 @@ void test3(packedfloat3 *p) { *p = (packedfloat3) { 3.2f, 2.3f, 0.1f }; } // CHECK: @test3( -// CHECK: store <4 x float> {{.*}}, align 4 +// CHECK: store <3 x float> {{.*}}, align 4 shiltian wrote: `unsigned getOptimalVectorNumElements(cons

[clang] [Clang] Remove 3-element vector load and store special handling (PR #104661)

2024-12-12 Thread Shilei Tian via cfe-commits
@@ -45,7 +45,7 @@ void test3(packedfloat3 *p) { *p = (packedfloat3) { 3.2f, 2.3f, 0.1f }; } // CHECK: @test3( -// CHECK: store <4 x float> {{.*}}, align 4 +// CHECK: store <3 x float> {{.*}}, align 4 shiltian wrote: I took another look and this is not only a

[clang] [Clang] Remove 3-element vector load and store special handling (PR #104661)

2024-12-12 Thread Shilei Tian via cfe-commits
@@ -8026,10 +8026,6 @@ def fhlsl_strict_availability : Flag<["-"], "fhlsl-strict-availability">, Group, MarshallingInfoFlag>; -def fpreserve_vec3_type : Flag<["-"], "fpreserve-vec3-type">, - HelpText<"Preserve 3-component vector type">, - MarshallingInfoFlag>, - Implie

[clang] [Clang] Remove 3-element vector load and store special handling (PR #104661)

2024-12-12 Thread Shilei Tian via cfe-commits
https://github.com/shiltian edited https://github.com/llvm/llvm-project/pull/104661 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [Clang][OpenMP] Support for dispatch construct (Sema & Codegen) support (PR #117904)

2024-12-13 Thread Shilei Tian via cfe-commits
https://github.com/shiltian commented: update the openmp doc as well? https://github.com/llvm/llvm-project/pull/117904 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [Clang][OpenMP] Support for dispatch construct (Sema & Codegen) support (PR #117904)

2024-12-13 Thread Shilei Tian via cfe-commits
shiltian wrote: @alexey-bataev What do you think? I'm not very familiar with some front end concepts used in this PR. https://github.com/llvm/llvm-project/pull/117904 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-b

[clang] [llvm] [Clang][OpenMP] Support for dispatch construct (Sema & Codegen) support (PR #117904)

2024-12-13 Thread Shilei Tian via cfe-commits
@@ -141,6 +141,12 @@ struct VariantMatchInfo { ISATraits.push_back(RawString); RequiredTraits.set(unsigned(Property)); +#if 0 shiltian wrote: what is this for? https://github.com/llvm/llvm-project/pull/117904 ___

[clang] [llvm] [Clang][OpenMP] Support for dispatch construct (Sema & Codegen) support (PR #117904)

2024-12-13 Thread Shilei Tian via cfe-commits
https://github.com/shiltian edited https://github.com/llvm/llvm-project/pull/117904 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [Clang][OpenMP] Support for dispatch construct (Sema & Codegen) support (PR #117904)

2024-12-13 Thread Shilei Tian via cfe-commits
https://github.com/shiltian edited https://github.com/llvm/llvm-project/pull/117904 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [NVPTX] Auto-Upgrade some nvvm.annotations to attributes (PR #119261)

2024-12-13 Thread Shilei Tian via cfe-commits
@@ -1270,77 +1270,21 @@ exit: ; MODULE: attributes #[[ATTR1:[0-9]+]] = { convergent nocallback nounwind } ; MODULE: attributes #[[ATTR2:[0-9]+]] = { convergent nocallback nofree nounwind willreturn } ; MODULE: attributes #[[ATTR3:[0-9]+]] = { nocallback nofree nosync nounwind

[clang] [Clang] Remove 3-element vector load and store special handling (PR #104661)

2024-12-13 Thread Shilei Tian via cfe-commits
https://github.com/shiltian updated https://github.com/llvm/llvm-project/pull/104661 >From 69d491983634adb2c059025ac848d1c53b0b282a Mon Sep 17 00:00:00 2001 From: Shilei Tian Date: Fri, 13 Dec 2024 08:59:59 -0500 Subject: [PATCH] [Clang] Remove 3-element vector load and store special handling

[clang] [llvm] [NVPTX] Auto-Upgrade some nvvm.annotations to attributes (PR #119261)

2024-12-13 Thread Shilei Tian via cfe-commits
https://github.com/shiltian edited https://github.com/llvm/llvm-project/pull/119261 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [NVPTX] Auto-Upgrade some nvvm.annotations to attributes (PR #119261)

2024-12-13 Thread Shilei Tian via cfe-commits
@@ -1270,77 +1270,21 @@ exit: ; MODULE: attributes #[[ATTR1:[0-9]+]] = { convergent nocallback nounwind } ; MODULE: attributes #[[ATTR2:[0-9]+]] = { convergent nocallback nofree nounwind willreturn } ; MODULE: attributes #[[ATTR3:[0-9]+]] = { nocallback nofree nosync nounwind

[clang] [llvm] AMDGPU: Define v_mfma_f32_{16x16x128|32x32x64}_f8f6f4 instructions (PR #116723)

2024-11-21 Thread Shilei Tian via cfe-commits
https://github.com/shiltian approved this pull request. https://github.com/llvm/llvm-project/pull/116723 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] AMDGPU: Define v_mfma_f32_{16x16x128|32x32x64}_f8f6f4 instructions (PR #116723)

2024-11-21 Thread Shilei Tian via cfe-commits
https://github.com/shiltian edited https://github.com/llvm/llvm-project/pull/116723 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] Codegen changes for strict modifier with grainsize/num_tasks of taskloop construct (PR #117196)

2024-11-22 Thread Shilei Tian via cfe-commits
@@ -7831,10 +7831,14 @@ void CodeGenFunction::EmitOMPTaskLoopBasedDirective(const OMPLoopDirective &S) { // grainsize clause Data.Schedule.setInt(/*IntVal=*/false); Data.Schedule.setPointer(EmitScalarExpr(Clause->getGrainsize())); +Data.HasModifier = +(

[clang] [llvm] AMDGPU: Add v_smfmac_f32_32x32x64_bf8_bf8 for gfx950 (PR #117256)

2024-11-21 Thread Shilei Tian via cfe-commits
https://github.com/shiltian approved this pull request. https://github.com/llvm/llvm-project/pull/117256 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] AMDGPU: Add v_smfmac_f32_32x32x64_bf8_bf8 for gfx950 (PR #117256)

2024-11-21 Thread Shilei Tian via cfe-commits
https://github.com/shiltian edited https://github.com/llvm/llvm-project/pull/117256 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] Codegen changes for strict modifier with grainsize/num_tasks of taskloop construct (PR #117196)

2024-11-21 Thread Shilei Tian via cfe-commits
@@ -4666,30 +4666,58 @@ void CGOpenMPRuntime::emitTaskLoopCall(CodeGenFunction &CGF, SourceLocation Loc, CGF.getContext().VoidPtrTy); } enum { NoSchedule = 0, Grainsize = 1, NumTasks = 2 }; - llvm::Value *TaskArgs[] = { - UpLoc, -

[clang] [llvm] AMDGPU: Add v_permlane16_swap_b32 and v_permlane32_swap_b32 for gfx950 (PR #117260)

2024-11-22 Thread Shilei Tian via cfe-commits
https://github.com/shiltian edited https://github.com/llvm/llvm-project/pull/117260 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] AMDGPU: Add v_permlane16_swap_b32 and v_permlane32_swap_b32 for gfx950 (PR #117260)

2024-11-22 Thread Shilei Tian via cfe-commits
https://github.com/shiltian approved this pull request. https://github.com/llvm/llvm-project/pull/117260 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] clang/AMDGPU: Set amdgpu-max-num-workgroups to disable Y/Z by default (PR #119009)

2024-12-06 Thread Shilei Tian via cfe-commits
@@ -706,6 +706,10 @@ class LangOptions : public LangOptionsBase { return OpenCL || CUDA; } + /// Return true if the dispatch size for an offload language only uses one + /// dimension. + bool gridSizeIsOneDimension() const { return CUDA || HIP || OpenMP; } ---

[clang] [libc] [llvm] [AMDGPU] Use COV6 by default (PR #118515)

2024-12-03 Thread Shilei Tian via cfe-commits
@@ -0,0 +1,7 @@ +; RUN: llc -mtriple=amdgcn-amd-amdhsa %s -o - | FileCheck %s + +; CHECK: .amdhsa_code_object_version 6 shiltian wrote: ah, they check the IR match Lol. I will add one later then. https://github.com/llvm/llvm-project/pull/118515 _

[clang] [llvm] [AMDGPU] Infer amdgpu-no-flat-scratch-init attribute in AMDGPUAttributor (PR #118907)

2024-12-05 Thread Shilei Tian via cfe-commits
shiltian wrote: I was thinking this PR looks familiar... https://github.com/llvm/llvm-project/pull/118907 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] clang/AMDGPU: Set amdgpu-max-num-workgroups to disable Y/Z by default (PR #119009)

2024-12-06 Thread Shilei Tian via cfe-commits
shiltian wrote: > The kernels do, but the callable __omp_offloading functions are missing them > for some reason. The OpenMP GPU CodeGen only calls it on the target entry point. https://github.com/llvm/llvm-project/pull/119009 ___ cfe-commits mailing

[clang] clang/AMDGPU: Set amdgpu-max-num-workgroups to disable Y/Z by default (PR #119009)

2024-12-06 Thread Shilei Tian via cfe-commits
@@ -706,6 +706,10 @@ class LangOptions : public LangOptionsBase { return OpenCL || CUDA; } + /// Return true if the dispatch size for an offload language only uses one + /// dimension. + bool gridSizeIsOneDimension() const { return CUDA || HIP || OpenMP; } ---

[clang] [clang] Propagate -ftime-report to offload lto (PR #122143)

2025-01-08 Thread Shilei Tian via cfe-commits
https://github.com/shiltian approved this pull request. https://github.com/llvm/llvm-project/pull/122143 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [OpenMP] Allow GPUs to be targeted directly via `-fopenmp`. (PR #122149)

2025-01-08 Thread Shilei Tian via cfe-commits
shiltian wrote: I don't think it should be GPU code generation path as there is no explicit `target` region used. https://github.com/llvm/llvm-project/pull/122149 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/m

[clang] [Driver][SYCL] Address sanitizer and test issue (PR #121822)

2025-01-08 Thread Shilei Tian via cfe-commits
@@ -31,8 +30,8 @@ void SYCLInstallationDetector::addSYCLIncludeArgs( } // Unsupported options for SYCL device compilation. -static ArrayRef getUnsupportedOpts() { - return { +static ArrayRef getUnsupportedOpts() { shiltian wrote: maybe it's a good idea to re

[clang] [OpenMP] Allow GPUs to be targeted directly via `-fopenmp`. (PR #122149)

2025-01-08 Thread Shilei Tian via cfe-commits
shiltian wrote: What code generation path would be used in this case? The GPU code generation or regular host OpenMP? https://github.com/llvm/llvm-project/pull/122149 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-b

[clang] [OpenMP] Allow GPUs to be targeted directly via `-fopenmp`. (PR #122149)

2025-01-08 Thread Shilei Tian via cfe-commits
shiltian wrote: I think that is a misuse of OpenMP semantics. We can't expect to have regular OpenMP code working in the same way as OpenMP offloading code when targeting a GPU meanwhile while the code is not wrapped into `target` region. I understand to have variants and declare target is not

[clang] [OpenMP] Allow GPUs to be targeted directly via `-fopenmp`. (PR #122149)

2025-01-08 Thread Shilei Tian via cfe-commits
shiltian wrote: > It should maintain the normal semantics you'd get with -fopenmp except it > codegens certain things differently. That is the key difference. > Alternatively I could just remove OpenMP entirely from the DeviceRTL so I > might just do that instead. +1 https://github.com/llvm

[clang] [Clang] Use `-targets=host-x86_64-unknown-linux-gnu` as bundler target (PR #122627)

2025-01-11 Thread Shilei Tian via cfe-commits
https://github.com/shiltian created https://github.com/llvm/llvm-project/pull/122627 This a prime patch to support generic target when using `--offload-compress`. >From 95332e05f381f7e80cd1c57420db0c56cf8aedcf Mon Sep 17 00:00:00 2001 From: Shilei Tian Date: Sat, 11 Jan 2025 21:24:53 -0500 Sub

[clang] [Clang] Use `-targets=host-x86_64-unknown-linux-gnu` as bundler target (PR #122627)

2025-01-11 Thread Shilei Tian via cfe-commits
shiltian wrote: * **#122627** https://app.graphite.dev/github/pr/llvm/llvm-project/122627?utm_source=stack-comment-icon"; target="_blank">https://static.graphite.dev/graphite-32x32-black.png"; alt="Graphite" width="10px" height="10px"/> 👈 https://app.graphite.dev/github/pr/llvm/llvm-project/122

<    3   4   5   6   7   8   9   >