[clang] [llvm] [AMDGPU] Change CF intrinsics lowering to reconverge on predecessors. (PR #92809)

2024-06-17 Thread Matt Arsenault via cfe-commits
@@ -3172,8 +3172,8 @@ def int_amdgcn_loop : Intrinsic<[llvm_i1_ty], [llvm_anyint_ty], [IntrWillReturn, IntrNoCallback, IntrNoFree] >; -def int_amdgcn_end_cf : Intrinsic<[], [llvm_anyint_ty], - [IntrWillReturn, IntrNoCallback, IntrNoFree]>; +def int_amdgcn_wave_reconverge :

[clang] [llvm] [AMDGPU] Change CF intrinsics lowering to reconverge on predecessors. (PR #92809)

2024-06-17 Thread Matt Arsenault via cfe-commits
@@ -1,3 +1,4 @@ +; XFAIL: * arsenm wrote: can't just xfail tests https://github.com/llvm/llvm-project/pull/92809 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/

[clang] [llvm] [AMDGPU] Change CF intrinsics lowering to reconverge on predecessors. (PR #92809)

2024-06-17 Thread Matt Arsenault via cfe-commits
@@ -2103,12 +2103,36 @@ bool SIInstrInfo::expandPostRAPseudo(MachineInstr &MI) const { MI.setDesc(get(AMDGPU::S_MOV_B64)); break; + case AMDGPU::S_CMOV_B64_term: +// This is only a terminator to get the correct spill code placement during +// register allocat

[clang] [llvm] [AMDGPU] Change CF intrinsics lowering to reconverge on predecessors. (PR #92809)

2024-06-17 Thread Matt Arsenault via cfe-commits
@@ -15740,6 +15740,32 @@ void SITargetLowering::finalizeLowering(MachineFunction &MF) const { } } + // ISel inserts copy to regs for the successor PHIs + // at the BB end. We need to move the SI_WAVE_RECONVERGE right before the arsenm wrote: Can you

[clang] [llvm] [AMDGPU] Change CF intrinsics lowering to reconverge on predecessors. (PR #92809)

2024-06-17 Thread Matt Arsenault via cfe-commits
@@ -0,0 +1 @@ +remark: :0:0: removing function 'needs_extimg': +extended-image-insts is not supported on the current target arsenm wrote: accidentally added file? https://github.com/llvm/llvm-project/pull/92809 ___ c

[clang] [llvm] [AMDGPU] Change CF intrinsics lowering to reconverge on predecessors. (PR #92809)

2024-06-17 Thread Matt Arsenault via cfe-commits
@@ -305,43 +304,43 @@ bool SIAnnotateControlFlow::handleLoop(BranchInst *Term) { } /// Close the last opened control flow -bool SIAnnotateControlFlow::closeControlFlow(BasicBlock *BB) { - llvm::Loop *L = LI->getLoopFor(BB); +bool SIAnnotateControlFlow::tryWaveReconverge(Basic

[clang] [Clang] disallow non-lvalue values in constant expressions to prevent invalid pointer offset computation (PR #95479)

2024-06-17 Thread via cfe-commits
https://github.com/Sirraide closed https://github.com/llvm/llvm-project/pull/95479 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] 2ebe479 - [Clang] Disallow non-lvalue values in constant expressions to prevent invalid pointer offset computation (#95479)

2024-06-17 Thread via cfe-commits
Author: Oleksandr T Date: 2024-06-17T19:29:28+02:00 New Revision: 2ebe4794b1bdb3519d5dda7ef39f32d868dfa9b0 URL: https://github.com/llvm/llvm-project/commit/2ebe4794b1bdb3519d5dda7ef39f32d868dfa9b0 DIFF: https://github.com/llvm/llvm-project/commit/2ebe4794b1bdb3519d5dda7ef39f32d868dfa9b0.diff L

[clang] 4447e25 - [NFC] Refactor `[[nodiscard]]` test to not use macros and run under `-pedantic` (#95762)

2024-06-17 Thread via cfe-commits
Author: Mital Ashok Date: 2024-06-17T19:30:17+02:00 New Revision: 4447e255a908c4e1a2863374eaee4bc98e773c3d URL: https://github.com/llvm/llvm-project/commit/4447e255a908c4e1a2863374eaee4bc98e773c3d DIFF: https://github.com/llvm/llvm-project/commit/4447e255a908c4e1a2863374eaee4bc98e773c3d.diff L

[clang] [NFC] Refactor `[[nodiscard]]` test to not use macros and run under `-pedantic` (PR #95762)

2024-06-17 Thread via cfe-commits
https://github.com/Sirraide closed https://github.com/llvm/llvm-project/pull/95762 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] 3ad31e1 - [Clang] Introduce `CXXTypeidExpr::hasNullCheck` (#95718)

2024-06-17 Thread via cfe-commits
Author: Mital Ashok Date: 2024-06-17T19:31:54+02:00 New Revision: 3ad31e12ccfc7db25f3cbedc4ee966e7099ac78f URL: https://github.com/llvm/llvm-project/commit/3ad31e12ccfc7db25f3cbedc4ee966e7099ac78f DIFF: https://github.com/llvm/llvm-project/commit/3ad31e12ccfc7db25f3cbedc4ee966e7099ac78f.diff L

[clang] [Clang] Introduce `CXXTypeidExpr::hasNullCheck` (PR #95718)

2024-06-17 Thread via cfe-commits
https://github.com/Sirraide closed https://github.com/llvm/llvm-project/pull/95718 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang][Driver] Expose `-fno-eliminate-unused-debug-types` to clang-cl (PR #95259)

2024-06-17 Thread Amy Huang via cfe-commits
amykhuang wrote: Yes, feel free to take over that part, thanks! https://github.com/llvm/llvm-project/pull/95259 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Driver][Fuchsia] Support multilib for C++ include dir (PR #95815)

2024-06-17 Thread Petr Hosek via cfe-commits
https://github.com/petrhosek created https://github.com/llvm/llvm-project/pull/95815 We generate a separate `__config_site` for each multilib and thus need to add the additional include dir if it exists. >From cbd278fe0e49e5297f3d48d5e14f012a81fce570 Mon Sep 17 00:00:00 2001 From: Petr Hosek

[clang] [Driver][Fuchsia] Support multilib for C++ include dir (PR #95815)

2024-06-17 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: Petr Hosek (petrhosek) Changes We generate a separate `__config_site` for each multilib and thus need to add the additional include dir if it exists. --- Full diff: https://github.com/llvm/llvm-project/pull/95815.diff 24 Files Affected:

[clang] [Clang] skip alignment checks on incomplete types to avoid an assertion failure while parsing lambda used as default argument (PR #94542)

2024-06-17 Thread Aaron Ballman via cfe-commits
https://github.com/AaronBallman approved this pull request. LGTM https://github.com/llvm/llvm-project/pull/94542 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] skip alignment checks on incomplete types to avoid an assertion failure while parsing lambda used as default argument (PR #94542)

2024-06-17 Thread Aaron Ballman via cfe-commits
https://github.com/AaronBallman edited https://github.com/llvm/llvm-project/pull/94542 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-tools-extra] [llvm] [mlir] [clang][lldb][mlir] Fix some identical sub-expressions warnings (NFC) (PR #95715)

2024-06-17 Thread Aaron Ballman via cfe-commits
AaronBallman wrote: Note, this fixes #95670 https://github.com/llvm/llvm-project/pull/95715 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-tools-extra] [llvm] [mlir] [clang][lldb][mlir] Fix some identical sub-expressions warnings (NFC) (PR #95715)

2024-06-17 Thread Aaron Ballman via cfe-commits
@@ -430,11 +430,10 @@ class HTMLLogger : public Logger { AST.getSourceManager(), AST.getLangOpts()); if (EltRange.isInvalid()) continue; - if (EltRange.getBegin() < Range.getBegin() || - EltRange.getEnd() >= Range.getEnd

[clang] [clang-tools-extra] [llvm] [mlir] [clang][lldb][mlir] Fix some identical sub-expressions warnings (NFC) (PR #95715)

2024-06-17 Thread Aaron Ballman via cfe-commits
@@ -4368,7 +4368,7 @@ bool Sema::DiagRedefinedPlaceholderFieldDecl(SourceLocation Loc, Diag(Loc, diag::err_using_placeholder_variable) << Name; for (DeclContextLookupResult::iterator It = Found; It != Result.end(); It++) { const NamedDecl *ND = *It; -if (ND->getDe

[clang] [clang-tools-extra] [llvm] [mlir] [clang][lldb][mlir] Fix some identical sub-expressions warnings (NFC) (PR #95715)

2024-06-17 Thread Aaron Ballman via cfe-commits
@@ -96,7 +96,7 @@ bool areStatementsIdentical(const Stmt *FirstStmt, const Stmt *SecondStmt, if (FirstStmt == SecondStmt) return true; - if (FirstStmt->getStmtClass() != FirstStmt->getStmtClass()) + if (FirstStmt->getStmtClass() != SecondStmt->getStmtClass())

[clang] [clang-tools-extra] [llvm] [mlir] [clang][lldb][mlir] Fix some identical sub-expressions warnings (NFC) (PR #95715)

2024-06-17 Thread Arjun P via cfe-commits
@@ -104,8 +104,9 @@ Simplex::Unknown &SimplexBase::unknownFromRow(unsigned row) { unsigned SimplexBase::addZeroRow(bool makeRestricted) { // Resize the tableau to accommodate the extra row. + unsigned oldNumRows = getNumRows(); unsigned newRow = tableau.appendExtraRow()

[clang] [clang-tools-extra] [llvm] [mlir] [clang][lldb][mlir] Fix some identical sub-expressions warnings (NFC) (PR #95715)

2024-06-17 Thread Arjun P via cfe-commits
@@ -104,8 +104,9 @@ Simplex::Unknown &SimplexBase::unknownFromRow(unsigned row) { unsigned SimplexBase::addZeroRow(bool makeRestricted) { // Resize the tableau to accommodate the extra row. + unsigned oldNumRows = getNumRows(); unsigned newRow = tableau.appendExtraRow()

[clang] [HLSL] Strict Availability Diagnostics (PR #93860)

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

[clang-tools-extra] Enforce SL.con.3: Add check to replace operator[] with at() [Cont.] (PR #95220)

2024-06-17 Thread Carlos Galvez via cfe-commits
Paul =?utf-8?q?Heidekr=C3=BCger?= , Paul =?utf-8?q?Heidekr=C3=BCger?= , Paul =?utf-8?q?Heidekr=C3=BCger?= , Paul =?utf-8?q?Heidekr=C3=BCger?= , Paul =?utf-8?q?Heidekr=C3=BCger?= , Paul =?utf-8?q?Heidekr=C3=BCger?= , Paul =?utf-8?q?Heidekr=C3=BCger?= , Paul =?utf-8?q?Heidekr=C3=BCger?= , Paul =?utf-

[clang] [Driver][Fuchsia] Support multilib for C++ include dir (PR #95815)

2024-06-17 Thread via cfe-commits
https://github.com/PiJoules approved this pull request. https://github.com/llvm/llvm-project/pull/95815 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-tools-extra] [llvm] [mlir] [clang][lldb][mlir] Fix some identical sub-expressions warnings (NFC) (PR #95715)

2024-06-17 Thread Arjun P via cfe-commits
https://github.com/Superty edited https://github.com/llvm/llvm-project/pull/95715 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang][AMDGPU] Add a new builtin type for buffer rsrc (PR #94830)

2024-06-17 Thread Shilei Tian via cfe-commits
https://github.com/shiltian updated https://github.com/llvm/llvm-project/pull/94830 >From 1751b9ed484e88213ba56be9961769bcabf085be Mon Sep 17 00:00:00 2001 From: Shilei Tian Date: Mon, 17 Jun 2024 14:23:00 -0400 Subject: [PATCH] [Clang][AMDGPU] Add a new builtin type for buffer rsrc --- clang

[clang] [Clang][AMDGPU] Add a new builtin type for buffer rsrc (PR #94830)

2024-06-17 Thread Shilei Tian via cfe-commits
https://github.com/shiltian updated https://github.com/llvm/llvm-project/pull/94830 >From 15347886bf3327d1a23a2caa65f58cba7ef86fe5 Mon Sep 17 00:00:00 2001 From: Shilei Tian Date: Mon, 17 Jun 2024 14:27:09 -0400 Subject: [PATCH] [Clang][AMDGPU] Add a new builtin type for buffer rsrc --- clang

[clang] [Clang][AMDGPU] Add a new builtin type for buffer rsrc (PR #94830)

2024-06-17 Thread Shilei Tian via cfe-commits
@@ -0,0 +1,17 @@ +// REQUIRES: amdgpu-registered-target +// RUN: %clang_cc1 -fsyntax-only -verify -std=gnu++11 -triple amdgcn -Wno-unused-value %s + shiltian wrote: TBH I don't think there is any difference but I added them anyway. https://github.com/llvm/llvm-

[clang] [lldb] [clang][AST] fix ast-print of extern with >=2 declarators, fixed (PR #93913)

2024-06-17 Thread Aaron Ballman via cfe-commits
@@ -6286,7 +6286,7 @@ static FunctionDecl *rewriteBuiltinFunctionDecl(Sema *Sema, ASTContext &Context, FunctionDecl *OverloadDecl = FunctionDecl::Create( Context, Parent, FDecl->getLocation(), FDecl->getLocation(), FDecl->getIdentifier(), OverloadTy, - /*TIn

[clang] [lldb] [clang][AST] fix ast-print of extern with >=2 declarators, fixed (PR #93913)

2024-06-17 Thread Aaron Ballman via cfe-commits
@@ -576,13 +576,19 @@ template static bool isFirstInExternCContext(T *D) { return First->isInExternCContext(); } -static bool isSingleLineLanguageLinkage(const Decl &D) { - if (const auto *SD = dyn_cast(D.getDeclContext())) +static bool isUnbracedLanguageLinkage(const Dec

[clang] [lldb] [clang][AST] fix ast-print of extern with >=2 declarators, fixed (PR #93913)

2024-06-17 Thread Aaron Ballman via cfe-commits
@@ -2380,7 +2380,7 @@ FunctionDecl *Sema::CreateBuiltin(IdentifierInfo *II, QualType Type, } FunctionDecl *New = FunctionDecl::Create(Context, Parent, Loc, Loc, II, Type, - /*TInfo=*/nullptr, SC_Extern, +

[clang] 7439072 - [Driver][Fuchsia] Support multilib for C++ include dir (#95815)

2024-06-17 Thread via cfe-commits
Author: Petr Hosek Date: 2024-06-17T11:41:00-07:00 New Revision: 7439072289f41d46d563763509d5d0d0cb62f3a0 URL: https://github.com/llvm/llvm-project/commit/7439072289f41d46d563763509d5d0d0cb62f3a0 DIFF: https://github.com/llvm/llvm-project/commit/7439072289f41d46d563763509d5d0d0cb62f3a0.diff LO

[clang] [Driver][Fuchsia] Support multilib for C++ include dir (PR #95815)

2024-06-17 Thread Petr Hosek via cfe-commits
https://github.com/petrhosek closed https://github.com/llvm/llvm-project/pull/95815 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-tools-extra] [llvm] [mlir] [clang][lldb][mlir] Fix some identical sub-expressions warnings (NFC) (PR #95715)

2024-06-17 Thread Shivam Gupta via cfe-commits
https://github.com/xgupta updated https://github.com/llvm/llvm-project/pull/95715 >From f80cc3b6ee218e954d68e867637c38211f344d83 Mon Sep 17 00:00:00 2001 From: Shivam Gupta Date: Sun, 16 Jun 2024 23:39:47 +0530 Subject: [PATCH 1/2] [clang][lldb][mlir] Fix some identical sub-expressions warning

[clang] [clang-tools-extra] [llvm] [mlir] [clang][lldb][mlir] Fix some identical sub-expressions warnings (NFC) (PR #95715)

2024-06-17 Thread Shivam Gupta via cfe-commits
https://github.com/xgupta updated https://github.com/llvm/llvm-project/pull/95715 >From f80cc3b6ee218e954d68e867637c38211f344d83 Mon Sep 17 00:00:00 2001 From: Shivam Gupta Date: Sun, 16 Jun 2024 23:39:47 +0530 Subject: [PATCH 1/3] [clang][lldb][mlir] Fix some identical sub-expressions warning

[clang] [HLSL] Change default linkage of HLSL functions and `groupshared` variables (PR #93336)

2024-06-17 Thread Damyan Pepper via cfe-commits
@@ -108,3 +108,16 @@ behavior between Clang and DXC. Some examples include: diagnostic notifying the user of the conversion rather than silently altering precision relative to the other overloads (as FXC does) or generating code that will fail validation (as DXC does). +

[clang] [HLSL] Change default linkage of HLSL functions and `groupshared` variables (PR #93336)

2024-06-17 Thread Damyan Pepper via cfe-commits
https://github.com/damyanp approved this pull request. https://github.com/llvm/llvm-project/pull/93336 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [lldb] [clang][AST] fix ast-print of extern with >=2 declarators, fixed (PR #93913)

2024-06-17 Thread Artem Yurchenko via cfe-commits
@@ -2380,7 +2380,7 @@ FunctionDecl *Sema::CreateBuiltin(IdentifierInfo *II, QualType Type, } FunctionDecl *New = FunctionDecl::Create(Context, Parent, Loc, Loc, II, Type, - /*TInfo=*/nullptr, SC_Extern, +

[clang] [Clang] skip alignment checks on incomplete types to avoid an assertion failure while parsing lambda used as default argument (PR #94542)

2024-06-17 Thread Oleksandr T. via cfe-commits
https://github.com/a-tarasyuk updated https://github.com/llvm/llvm-project/pull/94542 >From da4df73607a9edefc8db721818eff50e974a0637 Mon Sep 17 00:00:00 2001 From: Oleksandr T Date: Thu, 6 Jun 2024 01:55:54 +0300 Subject: [PATCH] [Clang] skip alignment checks on incomplete types to avoid an as

[clang] [lldb] [clang][AST] fix ast-print of extern with >=2 declarators, fixed (PR #93913)

2024-06-17 Thread Artem Yurchenko via cfe-commits
@@ -576,13 +576,19 @@ template static bool isFirstInExternCContext(T *D) { return First->isInExternCContext(); } -static bool isSingleLineLanguageLinkage(const Decl &D) { - if (const auto *SD = dyn_cast(D.getDeclContext())) +static bool isUnbracedLanguageLinkage(const Dec

[clang] [Clang] skip alignment checks on incomplete types to avoid an assertion failure while parsing lambda used as default argument (PR #94542)

2024-06-17 Thread Oleksandr T. via cfe-commits
https://github.com/a-tarasyuk updated https://github.com/llvm/llvm-project/pull/94542 >From da4df73607a9edefc8db721818eff50e974a0637 Mon Sep 17 00:00:00 2001 From: Oleksandr T Date: Thu, 6 Jun 2024 01:55:54 +0300 Subject: [PATCH] [Clang] skip alignment checks on incomplete types to avoid an as

[clang] [lldb] [clang][AST] fix ast-print of extern with >=2 declarators, fixed (PR #93913)

2024-06-17 Thread Artem Yurchenko via cfe-commits
https://github.com/temyurchenko updated https://github.com/llvm/llvm-project/pull/93913 >From 410c7ba9fb7667dabdfbc48fdbda427401ca8df0 Mon Sep 17 00:00:00 2001 From: Artem Yurchenko <44875844+temyurche...@users.noreply.github.com> Date: Thu, 30 May 2024 16:18:47 -0400 Subject: [PATCH 1/3] [clang

[clang] [Clang][AMDGPU] Add a new builtin type for buffer rsrc (PR #94830)

2024-06-17 Thread Matt Arsenault via cfe-commits
@@ -0,0 +1,11 @@ +// REQUIRES: amdgpu-registered-target +// RUN: %clang_cc1 -verify -triple amdgcn-amd-amdhsa -Wno-unused-value %s arsenm wrote: set explicit -cl-std, and check 1.2 and 2.0? https://github.com/llvm/llvm-project/pull/94830 ___

[clang] [Clang][AMDGPU] Add a new builtin type for buffer rsrc (PR #94830)

2024-06-17 Thread Shilei Tian via cfe-commits
https://github.com/shiltian updated https://github.com/llvm/llvm-project/pull/94830 >From bc137f40cd524c47094ce39ec4e4d567283fc2da Mon Sep 17 00:00:00 2001 From: Shilei Tian Date: Mon, 17 Jun 2024 15:19:39 -0400 Subject: [PATCH] [Clang][AMDGPU] Add a new builtin type for buffer rsrc --- clang

[clang] [lldb] [clang][AST] fix ast-print of extern with >=2 declarators, fixed (PR #93913)

2024-06-17 Thread Aaron Ballman via cfe-commits
@@ -2380,7 +2380,7 @@ FunctionDecl *Sema::CreateBuiltin(IdentifierInfo *II, QualType Type, } FunctionDecl *New = FunctionDecl::Create(Context, Parent, Loc, Loc, II, Type, - /*TInfo=*/nullptr, SC_Extern, +

[clang] [Clang] [WIP] Added builtin_alloca support for OpenCL1.2 and below (PR #95750)

2024-06-17 Thread Vikash Gupta via cfe-commits
https://github.com/vg0204 updated https://github.com/llvm/llvm-project/pull/95750 >From 04ff7bd289d0840b8aa2b0502e4ac050174c95ab Mon Sep 17 00:00:00 2001 From: vg0204 Date: Mon, 17 Jun 2024 11:20:02 +0530 Subject: [PATCH 1/2] [Clang] [WIP] Added builtin_alloca support for OpenCL1.2 and below

[clang] [Clang][AMDGPU] Add a new builtin type for buffer rsrc (PR #94830)

2024-06-17 Thread Shilei Tian via cfe-commits
https://github.com/shiltian updated https://github.com/llvm/llvm-project/pull/94830 >From 913d0761133b5f6f7785e04b23d0a8744e140842 Mon Sep 17 00:00:00 2001 From: Shilei Tian Date: Mon, 17 Jun 2024 15:29:47 -0400 Subject: [PATCH] [Clang][AMDGPU] Add a new builtin type for buffer rsrc --- clang

[clang] [lldb] [clang][AST] fix ast-print of extern with >=2 declarators, fixed (PR #93913)

2024-06-17 Thread Artem Yurchenko via cfe-commits
@@ -2380,7 +2380,7 @@ FunctionDecl *Sema::CreateBuiltin(IdentifierInfo *II, QualType Type, } FunctionDecl *New = FunctionDecl::Create(Context, Parent, Loc, Loc, II, Type, - /*TInfo=*/nullptr, SC_Extern, +

[clang] [clang] Fix-it hint for `++this` -> `++*this` when deref is modifiable (PR #94159)

2024-06-17 Thread Richard Smith via cfe-commits
https://github.com/zygoloid edited https://github.com/llvm/llvm-project/pull/94159 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] Fix-it hint for `++this` -> `++*this` when deref is modifiable (PR #94159)

2024-06-17 Thread Richard Smith via cfe-commits
https://github.com/zygoloid commented: I have some significant concerns about the approach of this PR. It seems to be producing notes that in a lot of cases suggest doing something that doesn't make sense or won't compile, and tentatively building a `*p` expression is unsafe. Can we revert an

[clang] [clang] Fix-it hint for `++this` -> `++*this` when deref is modifiable (PR #94159)

2024-06-17 Thread Richard Smith via cfe-commits
@@ -0,0 +1,49 @@ +// RUN: %clang_cc1 -std=c++23 -fsyntax-only -verify %s + +struct S { + void f() { +++this; // expected-error {{expression is not assignable}} +// expected-note@-1 {{add '*' to dereference it}} zygoloid wrote: This is a bad diagnostic ch

[clang] [clang] Fix-it hint for `++this` -> `++*this` when deref is modifiable (PR #94159)

2024-06-17 Thread Richard Smith via cfe-commits
@@ -65,8 +65,10 @@ void test4(void) { void test5(int *X, float *P) { (float*)X = P; // expected-error {{assignment to cast is illegal, lvalue casts are not supported}} + // expected-note@-1 {{add '*' to dereference it}} #define FOO ((float*) X) FOO = P; // expected

[clang] [clang] Fix-it hint for `++this` -> `++*this` when deref is modifiable (PR #94159)

2024-06-17 Thread Richard Smith via cfe-commits
@@ -13273,6 +13273,23 @@ enum { ConstUnknown, // Keep as last element }; +static void MaybeSuggestDerefFixIt(Sema &S, const Expr *E, SourceLocation Loc) { + ExprResult Deref; + Expr *TE = const_cast(E); + { +Sema::TentativeAnalysisScope Trap(S); +Deref = S.ActOn

[clang] [clang] Fix-it hint for `++this` -> `++*this` when deref is modifiable (PR #94159)

2024-06-17 Thread Richard Smith via cfe-commits
@@ -0,0 +1,49 @@ +// RUN: %clang_cc1 -std=c++23 -fsyntax-only -verify %s + +struct S { + void f() { +++this; // expected-error {{expression is not assignable}} +// expected-note@-1 {{add '*' to dereference it}} + } + + void g() const { +++this; // expected-error {{e

[clang] [clang] Fix-it hint for `++this` -> `++*this` when deref is modifiable (PR #94159)

2024-06-17 Thread Richard Smith via cfe-commits
@@ -65,8 +65,10 @@ void test4(void) { void test5(int *X, float *P) { (float*)X = P; // expected-error {{assignment to cast is illegal, lvalue casts are not supported}} + // expected-note@-1 {{add '*' to dereference it}} zygoloid wrote: This is a diagnos

[clang] [clang] Fix-it hint for `++this` -> `++*this` when deref is modifiable (PR #94159)

2024-06-17 Thread Richard Smith via cfe-commits
@@ -13273,6 +13273,23 @@ enum { ConstUnknown, // Keep as last element }; +static void MaybeSuggestDerefFixIt(Sema &S, const Expr *E, SourceLocation Loc) { + ExprResult Deref; + Expr *TE = const_cast(E); + { +Sema::TentativeAnalysisScope Trap(S); +Deref = S.ActOn

[clang] [Clang][AMDGPU] Add a new builtin type for buffer rsrc (PR #94830)

2024-06-17 Thread Matt Arsenault via cfe-commits
https://github.com/arsenm approved this pull request. LGTM but I'm not a frontend expert https://github.com/llvm/llvm-project/pull/94830 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commit

[clang] [Clang][AMDGPU] Add a new builtin type for buffer rsrc (PR #94830)

2024-06-17 Thread Shilei Tian via cfe-commits
shiltian wrote: @yxsamliu https://github.com/llvm/llvm-project/pull/94830 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] [WIP] Added builtin_alloca support for OpenCL1.2 and below (PR #95750)

2024-06-17 Thread Vikash Gupta via cfe-commits
https://github.com/vg0204 updated https://github.com/llvm/llvm-project/pull/95750 >From 04ff7bd289d0840b8aa2b0502e4ac050174c95ab Mon Sep 17 00:00:00 2001 From: vg0204 Date: Mon, 17 Jun 2024 11:20:02 +0530 Subject: [PATCH 1/2] [Clang] [WIP] Added builtin_alloca support for OpenCL1.2 and below

[clang] [clang-tools-extra] [Clang] Implement CWG2813: Class member access with prvalues (PR #95112)

2024-06-17 Thread Mital Ashok via cfe-commits
https://github.com/MitalAshok updated https://github.com/llvm/llvm-project/pull/95112 >From e53dfbc9b2c6b7f30c1378731d7de284fa99d568 Mon Sep 17 00:00:00 2001 From: Mital Ashok Date: Tue, 11 Jun 2024 14:26:38 +0100 Subject: [PATCH 1/6] [Clang] Implement CWG2813 --- clang/docs/ReleaseNotes.rst

[clang] [clang] Fix-it hint for `++this` -> `++*this` when deref is modifiable (PR #94159)

2024-06-17 Thread via cfe-commits
Sirraide wrote: > Can we revert and consider other approaches? Yeah, a lot of the points you’ve brought up make sense, and if you’re saying it’s a bad idea then I’ll trust you and revert this for now so we can think about this some more... Also, I suppose part of the issue for me at least wa

[clang] Revert "[clang] Fix-it hint for `++this` -> `++*this` when deref is modifiable" (PR #95833)

2024-06-17 Thread via cfe-commits
https://github.com/Sirraide created https://github.com/llvm/llvm-project/pull/95833 Reverts llvm/llvm-project#94159 @zygoloid had some concerns about the implementation of this, which make sense to me, so I’d like to revert this for now so we can have more time to think about how to best appr

[clang] Revert "[clang] Fix-it hint for `++this` -> `++*this` when deref is modifiable" (PR #95833)

2024-06-17 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: None (Sirraide) Changes Reverts llvm/llvm-project#94159 @zygoloid had some concerns about the implementation of this, which make sense to me, so I’d like to revert this for now so we can have more time to think about how to best approach

[clang] [clang-tools-extra] [Clang] Implement CWG2813: Class member access with prvalues (PR #95112)

2024-06-17 Thread via cfe-commits
github-actions[bot] wrote: :warning: C/C++ code formatter, clang-format found issues in your code. :warning: You can test this locally with the following command: ``bash git-clang-format --diff c22d3917b93a6d54613d2e5b2ea4c97546144c46 37f24484fcb0a71cef93928ab2f8e6c689c34868 --

[clang] [lldb] [clang][AST] fix ast-print of extern with >=2 declarators, fixed (PR #93913)

2024-06-17 Thread Artem Yurchenko via cfe-commits
@@ -2380,7 +2380,7 @@ FunctionDecl *Sema::CreateBuiltin(IdentifierInfo *II, QualType Type, } FunctionDecl *New = FunctionDecl::Create(Context, Parent, Loc, Loc, II, Type, - /*TInfo=*/nullptr, SC_Extern, +

[clang] [lldb] [clang][AST] fix ast-print of extern with >=2 declarators, fixed (PR #93913)

2024-06-17 Thread Artem Yurchenko via cfe-commits
https://github.com/temyurchenko edited https://github.com/llvm/llvm-project/pull/93913 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-tools-extra] [Clang] Implement CWG2813: Class member access with prvalues (PR #95112)

2024-06-17 Thread Mital Ashok via cfe-commits
https://github.com/MitalAshok updated https://github.com/llvm/llvm-project/pull/95112 >From e53dfbc9b2c6b7f30c1378731d7de284fa99d568 Mon Sep 17 00:00:00 2001 From: Mital Ashok Date: Tue, 11 Jun 2024 14:26:38 +0100 Subject: [PATCH 1/5] [Clang] Implement CWG2813 --- clang/docs/ReleaseNotes.rst

[clang] [Clang] [WIP] Added builtin_alloca support for OpenCL1.2 and below (PR #95750)

2024-06-17 Thread Vikash Gupta via cfe-commits
https://github.com/vg0204 updated https://github.com/llvm/llvm-project/pull/95750 >From 04ff7bd289d0840b8aa2b0502e4ac050174c95ab Mon Sep 17 00:00:00 2001 From: vg0204 Date: Mon, 17 Jun 2024 11:20:02 +0530 Subject: [PATCH 1/2] [Clang] [WIP] Added builtin_alloca support for OpenCL1.2 and below

[clang] [clang] Fix-it hint for `++this` -> `++*this` when deref is modifiable (PR #94159)

2024-06-17 Thread via cfe-commits
Sirraide wrote: > Checking for an overloaded operator* seems overly complicated here, so I > think the right thing to test here is just whether the expression has pointer > type, and the pointee type is an object type (not void or a function type). That’s also what I was going for initially, b

[clang] [llvm] [AArch64] Add ability to list extensions enabled for a target (PR #95805)

2024-06-17 Thread Jon Roelofs via cfe-commits
@@ -13,3 +13,57 @@ // RUN: %clang --target=aarch64_be -mbig-endian -march=armv8.6a -### -c %s 2>&1 | FileCheck -check-prefix=GENERICV86A-BE %s // RUN: %clang --target=aarch64_be -mbig-endian -march=armv8.6-a -### -c %s 2>&1 | FileCheck -check-prefix=GENERICV86A-BE %s // GENER

[clang] [Clang] Implement CWG2351 `void{}` (PR #78060)

2024-06-17 Thread Mital Ashok via cfe-commits
https://github.com/MitalAshok updated https://github.com/llvm/llvm-project/pull/78060 >From 6ed7cad5d4993603221c3d9a777463675d69643b Mon Sep 17 00:00:00 2001 From: Mital Ashok Date: Sat, 13 Jan 2024 18:03:15 + Subject: [PATCH 1/2] [SemaCXX] Implement CWG2351 `void{}` --- clang/docs/Releas

[clang] [clang] Fix-it hint for `++this` -> `++*this` when deref is modifiable (PR #94159)

2024-06-17 Thread via cfe-commits
@@ -0,0 +1,49 @@ +// RUN: %clang_cc1 -std=c++23 -fsyntax-only -verify %s + +struct S { + void f() { +++this; // expected-error {{expression is not assignable}} +// expected-note@-1 {{add '*' to dereference it}} Sirraide wrote: That’s true. Looking at thi

[clang] [Clang] Implement CWG2351 `void{}` (PR #78060)

2024-06-17 Thread Mital Ashok via cfe-commits
https://github.com/MitalAshok updated https://github.com/llvm/llvm-project/pull/78060 >From 6ed7cad5d4993603221c3d9a777463675d69643b Mon Sep 17 00:00:00 2001 From: Mital Ashok Date: Sat, 13 Jan 2024 18:03:15 + Subject: [PATCH 1/2] [SemaCXX] Implement CWG2351 `void{}` --- clang/docs/Releas

[clang] [clang] Fix-it hint for `++this` -> `++*this` when deref is modifiable (PR #94159)

2024-06-17 Thread via cfe-commits
@@ -13273,6 +13273,23 @@ enum { ConstUnknown, // Keep as last element }; +static void MaybeSuggestDerefFixIt(Sema &S, const Expr *E, SourceLocation Loc) { + ExprResult Deref; + Expr *TE = const_cast(E); + { +Sema::TentativeAnalysisScope Trap(S); +Deref = S.ActOn

[clang] [flang] [llvm] [mlir] [Flang]Fix for changed code at the end of AllocaIP. (PR #92430)

2024-06-17 Thread Mats Petersson via cfe-commits
Leporacanthicus wrote: > progress? I'm afraid I'm still waiting for review from some of the key people here. Apparently there was some OpenMP conference last week, which kept some people very busy, so I'm hoping by the time they've read emails and got over jet-lag, etc, they'll get round to t

[clang] [Clang] skip alignment checks on incomplete types to avoid an assertion failure while parsing lambda used as default argument (PR #94542)

2024-06-17 Thread Oleksandr T. via cfe-commits
https://github.com/a-tarasyuk updated https://github.com/llvm/llvm-project/pull/94542 >From da4df73607a9edefc8db721818eff50e974a0637 Mon Sep 17 00:00:00 2001 From: Oleksandr T Date: Thu, 6 Jun 2024 01:55:54 +0300 Subject: [PATCH] [Clang] skip alignment checks on incomplete types to avoid an as

[clang] [llvm] [inline] Clone return range attribute on the callsite into inlined call (PR #92666)

2024-06-17 Thread Arthur Eubanks via cfe-commits
aeubanks wrote: for future reference, https://github.com/llvm/llvm-project/commit/3cd67eeca28ab1084d02b7976de1af4c4c8d37d5 fixes a miscompile that this patch uncovered https://github.com/llvm/llvm-project/pull/92666 ___ cfe-commits mailing list cfe-c

[clang] [Clang] [Sema] Ensure noexcept(typeid(E)) checks if E throws when needed (PR #95846)

2024-06-17 Thread Mital Ashok via cfe-commits
https://github.com/MitalAshok created https://github.com/llvm/llvm-project/pull/95846 3ad31e12ccfc7db25f3cbedc4ee966e7099ac78f changed it so that not all potentially-evaluated `typeid`s were marked as potentially-throwing, but I forgot to check the subexpression if the null check of the `typei

[clang] [Clang] [Sema] Ensure noexcept(typeid(E)) checks if E throws when needed (PR #95846)

2024-06-17 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: Mital Ashok (MitalAshok) Changes 3ad31e12ccfc7db25f3cbedc4ee966e7099ac78f changed it so that not all potentially-evaluated `typeid`s were marked as potentially-throwing, but I forgot to check the subexpression if the null check of the `ty

[clang] [Clang] [Sema] Ensure noexcept(typeid(E)) checks if E throws when needed (PR #95846)

2024-06-17 Thread Mital Ashok via cfe-commits
MitalAshok wrote: CC @Endilll @Sirraide https://github.com/llvm/llvm-project/pull/95846 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][ThreadSafety] Warn when constructor is trylock (PR #95290)

2024-06-17 Thread Dan McArdle via cfe-commits
dmcardle wrote: Thanks, @AaronBallman! I tried strictly enforcing a `bool` return type, but I ran into some interesting test failures. * A handful of functions in the parsing tests return `void` and yet are annotated as trylock functions. I don't believe this is a valid use case. What does `

[clang] [clang] force libc linked with --no-as-needed when using compiler-rt (PR #95848)

2024-06-17 Thread via cfe-commits
https://github.com/ziyao233 created https://github.com/llvm/llvm-project/pull/95848 crtbegin.o in compiler-rt contains weak reference to __cxa_finalize, which is implemented in libc. When building a shared library with --as-needed option, libc may be incorrectly marked as inactive, resulting i

[clang] [clang] force libc linked with --no-as-needed when using compiler-rt (PR #95848)

2024-06-17 Thread via cfe-commits
github-actions[bot] wrote: Thank you for submitting a Pull Request (PR) to the LLVM Project! This PR will be automatically labeled and the relevant teams will be notified. If you wish to, you can add reviewers by using the "Reviewers" section on this page. If this is not working for you, it

[clang] [clang] force libc linked with --no-as-needed when using compiler-rt (PR #95848)

2024-06-17 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: Ziyao (ziyao233) Changes crtbegin.o in compiler-rt contains weak reference to __cxa_finalize, which is implemented in libc. When building a shared library with --as-needed option, libc may be incorrectly marked as inactive, resulting in u

[clang] [llvm] [SPIRV][HLSL] Add lowering of `rsqrt` to SPIRV (PR #95849)

2024-06-17 Thread Helena Kotas via cfe-commits
https://github.com/hekota created https://github.com/llvm/llvm-project/pull/95849 Add lowering of `rsqrt` to SPIRV. Fixes #88949 >From b10aa2317f566febdf4cd3630a972be58fea515b Mon Sep 17 00:00:00 2001 From: Helena Kotas Date: Mon, 17 Jun 2024 14:03:03 -0700 Subject: [PATCH] [SPIRV][HLSL] Add

[clang] Respect the [[clang::unsafe_buffer_usage]] attribute for field and constructor initializers (PR #91991)

2024-06-17 Thread Artem Dergachev via cfe-commits
@@ -3328,3 +3300,63 @@ void clang::checkUnsafeBufferUsage(const Decl *D, } } } + +void clang::checkUnsafeBufferUsage(const Decl *D, + UnsafeBufferUsageHandler &Handler, + bool EmitSuggestions) { +#ifndef

[clang] [llvm] [SPIRV][HLSL] Add lowering of `rsqrt` to SPIRV (PR #95849)

2024-06-17 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang-codegen @llvm/pr-subscribers-hlsl Author: Helena Kotas (hekota) Changes Add lowering of `rsqrt` to SPIRV. Fixes #88949 --- Full diff: https://github.com/llvm/llvm-project/pull/95849.diff 5 Files Affected: - (modified) clang/lib/CodeGen/CGBuilt

[clang] [Clang] [Sema] Ensure noexcept(typeid(E)) checks if E throws when needed (PR #95846)

2024-06-17 Thread via cfe-commits
https://github.com/Sirraide approved this pull request. LGTM https://github.com/llvm/llvm-project/pull/95846 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [compiler-rt] [ubsan] Display correct runtime messages for negative _BitInt (PR #93612)

2024-06-17 Thread via cfe-commits
@@ -3318,6 +3353,20 @@ llvm::Constant *CodeGenFunction::EmitCheckTypeDescriptor(QualType T) { DiagnosticsEngine::ak_qualtype, (intptr_t)T.getAsOpaquePtr(), StringRef(), StringRef(), std::nullopt, Buffer, std::nullopt); + if (IsBitInt) { +// The Structure is:

[clang] [compiler-rt] [ubsan] Display correct runtime messages for negative _BitInt (PR #93612)

2024-06-17 Thread via cfe-commits
@@ -3318,6 +3353,20 @@ llvm::Constant *CodeGenFunction::EmitCheckTypeDescriptor(QualType T) { DiagnosticsEngine::ak_qualtype, (intptr_t)T.getAsOpaquePtr(), StringRef(), StringRef(), std::nullopt, Buffer, std::nullopt); + if (IsBitInt) { +// The Structure is:

[clang] [compiler-rt] [ubsan] Display correct runtime messages for negative _BitInt (PR #93612)

2024-06-17 Thread via cfe-commits
https://github.com/earnol updated https://github.com/llvm/llvm-project/pull/93612 >From 4b3cdc9a0ee724b3523f98bc4726751f09003525 Mon Sep 17 00:00:00 2001 From: Vladislav Aranov Date: Fri, 24 May 2024 11:39:35 -0400 Subject: [PATCH 1/2] [ubsan] Display correct runtime messages for negative _Bit

[clang] [llvm] [Clang][Coroutines] Introducing the `[[clang::coro_inplace_task]]` attribute (PR #94693)

2024-06-17 Thread Yuxuan Chen via cfe-commits
https://github.com/yuxuanchen1997 edited https://github.com/llvm/llvm-project/pull/94693 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [compiler-rt] [ubsan] Display correct runtime messages for negative _BitInt (PR #93612)

2024-06-17 Thread via cfe-commits
https://github.com/earnol updated https://github.com/llvm/llvm-project/pull/93612 >From c3d5a244dc08b3e78e961f4611daaea2bbb0a682 Mon Sep 17 00:00:00 2001 From: Vladislav Aranov Date: Fri, 24 May 2024 11:39:35 -0400 Subject: [PATCH] [ubsan] Display correct runtime messages for negative _BitInt

[clang] [llvm] [Clang][Coroutines] Introducing the `[[clang::coro_inplace_task]]` attribute (PR #94693)

2024-06-17 Thread Yuxuan Chen via cfe-commits
https://github.com/yuxuanchen1997 edited https://github.com/llvm/llvm-project/pull/94693 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [Clang][Coroutines] Introducing the `[[clang::coro_inplace_task]]` attribute (PR #94693)

2024-06-17 Thread Yuxuan Chen via cfe-commits
https://github.com/yuxuanchen1997 converted_to_draft https://github.com/llvm/llvm-project/pull/94693 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang][AMDGPU] Add a new builtin type for buffer rsrc (PR #94830)

2024-06-17 Thread Yaxun Liu via cfe-commits
@@ -0,0 +1,19 @@ +// REQUIRES: amdgpu-registered-target +// RUN: %clang_cc1 -fsyntax-only -verify -triple amdgcn -Wno-unused-value %s + yxsamliu wrote: Add a run line: // RUN: %clang_cc1 -fsyntax-only -verify -triple x86_64 -aux-triple amdgcn -Wno-unused-value

[clang] [llvm] [SPIRV][HLSL] Add lowering of `rsqrt` to SPIRV (PR #95849)

2024-06-17 Thread Farzon Lotfi via cfe-commits
@@ -0,0 +1,29 @@ +; 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 %} + +; CHECK: OpExtInstImport "GLSL.std.450" farzonl wrote: make this: `;

[clang] [llvm] [SPIRV][HLSL] Add lowering of `rsqrt` to SPIRV (PR #95849)

2024-06-17 Thread Farzon Lotfi via cfe-commits
@@ -0,0 +1,29 @@ +; 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 %} + +; CHECK: OpExtInstImport "GLSL.std.450" + +define noundef float @rsqrt_float(float noun

<    1   2   3   4   5   >