[clang] [CodeGen] Use range-based for loops (NFC) (PR #144939)

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

[clang] [Clang][AMDGPU][Driver] Add `avail-extern-gv-in-addrspace-to-local` option when ThinTLO is enabled (PR #144914)

2025-06-19 Thread Shilei Tian via cfe-commits
https://github.com/shiltian closed https://github.com/llvm/llvm-project/pull/144914 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang][AMDGPU][Driver] Add `avail-extern-gv-in-addrspace-to-local` option when ThinTLO is enabled (PR #144914)

2025-06-19 Thread Shilei Tian via cfe-commits
shiltian wrote: > Bit of a hack it seems It is a hack (or workaround). The correct approach would be either to redesign the lowering of LDS, or create another flavor of ThinLTO. Neither of it can be done in a reasonably short amount of time. https://github.com/llvm/llvm-project/pull/144914 __

[clang] [Clang][AMDGPU][Driver] Add `avail-extern-gv-in-addrspace-to-local` option when ThinTLO is enabled (PR #144914)

2025-06-19 Thread Shilei Tian via cfe-commits
shiltian wrote: * **#144914** https://app.graphite.dev/github/pr/llvm/llvm-project/144914?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/144

[clang] [Clang][AMDGPU][Driver] Add `avail-extern-gv-in-addrspace-to-local` option when ThinTLO is enabled (PR #144914)

2025-06-19 Thread Shilei Tian via cfe-commits
https://github.com/shiltian created https://github.com/llvm/llvm-project/pull/144914 On AMDGPU, we need an extra argument `-avail-extern-gv-in-addrspace-to-local=3` to privatize LDS global variables when ThinLTO is enabled. >From bf7b936421379ae7e043360c6515136660e2e550 Mon Sep 17 00:00:00 2001

[clang] [Clang] Add standalone AMDGPU SPIR-V toolchain (PR #144576)

2025-06-18 Thread Shilei Tian via cfe-commits
@@ -417,3 +417,15 @@ void HIPAMDToolChain::checkTargetID( getDriver().Diag(clang::diag::err_drv_bad_target_id) << *PTID.OptionalTargetID; } + +SPIRVAMDToolChain::SPIRVAMDToolChain(const Driver &D, + const llvm::Triple &Triple, +

[clang] [HIP] Emit the CUID value in the module with the new driver (PR #144570)

2025-06-18 Thread Shilei Tian via cfe-commits
shiltian wrote: No test is needed? https://github.com/llvm/llvm-project/pull/144570 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [SROA] Vector promote some memsets (PR #133301)

2025-06-17 Thread Shilei Tian via cfe-commits
shiltian wrote: > I assume AMDGPU does not support unaligned loads We do support unaligned access IIUC, and it is actually required by HSA ABI. CC @arsenm https://github.com/llvm/llvm-project/pull/133301 ___ cfe-commits mailing list cfe-commits@list

[clang] [clang] Remove unused includes (NFC) (PR #144285)

2025-06-15 Thread Shilei Tian via cfe-commits
https://github.com/shiltian approved this pull request. CI will tell us whether this is broken or not. :-) https://github.com/llvm/llvm-project/pull/144285 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/l

[clang-tools-extra] [clang-move] Teach getDeclarationList to return ArrayRef (NFC) (PR #143278)

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

[clang] [clang] Use llvm::count (NFC) (PR #143228)

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

[clang] [clang] Strip away lambdas (NFC) (PR #143226)

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

[clang] [Sema] Drop const from a return type (NFC) (PR #143224)

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

[clang] [Sema] Fix bug in builtin AS override (PR #138141)

2025-06-02 Thread Shilei Tian via cfe-commits
shiltian wrote: Can you also remove all `t`? They don't seem to be necessary here. https://github.com/llvm/llvm-project/pull/138141 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [flang] [llvm] [TargetVerifier][AMDGPU] Add TargetVerifier. (PR #123609)

2025-06-01 Thread Shilei Tian via cfe-commits
@@ -0,0 +1,170 @@ +//===-- AMDGPUTargetVerifier.cpp - AMDGPU ---*- C++ -*-===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Ap

[clang] [flang] [llvm] [TargetVerifier][AMDGPU] Add TargetVerifier. (PR #123609)

2025-06-01 Thread Shilei Tian via cfe-commits
@@ -0,0 +1,170 @@ +//===-- AMDGPUTargetVerifier.cpp - AMDGPU ---*- C++ -*-===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Ap

[clang] [Format] Remove unused includes (NFC) (PR #142296)

2025-05-31 Thread Shilei Tian via cfe-commits
https://github.com/shiltian approved this pull request. LGTM as long as it builds successfully. I tried something similar in a few files before, but it ended up breaking the build, so I gave up. :-) https://github.com/llvm/llvm-project/pull/142296 ___

[clang] [Basic] Remove unused includes (NFC) (PR #142295)

2025-05-31 Thread Shilei Tian via cfe-commits
https://github.com/shiltian approved this pull request. LGTM as long as it doesn't break the build. https://github.com/llvm/llvm-project/pull/142295 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo

[clang] [Sema] Fix bug in builtin AS override (PR #138141)

2025-05-31 Thread Shilei Tian via cfe-commits
shiltian wrote: Why did we have `t` in some of the builtins in the first place… https://github.com/llvm/llvm-project/pull/138141 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [CodeGen] Remove unused includes (NFC) (PR #141418)

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

[clang] [Driver] Use StringRef::consume_front (NFC) (PR #141412)

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

[clang] [OpenMP] Fix atomic compare handling with overloaded operators (PR #141142)

2025-05-22 Thread Shilei Tian via cfe-commits
@@ -11762,52 +11762,98 @@ bool OpenMPAtomicCompareChecker::checkCondUpdateStmt(IfStmt *S, X = BO->getLHS(); - auto *Cond = dyn_cast(S->getCond()); - if (!Cond) { -ErrorInfo.Error = ErrorTy::NotABinaryOp; -ErrorInfo.ErrorLoc = ErrorInfo.NoteLoc = S->getCond()->get

[clang] [OpenMP] Fix atomic compare handling with overloaded operators (PR #141142)

2025-05-22 Thread Shilei Tian via cfe-commits
@@ -11762,52 +11762,98 @@ bool OpenMPAtomicCompareChecker::checkCondUpdateStmt(IfStmt *S, X = BO->getLHS(); - auto *Cond = dyn_cast(S->getCond()); - if (!Cond) { -ErrorInfo.Error = ErrorTy::NotABinaryOp; -ErrorInfo.ErrorLoc = ErrorInfo.NoteLoc = S->getCond()->get

[clang] [OpenMP] Fix atomic compare handling with overloaded operators (PR #141142)

2025-05-22 Thread Shilei Tian via cfe-commits
@@ -11762,52 +11762,98 @@ bool OpenMPAtomicCompareChecker::checkCondUpdateStmt(IfStmt *S, X = BO->getLHS(); - auto *Cond = dyn_cast(S->getCond()); - if (!Cond) { -ErrorInfo.Error = ErrorTy::NotABinaryOp; -ErrorInfo.ErrorLoc = ErrorInfo.NoteLoc = S->getCond()->get

[clang] [clang] Avoid creating temporary instances of std::string (NFC) (PR #140988)

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

[clang] [clang] Use llvm::find_if (NFC) (PR #140983)

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

[clang] [Sema] Use llvm::is_contained (NFC) (PR #140455)

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

[clang] [Sema] Use llvm::is_contained (NFC) (PR #140455)

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

[clang-tools-extra] [clang-tools-extra] Use llvm::is_contained (NFC) (PR #140456)

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

[clang-tools-extra] [clang-tools-extra] Use llvm::is_contained (NFC) (PR #140456)

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

[clang] [clang] Use llvm::unique (NFC) (PR #140459)

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

[clang-tools-extra] [clang-tools-extra] Use llvm::max_element (NFC) (PR #140458)

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

[clang-tools-extra] [clang-tools-extra] Use llvm::max_element (NFC) (PR #140458)

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

[clang] [clang] Use llvm::unique (NFC) (PR #140459)

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

[clang] [CodeGen] Use DenseMap::try_emplace (NFC) (PR #140430)

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

[clang] [clang] Use llvm::max_element (NFC) (PR #140435)

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

[clang-tools-extra] [clang-tools-extra] Use llvm::find_if (NFC) (PR #140411)

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

[clang-tools-extra] [clang-tools-extra] Use llvm::find_if (NFC) (PR #140411)

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

[clang-tools-extra] [clang-include-fixer] Remove an unused "using" decl (NFC) (PR #140354)

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

[clang-tools-extra] [clang-include-fixer] Remove an unused "using" decl (NFC) (PR #140354)

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

[clang] [clang] Use llvm::stable_sort (NFC) (PR #140413)

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

[clang] [clang] Use llvm::stable_sort (NFC) (PR #140413)

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

[clang] [Frontend] Avoid creating a temporary instance of std::string (NFC) (PR #140326)

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

[clang] [WIP][AMDGPU] Support for type inferring image load/store builtins for AMDGPU (PR #140210)

2025-05-16 Thread Shilei Tian via cfe-commits
@@ -683,6 +683,30 @@ Value *CodeGenFunction::EmitAMDGPUBuiltinExpr(unsigned BuiltinID, return Builder.CreateInsertElement(I0, A, 1); } + case AMDGPU::BI__builtin_amdgcn_image_load_2d_f32_i32: { +llvm::Type *RetTy = llvm::Type::getFloatTy(Builder.getContext()); +

[clang] [WIP][AMDGPU] Support for type inferring image load/store builtins for AMDGPU (PR #140210)

2025-05-16 Thread Shilei Tian via cfe-commits
@@ -635,5 +635,10 @@ TARGET_BUILTIN(__builtin_amdgcn_bitop3_b16, "IUi", "nc", "bitop3-insts") TARGET_BUILTIN(__builtin_amdgcn_cvt_sr_bf16_f32, "V2yV2yfUiIb", "nc", "f32-to-f16bf16-cvt-sr-insts") TARGET_BUILTIN(__builtin_amdgcn_cvt_sr_f16_f32, "V2hV2hfUiIb", "nc", "f32-to-

[clang] [WIP][AMDGPU] Support for type inferring image load/store builtins for AMDGPU (PR #140210)

2025-05-16 Thread Shilei Tian via cfe-commits
@@ -0,0 +1,31 @@ +// NOTE: Assertions have been autogenerated by utils/update_cc_test_checks.py UTC_ARGS: --version 5 +// RUN: %clang_cc1 -triple amdgcn-unknown-unknown %s -emit-llvm -o - | FileCheck %s shiltian wrote: use right triple `amdgcn-amd-amdhsa` pls

[clang] [WIP][AMDGPU] Support for type inferring image load/store builtins for AMDGPU (PR #140210)

2025-05-16 Thread Shilei Tian via cfe-commits
@@ -683,6 +683,30 @@ Value *CodeGenFunction::EmitAMDGPUBuiltinExpr(unsigned BuiltinID, return Builder.CreateInsertElement(I0, A, 1); } + case AMDGPU::BI__builtin_amdgcn_image_load_2d_f32_i32: { +llvm::Type *RetTy = llvm::Type::getFloatTy(Builder.getContext());

[clang] [WIP][AMDGPU] Support for type inferring image load/store builtins for AMDGPU (PR #140210)

2025-05-16 Thread Shilei Tian via cfe-commits
@@ -683,6 +683,30 @@ Value *CodeGenFunction::EmitAMDGPUBuiltinExpr(unsigned BuiltinID, return Builder.CreateInsertElement(I0, A, 1); } + case AMDGPU::BI__builtin_amdgcn_image_load_2d_f32_i32: { +llvm::Type *RetTy = llvm::Type::getFloatTy(Builder.getContext()); +

[clang] [clang] Use llvm::replace (NFC) (PR #140264)

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

[clang-tools-extra] [clang-tidy] Use std::binary_search (NFC) (PR #140263)

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

[clang] [CUDA][HIP] add option -gpuinc (PR #140106)

2025-05-15 Thread Shilei Tian via cfe-commits
shiltian wrote: > comgr is the JIT compiler for HIP on ROCm. comgr uses -nogpuinc by default. > However, some users of comgr need to override that so that comgr enables the > wrapper headers. We cannot simply let comgr stop using -nogpuinc by default > since it will break existing comgr users.

[clang] [CUDA][HIP] add option -gpuinc (PR #140106)

2025-05-15 Thread Shilei Tian via cfe-commits
shiltian wrote: Hmm, in what cases `-nogpuinc` is added but we don't actually want it? https://github.com/llvm/llvm-project/pull/140106 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [OpenMP] Add diagnostic for 'factor' width mismatch in 'unroll partial' (PR #139986)

2025-05-15 Thread Shilei Tian via cfe-commits
@@ -14924,8 +14924,25 @@ StmtResult SemaOpenMP::ActOnOpenMPUnrollDirective(ArrayRef Clauses, SourceLocation FactorLoc; if (Expr *FactorVal = PartialClause->getFactor(); FactorVal && !FactorVal->containsErrors()) { +if (!VerifyPositiveIntegerConstantInClause(Facto

[clang] [OpenMP] Add diagnostic for 'factor' width mismatch in 'unroll partial' (PR #139986)

2025-05-15 Thread Shilei Tian via cfe-commits
@@ -14924,8 +14924,25 @@ StmtResult SemaOpenMP::ActOnOpenMPUnrollDirective(ArrayRef Clauses, SourceLocation FactorLoc; if (Expr *FactorVal = PartialClause->getFactor(); FactorVal && !FactorVal->containsErrors()) { +if (!VerifyPositiveIntegerConstantInClause(Facto

[clang] [OpenMP] Add diagnostic for 'factor' width mismatch in 'unroll partial' (PR #139986)

2025-05-15 Thread Shilei Tian via cfe-commits
@@ -14924,8 +14924,25 @@ StmtResult SemaOpenMP::ActOnOpenMPUnrollDirective(ArrayRef Clauses, SourceLocation FactorLoc; if (Expr *FactorVal = PartialClause->getFactor(); FactorVal && !FactorVal->containsErrors()) { +if (!VerifyPositiveIntegerConstantInClause(Facto

[clang] [OpenMP] Fix crash with invalid size expression (PR #139745)

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

[clang] [Tooling] Remove a redundant call to std::unique_ptr::get (NFC) (PR #139431)

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

[clang-tools-extra] [modularize] Use default member initialization for Location (NFC) (PR #139384)

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

[clang] [StaticAnalyzer] Remove redundant calls to std::unique_ptr::get (NFC) (PR #139353)

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

[clang] [OpenMP] Fix a crash on invalid with unroll partial (PR #139280)

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

[clang] [flang] [llvm] [TargetVerifier][AMDGPU] Add TargetVerifier. (PR #123609)

2025-05-08 Thread Shilei Tian via cfe-commits
@@ -0,0 +1,84 @@ +//===-- llvm/Target/TargetVerifier.h - LLVM IR Target Verifier --*- C++ -*-===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apa

[clang] [flang] [llvm] [TargetVerifier][AMDGPU] Add TargetVerifier. (PR #123609)

2025-05-08 Thread Shilei Tian via cfe-commits
@@ -0,0 +1,84 @@ +//===-- llvm/Target/TargetVerifier.h - LLVM IR Target Verifier --*- C++ -*-===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apa

[clang] [flang] [llvm] [TargetVerifier][AMDGPU] Add TargetVerifier. (PR #123609)

2025-05-08 Thread Shilei Tian via cfe-commits
@@ -0,0 +1,84 @@ +//===-- llvm/Target/TargetVerifier.h - LLVM IR Target Verifier --*- C++ -*-===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apa

[clang] [flang] [llvm] [TargetVerifier][AMDGPU] Add TargetVerifier. (PR #123609)

2025-05-08 Thread Shilei Tian via cfe-commits
@@ -481,6 +481,9 @@ static cl::opt HasClosedWorldAssumption( cl::desc("Whether has closed-world assumption at link time"), cl::init(false), cl::Hidden); +static cl::opt VerifyTarget("verify-tgt", shiltian wrote: `verify-tgt` is too broad. I'd add an `

[clang-tools-extra] [clang-tools-extra] Remove redundant calls to std::unique_ptr::get (NFC) (PR #138774)

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

[clang] [Clang][Driver] Only enable internalization for OpenMP target offloading with ThinLTO on AMDGPU (PR #138547)

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

[clang] [Clang][Driver] Only enable internalization for OpenMP target offloading with ThinLTO on AMDGPU (PR #138547)

2025-05-05 Thread Shilei Tian via cfe-commits
shiltian wrote: * **#138547** https://app.graphite.dev/github/pr/llvm/llvm-project/138547?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/138

[clang] [Clang][Driver] Only enable internalization for OpenMP target offloading with ThinLTO on AMDGPU (PR #138547)

2025-05-05 Thread Shilei Tian via cfe-commits
https://github.com/shiltian created https://github.com/llvm/llvm-project/pull/138547 None Rate limit · GitHub body { background-color: #f6f8fa; color: #24292e; font-family: -apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial

[clang] [Clang][Driver] Enable internalization by default for AMDGPU (PR #138365)

2025-05-03 Thread Shilei Tian via cfe-commits
shiltian wrote: I got it that you are trying to make it generic. That's why I didn’t roll back to using builtin bitcode as we did before. However there is one limitation that we can't really work around, which is the fact that we don't support ABI linking. This is not a new topic at all and wh

[clang] [Clang][Driver] Enable internalization by default for AMDGPU (PR #138365)

2025-05-03 Thread Shilei Tian via cfe-commits
shiltian wrote: > also seeing > > "PluginInterface" error: Failure to look up global address: Error in > hsa_executable_get_symbol_by_name(grid_points): > HSA_STATUS_ERROR_INVALID_SYMBOL_NAME: There is no symbol with the given name. > > omptarget error: Failed to load symbol grid_points > >

[clang] [Clang][Driver] Enable internalization by default for AMDGPU (PR #138365)

2025-05-03 Thread Shilei Tian via cfe-commits
shiltian wrote: I don't think OpenMP is more special than HIP here. Anything exposed to the host should not be internalized. In addition, OpenMP actually also heavily uses internalization as well in OpenMPOpt. It is likely that this change exposes something bad in the downstream. The motivati

[clang] [Clang][Driver] Enable internalization by default for AMDGPU (PR #138365)

2025-05-02 Thread Shilei Tian via cfe-commits
@@ -9284,6 +9284,12 @@ void LinkerWrapper::ConstructJob(Compilation &C, const JobAction &JA, CmdArgs.push_back(Args.MakeArgString( "--device-linker=" + TC->getTripleString() + "=" + Arg)); + // Enable internalization for AMDGPU. + if (TC->getTrip

[clang] [Clang][Driver] Enable internalization by default for AMDGPU (PR #138365)

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

[clang] [Clang][Driver] Enable internalization by default for AMDGPU (PR #138365)

2025-05-02 Thread Shilei Tian via cfe-commits
https://github.com/shiltian updated https://github.com/llvm/llvm-project/pull/138365 >From c9a8e6e2d67d8e7d029e58402c17d8c9419cd028 Mon Sep 17 00:00:00 2001 From: Shilei Tian Date: Fri, 2 May 2025 19:41:11 -0400 Subject: [PATCH] [Clang][Driver] Enable internalization by default for AMDGPU ---

[clang] [Clang][Driver] Enable internalization by default for AMDGPU (PR #138365)

2025-05-02 Thread Shilei Tian via cfe-commits
shiltian wrote: * **#138365** https://app.graphite.dev/github/pr/llvm/llvm-project/138365?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/138

[clang] [Clang][Driver] Enable internalization by default for AMDGPU (PR #138365)

2025-05-02 Thread Shilei Tian via cfe-commits
https://github.com/shiltian created https://github.com/llvm/llvm-project/pull/138365 None >From acc89cf6a85a8fb758b528a4e2ae587fccd61ce5 Mon Sep 17 00:00:00 2001 From: Shilei Tian Date: Fri, 2 May 2025 19:41:11 -0400 Subject: [PATCH] [Clang][Driver] Enable internalization by default for AMDGPU

[clang] [llvm] [mlir] [AMDGPU] Add a new amdgcn.load.to.lds intrinsic (PR #137425)

2025-05-02 Thread Shilei Tian via cfe-commits
@@ -2641,6 +2641,28 @@ def int_amdgcn_perm : // GFX9 Intrinsics //===--===// +/// This is a general-purpose intrinsic for all operations that take a pointer +/// a base location in LDS, and a data size and us

[clang] [flang] [llvm] [TargetVerifier][AMDGPU] Add TargetVerifier. (PR #123609)

2025-04-29 Thread Shilei Tian via cfe-commits
@@ -0,0 +1,144 @@ +//===-- TargetVerifier.cpp - LLVM IR Target Verifier *- C++ -*-===// + +/ Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +/ See https://llvm.org/LICENSE.txt for license information. +/ SPDX-License

[clang] [flang] [llvm] [TargetVerifier][AMDGPU] Add TargetVerifier. (PR #123609)

2025-04-29 Thread Shilei Tian via cfe-commits
@@ -172,6 +172,13 @@ class PassBuilder { /// additional analyses. void registerLoopAnalyses(LoopAnalysisManager &LAM); + /// Registers all available verifier passes. + /// + /// This is an interface that can be used to populate a + /// \c ModuleAnalysisManager with all

[clang] [flang] [llvm] [TargetVerifier][AMDGPU] Add TargetVerifier. (PR #123609)

2025-04-29 Thread Shilei Tian via cfe-commits
@@ -0,0 +1,34 @@ +set(LLVM_LINK_COMPONENTS shiltian wrote: I don't know why we want a dedicated tool for this https://github.com/llvm/llvm-project/pull/123609 ___ cfe-commits mailing list cfe-commits@lists.llvm.org htt

[clang] [flang] [llvm] [TargetVerifier][AMDGPU] Add TargetVerifier. (PR #123609)

2025-04-29 Thread Shilei Tian via cfe-commits
@@ -841,6 +857,11 @@ class PassBuilder { // Callbacks to parse `filter` parameter in register allocation passes SmallVector, 2> RegClassFilterParsingCallbacks; + // Verifier callbacks + SmallVector, 2> + VerifierCallbacks; + SmallVector, 2> + FnVerifierCa

[clang] [flang] [llvm] [TargetVerifier][AMDGPU] Add TargetVerifier. (PR #123609)

2025-04-29 Thread Shilei Tian via cfe-commits
@@ -0,0 +1,84 @@ +//===-- llvm/Target/TargetVerifier.h - LLVM IR Target Verifier ---*- C++ -*-===// shiltian wrote: What's the value of this interface class instead of just making those target verifier a module/function pass? https://github.com/llvm/llvm-proje

[clang] [llvm] [clang][amdgpu] Add builtins for raw/struct buffer lds load (PR #137678)

2025-04-29 Thread Shilei Tian via cfe-commits
@@ -0,0 +1,12 @@ +// RUN: %clang_cc1 -triple amdgcn-unknown-unknown -target-cpu tahiti -S -verify -o - %s +// RUN: %clang_cc1 -triple amdgcn-unknown-unknown -target-cpu bonaire -S -verify -o - %s +// RUN: %clang_cc1 -triple amdgcn-unknown-unknown -target-cpu carrizo -S -verify

[clang] [llvm] [clang][amdgpu] Add builtins for raw/struct buffer lds load (PR #137678)

2025-04-28 Thread Shilei Tian via cfe-commits
@@ -0,0 +1,12 @@ +// RUN: %clang_cc1 -triple amdgcn-unknown-unknown -target-cpu tahiti -S -verify -o - %s +// RUN: %clang_cc1 -triple amdgcn-unknown-unknown -target-cpu bonaire -S -verify -o - %s +// RUN: %clang_cc1 -triple amdgcn-unknown-unknown -target-cpu carrizo -S -verify

[clang] [llvm] [clang][amdgpu] Add builtins for raw/struct buffer lds load (PR #137678)

2025-04-28 Thread Shilei Tian via cfe-commits
@@ -0,0 +1,12 @@ +// RUN: %clang_cc1 -triple amdgcn-unknown-unknown -target-cpu tahiti -S -verify -o - %s +// RUN: %clang_cc1 -triple amdgcn-unknown-unknown -target-cpu bonaire -S -verify -o - %s +// RUN: %clang_cc1 -triple amdgcn-unknown-unknown -target-cpu carrizo -S -verify

[clang] [llvm] [clang][amdgpu] Add builtins for raw/struct buffer lds load (PR #137678)

2025-04-28 Thread Shilei Tian via cfe-commits
shiltian wrote: Isn't it similar to what @krzysz00 is doing in another PR to some extent? https://github.com/llvm/llvm-project/pull/137678 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commi

[clang] [AMDGPU] Support the OpenCL generic addrspace feature by default (PR #137636)

2025-04-28 Thread Shilei Tian via cfe-commits
@@ -146,3 +146,8 @@ #pragma OPENCL EXTENSION cl_khr_subgroups: enable // expected-warning@-1{{unsupported OpenCL extension 'cl_khr_subgroups' - ignoring}} +#ifdef __opencl_c_generic_address_space +#error "Incorrect __opencl_c_generic_address_space define" shi

[clang] [llvm] [mlir] [AMDGPU] Add a new amdgcn.load.to.lds intrinsic (PR #137425)

2025-04-26 Thread Shilei Tian via cfe-commits
@@ -0,0 +1,75 @@ +; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py UTC_ARGS: --version 5 +; RUN: llc -global-isel=0 -mtriple=amdgcn -mcpu=gfx950 < %s | FileCheck -check-prefixes=GFX950,GFX950-SDAG %s +; RUN: llc -global-isel=1 -mtriple=amdgcn -mcpu=g

[clang] [llvm] [mlir] [AMDGPU] Add a new amdgcn.load.to.lds intrinsic (PR #137425)

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

[clang] [llvm] [mlir] [AMDGPU] Add a new amdgcn.load.to.lds intrinsic (PR #137425)

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

[clang] [flang] [llvm] [TargetVerifier][AMDGPU] Add TargetVerifier. (PR #123609)

2025-04-26 Thread Shilei Tian via cfe-commits
@@ -0,0 +1,144 @@ +//===-- TargetVerifier.cpp - LLVM IR Target Verifier *- C++ -*-===// + +/ Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +/ See https://llvm.org/LICENSE.txt for license information. +/ SPDX-License

[clang] [Clang] Disable RTTI for offloading at the frontend level (PR #127082)

2025-04-25 Thread Shilei Tian via cfe-commits
https://github.com/shiltian approved this pull request. The AMDGPU part looks good. Not sure if CUDA supports it. @Artem-B https://github.com/llvm/llvm-project/pull/127082 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/c

[clang] [Clang][NFC] Move OffloadArch enum to a generic location (PR #137070)

2025-04-24 Thread Shilei Tian via cfe-commits
https://github.com/shiltian edited https://github.com/llvm/llvm-project/pull/137070 ___ 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 #131838)

2025-04-23 Thread Shilei Tian via cfe-commits
@@ -423,8 +423,8 @@ static void instantiateOMPDeclareVariantAttr( auto *FD = cast(New); auto *ThisContext = dyn_cast_or_null(FD->getDeclContext()); - auto &&SubstExpr = [FD, ThisContext, &S, &TemplateArgs](Expr *E) { -if (auto *DRE = dyn_cast(E->IgnoreParenImpCasts())

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

2025-04-23 Thread Shilei Tian via cfe-commits
shiltian wrote: Hmm, this PR is much shorter than it used to be. https://github.com/llvm/llvm-project/pull/131838 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [TargetVerifier][AMDGPU] Add TargetVerifier. (PR #123609)

2025-04-21 Thread Shilei Tian via cfe-commits
@@ -0,0 +1,175 @@ +//===--- llvm-isel-fuzzer.cpp - Fuzzer for instruction selection --===// shiltian wrote: also, I wonder why do we need an extra binary for this? https://github.com/llvm/llvm-project/pull/123609

[clang] [llvm] [TargetVerifier][AMDGPU] Add TargetVerifier. (PR #123609)

2025-04-21 Thread Shilei Tian via cfe-commits
@@ -0,0 +1,175 @@ +//===--- llvm-isel-fuzzer.cpp - Fuzzer for instruction selection --===// shiltian wrote: the file name doesn't match the actual file name https://github.com/llvm/llvm-project/pull/123609 ___

[clang] [llvm] [TargetVerifier][AMDGPU] Add TargetVerifier. (PR #123609)

2025-04-21 Thread Shilei Tian via cfe-commits
@@ -0,0 +1,175 @@ +#include "llvm/Target/TargetVerify/AMDGPUTargetVerifier.h" shiltian wrote: This file doesn't have LLVM copyright header https://github.com/llvm/llvm-project/pull/123609 ___ cfe-commits mailing list c

[clang] [llvm] [TargetVerifier][AMDGPU] Add TargetVerifier. (PR #123609)

2025-04-21 Thread Shilei Tian via cfe-commits
@@ -2040,6 +2043,8 @@ void AMDGPUCodeGenPassBuilder::addIRPasses(AddIRPass &addPass) const { // but EarlyCSE can do neither of them. if (isPassEnabled(EnableScalarIRPasses)) addEarlyCSEOrGVNPass(addPass); + + addPass(AMDGPUTargetVerifierPass()); shilt

[clang] [llvm] [TargetVerifier][AMDGPU] Add TargetVerifier. (PR #123609)

2025-04-21 Thread Shilei Tian via cfe-commits
@@ -1298,6 +1299,8 @@ void AMDGPUPassConfig::addIRPasses() { addPass(createLICMPass()); } + //addPass(AMDGPUTargetVerifierPass()); shiltian wrote: left over https://github.com/llvm/llvm-project/pull/123609 ___

  1   2   3   4   5   6   7   8   9   10   >