[clang] [Sema] Fix c23 not checking CheckBoolLikeConversion (PR #79588)

2024-01-28 Thread Pil Eghoff via cfe-commits
https://github.com/pileghoff updated https://github.com/llvm/llvm-project/pull/79588 >From f22d0a6888be86c5105a00e3f83201f71165f78f Mon Sep 17 00:00:00 2001 From: Pil Eghoff Date: Fri, 26 Jan 2024 13:30:17 +0100 Subject: [PATCH] [Sema] Fix c23 not checking CheckBoolLikeConversion ---

[clang] [Sema] Fix c23 not checking CheckBoolLikeConversion (PR #79588)

2024-01-28 Thread Pil Eghoff via cfe-commits
https://github.com/pileghoff updated https://github.com/llvm/llvm-project/pull/79588 >From b059e03eb5330054e76c833699611fdc9bfb1967 Mon Sep 17 00:00:00 2001 From: Pil Eghoff Date: Fri, 26 Jan 2024 13:30:17 +0100 Subject: [PATCH] [Sema] Fix c23 not checking CheckBoolLikeConversion ---

[clang] [Sema] Fix c23 not checking CheckBoolLikeConversion (PR #79588)

2024-01-28 Thread Pil Eghoff via cfe-commits
https://github.com/pileghoff updated https://github.com/llvm/llvm-project/pull/79588 >From 6ea74d7aa0eadd4093350c04de95cbb2bdbaf0eb Mon Sep 17 00:00:00 2001 From: Pil Eghoff Date: Fri, 26 Jan 2024 13:30:17 +0100 Subject: [PATCH] [Sema] Fix c23 not checking CheckBoolLikeConversion ---

[clang] [Sema] Fix c23 not checking CheckBoolLikeConversion (PR #79588)

2024-01-28 Thread Pil Eghoff via cfe-commits
https://github.com/pileghoff updated https://github.com/llvm/llvm-project/pull/79588 >From 29a1eea6b27210ba35ad035b3c10aa8f5c73d86c Mon Sep 17 00:00:00 2001 From: Pil Eghoff Date: Fri, 26 Jan 2024 13:30:17 +0100 Subject: [PATCH] [Sema] Fix c23 not checking CheckBoolLikeConversion ---

[clang] [Sema] Fix c23 not checking CheckBoolLikeConversion (PR #79588)

2024-01-28 Thread Pil Eghoff via cfe-commits
https://github.com/pileghoff updated https://github.com/llvm/llvm-project/pull/79588 >From 34bb01d59005059c7f8f1156a164993c1839ee36 Mon Sep 17 00:00:00 2001 From: Pil Eghoff Date: Fri, 26 Jan 2024 13:30:17 +0100 Subject: [PATCH] [Sema] Fix c23 not checking CheckBoolLikeConversion ---

[clang] [Sema] Fix c23 not checking CheckBoolLikeConversion (PR #79588)

2024-01-28 Thread Pil Eghoff via cfe-commits
https://github.com/pileghoff updated https://github.com/llvm/llvm-project/pull/79588 >From 2c942f755c147a8413af4784f85da46f1f5384bd Mon Sep 17 00:00:00 2001 From: Pil Eghoff Date: Fri, 26 Jan 2024 13:30:17 +0100 Subject: [PATCH] [Sema] Fix c23 not checking CheckBoolLikeConversion ---

[clang] [Sema] Fix c23 not checking CheckBoolLikeConversion (PR #79588)

2024-01-28 Thread Pil Eghoff via cfe-commits
pileghoff wrote: For testing i have fixed the new warnings in `n3042.c` and i have expanded `warn-int-in-bool-context.c` to check c23 specefically (which was broken, but is now fixed) and i added a few extra cases to the test. I will take a look at the release notes later today.

[clang-tools-extra] [clang] [llvm] [RISCV][ISel] Add ISel support for experimental Zimop extension (PR #77089)

2024-01-28 Thread Jivan Hakobyan via cfe-commits
https://github.com/JivanH updated https://github.com/llvm/llvm-project/pull/77089 >From caab6046a26517946bdce7659e4236ae9d5154fe Mon Sep 17 00:00:00 2001 From: ln8-8 Date: Fri, 5 Jan 2024 16:08:53 +0400 Subject: [PATCH 1/5] [RISCV][ISel] Add ISel support for experimental Zimop extension This

[clang] [Sema] Fix c23 not checking CheckBoolLikeConversion (PR #79588)

2024-01-28 Thread Pil Eghoff via cfe-commits
https://github.com/pileghoff updated https://github.com/llvm/llvm-project/pull/79588 >From 43241ab75d4c15e6885337be1b0ce4cf0217f384 Mon Sep 17 00:00:00 2001 From: Pil Eghoff Date: Fri, 26 Jan 2024 13:30:17 +0100 Subject: [PATCH] [Sema] Fix c23 not checking CheckBoolLikeConversion ---

[clang] [Clang][Sema] Fix crash when type used in return statement contains errors (PR #79788)

2024-01-28 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: Shafik Yaghmour (shafik) Changes In Sema in `BuildReturnStmt(...)` when we try to determine is the type is move eligable or copy elidable we don't currently check of the init of the `VarDecl` contain errors or not. This can lead to a

[clang] [Clang][Sema] Fix crash when type used in return statement contains errors (PR #79788)

2024-01-28 Thread Shafik Yaghmour via cfe-commits
https://github.com/shafik created https://github.com/llvm/llvm-project/pull/79788 In Sema in `BuildReturnStmt(...)` when we try to determine is the type is move eligable or copy elidable we don't currently check of the init of the `VarDecl` contain errors or not. This can lead to a crash

[lld] [flang] [clang] [llvm] [AMDGPU] Introduce Code Object V6 (PR #76954)

2024-01-28 Thread Pierre van Houtryve via cfe-commits
@@ -620,6 +620,15 @@ void ScalarBitSetTraits::bitset(IO , BCase(EF_AMDGPU_FEATURE_XNACK_V3); BCase(EF_AMDGPU_FEATURE_SRAMECC_V3); break; +case ELF::ELFABIVERSION_AMDGPU_HSA_V6: Pierre-vh wrote: elf-headers.test already covers it

[mlir] [flang] [clang] [llvm] [mlir][complex] Prevent underflow in complex.abs (PR #79786)

2024-01-28 Thread Kai Sasaki via cfe-commits
https://github.com/Lewuathe updated https://github.com/llvm/llvm-project/pull/79786 >From 8a7243c4c2be5db5e0a95535f36386557e68e18c Mon Sep 17 00:00:00 2001 From: Kai Sasaki Date: Fri, 15 Dec 2023 15:53:54 +0900 Subject: [PATCH] [mlir][complex] Prevent underflow in complex.abs ---

[lld] [flang] [clang] [llvm] [AMDGPU] Introduce Code Object V6 (PR #76954)

2024-01-28 Thread Pierre van Houtryve via cfe-commits
@@ -44,8 +44,15 @@ constexpr uint32_t VersionMajorV5 = 1; /// HSA metadata minor version for code object V5. constexpr uint32_t VersionMinorV5 = 2; +/// HSA metadata major version for code object V6. +constexpr uint32_t VersionMajorV6 = 1; +/// HSA metadata minor version for

[clang] [llvm] [AMDGPU] Emit a waitcnt instruction after each memory instruction (PR #79236)

2024-01-28 Thread Pierre van Houtryve via cfe-commits
@@ -17,13 +17,16 @@ #include "AMDGPUMachineModuleInfo.h" #include "GCNSubtarget.h" #include "MCTargetDesc/AMDGPUMCTargetDesc.h" +#include "Utils/AMDGPUBaseInfo.h" #include "llvm/ADT/BitmaskEnum.h" #include "llvm/CodeGen/MachineBasicBlock.h" #include

[llvm] [clang] [AMDGPU] Emit a waitcnt instruction after each memory instruction (PR #79236)

2024-01-28 Thread Pierre van Houtryve via cfe-commits
@@ -0,0 +1,199 @@ +; Testing the -amdgpu-precise-memory-op option Pierre-vh wrote: Please generate the test using `update_llc_test_checks`, much easier to update if/when things change. Also I think you don't need `-verify-machineinstrs`. It's expensive and

[clang] [llvm] [AMDGPU] Emit a waitcnt instruction after each memory instruction (PR #79236)

2024-01-28 Thread Pierre van Houtryve via cfe-commits
@@ -2561,6 +2567,70 @@ bool SIMemoryLegalizer::expandAtomicCmpxchgOrRmw(const SIMemOpInfo , return Changed; } +bool SIMemoryLegalizer::GFX9InsertWaitcntForPreciseMem(MachineFunction ) { + const GCNSubtarget = MF.getSubtarget(); + const SIInstrInfo *TII =

[llvm] [clang] [AMDGPU] Emit a waitcnt instruction after each memory instruction (PR #79236)

2024-01-28 Thread Pierre van Houtryve via cfe-commits
@@ -0,0 +1,199 @@ +; Testing the -amdgpu-precise-memory-op option +; RUN: llc -mtriple=amdgcn -mcpu=gfx900 -mattr=+amdgpu-precise-memory-op -verify-machineinstrs < %s | FileCheck %s -check-prefixes=GFX9 +; RUN: llc -mtriple=amdgcn -mcpu=gfx90a -mattr=+amdgpu-precise-memory-op

[clang] [llvm] [AMDGPU] Emit a waitcnt instruction after each memory instruction (PR #79236)

2024-01-28 Thread Pierre van Houtryve via cfe-commits
@@ -641,6 +644,9 @@ class SIMemoryLegalizer final : public MachineFunctionPass { bool expandAtomicCmpxchgOrRmw(const SIMemOpInfo , MachineBasicBlock::iterator ); + bool GFX9InsertWaitcntForPreciseMem(MachineFunction );

[llvm] [clang] [AMDGPU] Emit a waitcnt instruction after each memory instruction (PR #79236)

2024-01-28 Thread Pierre van Houtryve via cfe-commits
@@ -167,6 +167,10 @@ def FeatureCuMode : SubtargetFeature<"cumode", "Enable CU wavefront execution mode" >; +def FeaturePreciseMemory Pierre-vh wrote: I'm not a fan of using a feature for this, I think we should have a backend CL option instead. After all

[clang] 4118082 - [C++20] [Modules] Remove previous workaround for odr hashing enums

2024-01-28 Thread Chuanqi Xu via cfe-commits
Author: Chuanqi Xu Date: 2024-01-29T14:35:23+08:00 New Revision: 4118082f651a05cca258c684ab1199578b57afac URL: https://github.com/llvm/llvm-project/commit/4118082f651a05cca258c684ab1199578b57afac DIFF: https://github.com/llvm/llvm-project/commit/4118082f651a05cca258c684ab1199578b57afac.diff

[clang] [clang-tools-extra] [llvm] Add clang-tidy check to suggest replacement of conditional statement with std::min/std::max (PR #77816)

2024-01-28 Thread Piotr Zegar via cfe-commits
@@ -0,0 +1,168 @@ +//===--- UseStdMinMaxCheck.cpp - clang-tidy ---===// +// +// 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:

[clang] [llvm] [clang-tools-extra] Add clang-tidy check to suggest replacement of conditional statement with std::min/std::max (PR #77816)

2024-01-28 Thread Piotr Zegar via cfe-commits
@@ -0,0 +1,168 @@ +//===--- UseStdMinMaxCheck.cpp - clang-tidy ---===// +// +// 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:

[clang-tools-extra] [llvm] [clang] Add clang-tidy check to suggest replacement of conditional statement with std::min/std::max (PR #77816)

2024-01-28 Thread Piotr Zegar via cfe-commits
https://github.com/PiotrZSL commented: Other thing is that reviewer should mark issues as resolved after checking with code, not author. Otherwise is hard to figure out what's done and what's not. Adding some comment like "Done" is sufficient usually unless issues are simple. Next thing

[llvm] [clang] [clang-tools-extra] Add clang-tidy check to suggest replacement of conditional statement with std::min/std::max (PR #77816)

2024-01-28 Thread Piotr Zegar via cfe-commits
@@ -0,0 +1,168 @@ +//===--- UseStdMinMaxCheck.cpp - clang-tidy ---===// +// +// 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:

[clang-tools-extra] [llvm] [clang] Add clang-tidy check to suggest replacement of conditional statement with std::min/std::max (PR #77816)

2024-01-28 Thread Piotr Zegar via cfe-commits
https://github.com/PiotrZSL edited https://github.com/llvm/llvm-project/pull/77816 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-format] Handle generic selections inside parentheses (PR #79785)

2024-01-28 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang-format Author: None (sstwcw) Changes new ```C while (_Generic(x, // long: x)(x) x) { } while (_Generic(x, // long: x)(x)) { } ``` old ```C while (_Generic(x, // long: x)(x) x) { } while (_Generic(x, // long:

[clang] [clang-format] Handle generic selections inside parentheses (PR #79785)

2024-01-28 Thread via cfe-commits
https://github.com/sstwcw created https://github.com/llvm/llvm-project/pull/79785 new ```C while (_Generic(x, // long: x)(x) > x) { } while (_Generic(x, // long: x)(x)) { } ``` old ```C while (_Generic(x, // long: x)(x) > x) { } while (_Generic(x, // long:

[clang] [OpenMP][Clang] Handle unsupported inscan modifier for generic types (PR #79431)

2024-01-28 Thread Animesh Kumar via cfe-commits
https://github.com/animeshk-amd edited https://github.com/llvm/llvm-project/pull/79431 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [OpenMP][Clang] Handle unsupported inscan modifier for generic types (PR #79431)

2024-01-28 Thread Animesh Kumar via cfe-commits
@@ -19520,6 +19520,13 @@ static bool actOnOMPReductionKindClause( bool FirstIter = true; for (Expr *RefExpr : VarList) { assert(RefExpr && "nullptr expr in OpenMP reduction clause."); +if (ClauseKind == OMPC_reduction && +RD.RedModifier ==

[clang] [OpenMP][Clang] Handle unsupported inscan modifier for generic types (PR #79431)

2024-01-28 Thread Animesh Kumar via cfe-commits
@@ -12,28 +12,6 @@ void foo() {} -template animeshk-amd wrote: The test was passing because the `for` directive at line:18 is used outside a parallel region, in which case the compiler wasn't crashing. Contrary to what would happen when used within a

[clang-tools-extra] [clangd] Attempt to fix https://github.com/clangd/clangd/issues/1536 (PR #79448)

2024-01-28 Thread Tor Shepherd via cfe-commits
torshepherd wrote: I'll close this patch and pursue the other things we discussed https://github.com/llvm/llvm-project/pull/79448 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clangd] Attempt to fix https://github.com/clangd/clangd/issues/1536 (PR #79448)

2024-01-28 Thread Tor Shepherd via cfe-commits
https://github.com/torshepherd closed https://github.com/llvm/llvm-project/pull/79448 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] a0b6747 - [C++20] [Modules] Don't perform ODR checks in GMF

2024-01-28 Thread Chuanqi Xu via cfe-commits
Author: Chuanqi Xu Date: 2024-01-29T11:44:59+08:00 New Revision: a0b6747804e46665ecfd00295b60432bfe1775b6 URL: https://github.com/llvm/llvm-project/commit/a0b6747804e46665ecfd00295b60432bfe1775b6 DIFF: https://github.com/llvm/llvm-project/commit/a0b6747804e46665ecfd00295b60432bfe1775b6.diff

[clang] [llvm] [NVPTX] Add 'activemask' builtin and intrinsic support (PR #79768)

2024-01-28 Thread Joseph Huber via cfe-commits
https://github.com/jhuber6 updated https://github.com/llvm/llvm-project/pull/79768 >From 2c7049defef3b62de7017640948cccfb07ff756c Mon Sep 17 00:00:00 2001 From: Joseph Huber Date: Sun, 28 Jan 2024 14:57:05 -0600 Subject: [PATCH] [NVPTX] Add 'activemask' builtin and intrinsic support Summary:

[clang] [llvm] [NVPTX} Add builtin support for 'globaltimer' (PR #79765)

2024-01-28 Thread Joseph Huber via cfe-commits
https://github.com/jhuber6 updated https://github.com/llvm/llvm-project/pull/79765 >From cb2503ee6c10a3d03548b6bd44d6800ed67b2753 Mon Sep 17 00:00:00 2001 From: Joseph Huber Date: Mon, 29 Jan 2024 08:12:35 -0600 Subject: [PATCH] [NVPTX} Add builtin support for 'globaltimer' Summary: This

[clang] [llvm] [NVPTX] Add builtin for 'exit' handling (PR #79777)

2024-01-28 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-llvm-ir @llvm/pr-subscribers-clang Author: Joseph Huber (jhuber6) Changes Summary: The PTX ISA has always supported the 'exit' instruction to terminate individual threads. This patch adds a builtin to handle it. See the PTX documentation for further

[llvm] [clang] [NVPTX] Add builtin for 'exit' handling (PR #79777)

2024-01-28 Thread Joseph Huber via cfe-commits
https://github.com/jhuber6 created https://github.com/llvm/llvm-project/pull/79777 Summary: The PTX ISA has always supported the 'exit' instruction to terminate individual threads. This patch adds a builtin to handle it. See the PTX documentation for further details.

[clang] [CLANG][NFC] Modify test cases to suit assigned default sysroot path (PR #77075)

2024-01-28 Thread via cfe-commits
Yunzezhu94 wrote: Gentle Ping. https://github.com/llvm/llvm-project/pull/77075 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clangd] Fix is spelled in source bug (PR #76668)

2024-01-28 Thread Nathan Ridge via cfe-commits
HighCommander4 wrote: > (A drive-by comment: I stumbled on the commit message of this PR and found it > surprising that I'm the co-author of it! I'm not entirely clear on GitHub's > schemas, but IMO shouldn't the co-author be the one who clicks the "merge" > button?) The reason is that one

[clang-tools-extra] [clangd] Fix is spelled in source bug (PR #76668)

2024-01-28 Thread Younan Zhang via cfe-commits
zyn0217 wrote: (A drive-by comment: I stumbled on the commit message of this PR and found it surprising that I'm the co-author of it! I'm not entirely clear on GitHub's schemas, but IMO shouldn't the co-author be the one who clicks the "merge" button?)

[clang] a3f379e - [Frontend] Use StringRef::consume_back (NFC)

2024-01-28 Thread Kazu Hirata via cfe-commits
Author: Kazu Hirata Date: 2024-01-28T18:03:33-08:00 New Revision: a3f379e4e9db9d88265e6dfc464fc3a5be3ae315 URL: https://github.com/llvm/llvm-project/commit/a3f379e4e9db9d88265e6dfc464fc3a5be3ae315 DIFF: https://github.com/llvm/llvm-project/commit/a3f379e4e9db9d88265e6dfc464fc3a5be3ae315.diff

[clang] [clang-scan-deps] Fix check for empty `Compilation` (PR #75545)

2024-01-28 Thread Chuanqi Xu via cfe-commits
https://github.com/ChuanqiXu9 edited https://github.com/llvm/llvm-project/pull/75545 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-scan-deps] Fix check for empty `Compilation` (PR #75545)

2024-01-28 Thread Chuanqi Xu via cfe-commits
@@ -728,7 +728,7 @@ getCompilationDataBase(int argc, char **argv, std::string ) { *Diags); std::unique_ptr C( TheDriver.BuildCompilation(CommandLine)); - if (!C) + if (C->getJobs().empty()) ChuanqiXu9 wrote: ```suggestion

[clang] [clang-scan-deps] Fix check for empty `Compilation` (PR #75545)

2024-01-28 Thread Chuanqi Xu via cfe-commits
https://github.com/ChuanqiXu9 commented: It will be better to have a test for this. https://github.com/llvm/llvm-project/pull/75545 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[flang] [mlir] [lldb] [libcxxabi] [llvm] [clang-tools-extra] [libcxx] [libc] [clang] [lld] [compiler-rt] [mlir][complex] Prevent underflow in complex.abs (PR #76316)

2024-01-28 Thread Kai Sasaki via cfe-commits
Lewuathe wrote: @joker-eph Oh, sorry for bothering you. I'll check what's going on. https://github.com/llvm/llvm-project/pull/76316 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [clang-tools-extra] Add clang-tidy check to suggest replacement of conditional statement with std::min/std::max (PR #77816)

2024-01-28 Thread Bhuminjay Soni via cfe-commits
@@ -0,0 +1,240 @@ +//===--- UseStdMinMaxCheck.cpp - clang-tidy ---===// +// +// 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:

[clang-tools-extra] [clangd] Attempt to fix https://github.com/clangd/clangd/issues/1536 (PR #79448)

2024-01-28 Thread Nathan Ridge via cfe-commits
HighCommander4 wrote: I read up on this a bit; https://github.com/Microsoft/vscode/issues/62110 seems particularly relevant. Based on [this comment](https://github.com/Microsoft/vscode/issues/62110#issuecomment-456240329): > [...] we have an `auto fix` action in the editor that fixes

[llvm] [clang] [RISCV] Add experimental support of Zaamo and Zalrsc (PR #77424)

2024-01-28 Thread Ved Shanbhogue via cfe-commits
ved-rivos wrote: > > > I guess Zaamo + Zacas is technically a way one could implement atomics > > > without LR/SC? > > > > > > The Zacas extension depends upon the A extension. > > I filed an issue asking about that >

[clang-tools-extra] [llvm] [clang] Add clang-tidy check to suggest replacement of conditional statement with std::min/std::max (PR #77816)

2024-01-28 Thread Bhuminjay Soni via cfe-commits
https://github.com/11happy deleted https://github.com/llvm/llvm-project/pull/77816 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [clang-tools-extra] Add clang-tidy check to suggest replacement of conditional statement with std::min/std::max (PR #77816)

2024-01-28 Thread Bhuminjay Soni via cfe-commits
https://github.com/11happy deleted https://github.com/llvm/llvm-project/pull/77816 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [clang-tools-extra] Add clang-tidy check to suggest replacement of conditional statement with std::min/std::max (PR #77816)

2024-01-28 Thread Bhuminjay Soni via cfe-commits
https://github.com/11happy edited https://github.com/llvm/llvm-project/pull/77816 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [clang-tools-extra] Add clang-tidy check to suggest replacement of conditional statement with std::min/std::max (PR #77816)

2024-01-28 Thread Bhuminjay Soni via cfe-commits
https://github.com/11happy edited https://github.com/llvm/llvm-project/pull/77816 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [clang-tools-extra] Add clang-tidy check to suggest replacement of conditional statement with std::min/std::max (PR #77816)

2024-01-28 Thread Bhuminjay Soni via cfe-commits
@@ -0,0 +1,240 @@ +//===--- UseStdMinMaxCheck.cpp - clang-tidy ---===// +// +// 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:

[clang] [llvm] [clang-tools-extra] Add clang-tidy check to suggest replacement of conditional statement with std::min/std::max (PR #77816)

2024-01-28 Thread Bhuminjay Soni via cfe-commits
@@ -0,0 +1,240 @@ +//===--- UseStdMinMaxCheck.cpp - clang-tidy ---===// +// +// 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:

[clang] [Clang][Sema] fix deducing auto& from const int in template parameters is impossible in partial specializations (PR #79733)

2024-01-28 Thread Qizhi Hu via cfe-commits
https://github.com/jcsxky closed https://github.com/llvm/llvm-project/pull/79733 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] c34aa78 - [Clang][Sema] fix deducing auto& from const int in template parameters is impossible in partial specializations (#79733)

2024-01-28 Thread via cfe-commits
Author: Qizhi Hu Date: 2024-01-29T06:42:52+08:00 New Revision: c34aa784f8867517315d8ef32a8038ee9dbb7165 URL: https://github.com/llvm/llvm-project/commit/c34aa784f8867517315d8ef32a8038ee9dbb7165 DIFF: https://github.com/llvm/llvm-project/commit/c34aa784f8867517315d8ef32a8038ee9dbb7165.diff

[polly] [clang] [clang-format] Add AllowShortType option for AlwaysBreakAfterReturnType. (PR #78011)

2024-01-28 Thread Owen Pan via cfe-commits
@@ -587,7 +590,7 @@ bool ContinuationIndenter::mustBreak(const LineState ) { !State.Line->ReturnTypeWrapped && // Don't break before a C# function when no break after return type. (!Style.isCSharp() || - Style.AlwaysBreakAfterReturnType !=

[polly] [clang] [clang-format] Add AllowShortType option for AlwaysBreakAfterReturnType. (PR #78011)

2024-01-28 Thread Owen Pan via cfe-commits
owenca wrote: > @mydeveloperday @HazardyKnusperkeks @rymiel this patch fixes a very old bug > and will cause behavior changes whether the default is changed to the new > `AllowShortType` or left at `None`. Which way should we go? Now I'm leaning toward keeping the existing (buggy) behavior of

[polly] [clang] [clang-format] Add AllowShortType option for AlwaysBreakAfterReturnType. (PR #78011)

2024-01-28 Thread Owen Pan via cfe-commits
owenca wrote: > What would change if the default was kept at `None`? I don't see it. See https://github.com/llvm/llvm-project/pull/78011#issuecomment-1913052884. https://github.com/llvm/llvm-project/pull/78011 ___ cfe-commits mailing list

[clang] [clang] Improved isSimpleTypeSpecifier (PR #79037)

2024-01-28 Thread Owen Pan via cfe-commits
owenca wrote: LGTM, but please rebase and resolve conflicts. https://github.com/llvm/llvm-project/pull/79037 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] Fix analyzer crash on 'StructuralValue' (PR #79764)

2024-01-28 Thread via cfe-commits
https://github.com/cor3ntin approved this pull request. Thanks! https://github.com/llvm/llvm-project/pull/79764 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-tools-extra] [llvm] [LV] Improve AnyOf reduction codegen. (PR #78304)

2024-01-28 Thread Florian Hahn via cfe-commits
https://github.com/fhahn updated https://github.com/llvm/llvm-project/pull/78304 >From 9846f970b6b394ccc3af25b92f238377a8ae7807 Mon Sep 17 00:00:00 2001 From: Florian Hahn Date: Sun, 14 Jan 2024 18:06:36 + Subject: [PATCH] [LV] Improve AnyOf reduction codegen. Update AnyOf reduction code

[clang] [clang-tools-extra] [llvm] Add clang-tidy check to suggest replacement of conditional statement with std::min/std::max (PR #77816)

2024-01-28 Thread Piotr Zegar via cfe-commits
@@ -0,0 +1,230 @@ +// RUN: %check_clang_tidy %s readability-use-std-min-max %t PiotrZSL wrote: Add `-- -- -fno-delayed-template-parsing` this is why windows tests is falling. Additionally explicitly set c++ standard with `-std=c++11-or-later` like in other

[clang] [clang-tools-extra] [llvm] Add clang-tidy check to suggest replacement of conditional statement with std::min/std::max (PR #77816)

2024-01-28 Thread Piotr Zegar via cfe-commits
@@ -0,0 +1,240 @@ +//===--- UseStdMinMaxCheck.cpp - clang-tidy ---===// +// +// 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:

[clang] [llvm] [clang-tools-extra] Add clang-tidy check to suggest replacement of conditional statement with std::min/std::max (PR #77816)

2024-01-28 Thread Piotr Zegar via cfe-commits
@@ -0,0 +1,240 @@ +//===--- UseStdMinMaxCheck.cpp - clang-tidy ---===// +// +// 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:

[clang-tools-extra] [clang] [llvm] Add clang-tidy check to suggest replacement of conditional statement with std::min/std::max (PR #77816)

2024-01-28 Thread Piotr Zegar via cfe-commits
@@ -0,0 +1,240 @@ +//===--- UseStdMinMaxCheck.cpp - clang-tidy ---===// +// +// 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:

[clang] [clang-tools-extra] [llvm] Add clang-tidy check to suggest replacement of conditional statement with std::min/std::max (PR #77816)

2024-01-28 Thread Piotr Zegar via cfe-commits
@@ -0,0 +1,240 @@ +//===--- UseStdMinMaxCheck.cpp - clang-tidy ---===// +// +// 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:

[llvm] [clang-tools-extra] [clang] Add clang-tidy check to suggest replacement of conditional statement with std::min/std::max (PR #77816)

2024-01-28 Thread Piotr Zegar via cfe-commits
@@ -0,0 +1,240 @@ +//===--- UseStdMinMaxCheck.cpp - clang-tidy ---===// +// +// 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:

[clang] [clang-tools-extra] [llvm] Add clang-tidy check to suggest replacement of conditional statement with std::min/std::max (PR #77816)

2024-01-28 Thread Piotr Zegar via cfe-commits
@@ -0,0 +1,240 @@ +//===--- UseStdMinMaxCheck.cpp - clang-tidy ---===// +// +// 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:

[llvm] [clang] [clang-tools-extra] Add clang-tidy check to suggest replacement of conditional statement with std::min/std::max (PR #77816)

2024-01-28 Thread Piotr Zegar via cfe-commits
https://github.com/PiotrZSL edited https://github.com/llvm/llvm-project/pull/77816 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[llvm] [clang-tools-extra] [clang] Add clang-tidy check to suggest replacement of conditional statement with std::min/std::max (PR #77816)

2024-01-28 Thread Piotr Zegar via cfe-commits
@@ -0,0 +1,240 @@ +//===--- UseStdMinMaxCheck.cpp - clang-tidy ---===// +// +// 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:

[llvm] [clang-tools-extra] [clang] Add clang-tidy check to suggest replacement of conditional statement with std::min/std::max (PR #77816)

2024-01-28 Thread Piotr Zegar via cfe-commits
@@ -0,0 +1,240 @@ +//===--- UseStdMinMaxCheck.cpp - clang-tidy ---===// +// +// 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:

[llvm] [clang-tools-extra] [clang] Add clang-tidy check to suggest replacement of conditional statement with std::min/std::max (PR #77816)

2024-01-28 Thread Piotr Zegar via cfe-commits
@@ -0,0 +1,240 @@ +//===--- UseStdMinMaxCheck.cpp - clang-tidy ---===// +// +// 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:

[clang-tools-extra] [llvm] [clang] Add clang-tidy check to suggest replacement of conditional statement with std::min/std::max (PR #77816)

2024-01-28 Thread Piotr Zegar via cfe-commits
@@ -0,0 +1,240 @@ +//===--- UseStdMinMaxCheck.cpp - clang-tidy ---===// +// +// 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:

[clang] [clang-tools-extra] [llvm] Add clang-tidy check to suggest replacement of conditional statement with std::min/std::max (PR #77816)

2024-01-28 Thread Piotr Zegar via cfe-commits
@@ -0,0 +1,230 @@ +// RUN: %check_clang_tidy %s readability-use-std-min-max %t +#define MY_MACRO_MIN(a, b) ((a) < (b) ? (a) : (b)) + +constexpr int myConstexprMin(int a, int b) { + return a < b ? a : b; +} + +constexpr int myConstexprMax(int a, int b) { + return a > b ? a : b;

[clang] [clang-tools-extra] [llvm] Add clang-tidy check to suggest replacement of conditional statement with std::min/std::max (PR #77816)

2024-01-28 Thread Piotr Zegar via cfe-commits
https://github.com/PiotrZSL requested changes to this pull request. Too overengineered. There are easier ways, just check comments. Except that, looks +- fine. https://github.com/llvm/llvm-project/pull/77816 ___ cfe-commits mailing list

[clang] [compiler-rt] [flang] [llvm] [clang-tools-extra] [VPlan] Replace VPRecipeOrVPValue with VP2VP recipe simplification. (PR #76090)

2024-01-28 Thread via cfe-commits
@@ -827,6 +827,16 @@ static unsigned getOpcodeForRecipe(VPRecipeBase ) { /// Try to simplify recipe \p R. static void simplifyRecipe(VPRecipeBase , VPTypeAnalysis ) { + // Try to remove redundant blend recipes. + if (auto *Blend = dyn_cast()) { ayalz wrote:

[clang-tools-extra] [llvm] [compiler-rt] [flang] [clang] [VPlan] Replace VPRecipeOrVPValue with VP2VP recipe simplification. (PR #76090)

2024-01-28 Thread via cfe-commits
@@ -9027,7 +8994,8 @@ void LoopVectorizationPlanner::adjustRecipesForReductions( // the phi until LoopExitValue. We keep track of the previous item // (PreviousLink) to tell which of the two operands of a Link will remain // scalar and which will be reduced. For

[clang] [flang] [llvm] [clang-tools-extra] [compiler-rt] [VPlan] Replace VPRecipeOrVPValue with VP2VP recipe simplification. (PR #76090)

2024-01-28 Thread via cfe-commits
@@ -100,11 +99,8 @@ class VPRecipeBuilder { /// Check if \p I has an opcode that can be widened and return a VPWidenRecipe ayalz wrote: (Indeed back to returning VPWidenRecipe as documented...) https://github.com/llvm/llvm-project/pull/76090

[llvm] [flang] [clang] [clang-tools-extra] [compiler-rt] [VPlan] Replace VPRecipeOrVPValue with VP2VP recipe simplification. (PR #76090)

2024-01-28 Thread via cfe-commits
@@ -9058,6 +9026,20 @@ void LoopVectorizationPlanner::adjustRecipesForReductions( LinkVPBB->insert(FMulRecipe, CurrentLink->getIterator()); VecOp = FMulRecipe; } else { +auto *Blend = dyn_cast(CurrentLink); +if (PhiR->isInLoop() && Blend)

[llvm] [clang-tools-extra] [compiler-rt] [clang] [flang] [VPlan] Replace VPRecipeOrVPValue with VP2VP recipe simplification. (PR #76090)

2024-01-28 Thread via cfe-commits
https://github.com/ayalz edited https://github.com/llvm/llvm-project/pull/76090 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [flang] [llvm] [compiler-rt] [clang] [VPlan] Replace VPRecipeOrVPValue with VP2VP recipe simplification. (PR #76090)

2024-01-28 Thread via cfe-commits
https://github.com/ayalz approved this pull request. Looks good to me, thanks for cleaning this up! Adding a couple of minor nits. https://github.com/llvm/llvm-project/pull/76090 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[llvm] [clang] [NVPTX] Add 'activemask' builtin and intrinsic support (PR #79768)

2024-01-28 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: Joseph Huber (jhuber6) Changes Summary: This patch adds support for getting the 'activemask' instruction's value without needing to use inline assembly. See the relevant PTX reference for details.

[clang] [llvm] [NVPTX] Add 'activemask' builtin and intrinsic support (PR #79768)

2024-01-28 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-llvm-ir Author: Joseph Huber (jhuber6) Changes Summary: This patch adds support for getting the 'activemask' instruction's value without needing to use inline assembly. See the relevant PTX reference for details.

[clang] [llvm] [NVPTX] Add 'activemask' builtin and intrinsic support (PR #79768)

2024-01-28 Thread Joseph Huber via cfe-commits
https://github.com/jhuber6 created https://github.com/llvm/llvm-project/pull/79768 Summary: This patch adds support for getting the 'activemask' instruction's value without needing to use inline assembly. See the relevant PTX reference for details.

[clang] [llvm] [NVPTX} Add builtin support for 'globaltimer' (PR #79765)

2024-01-28 Thread Joseph Huber via cfe-commits
https://github.com/jhuber6 updated https://github.com/llvm/llvm-project/pull/79765 >From 9a07e319274f4ec2f7b12a174b7664af118de4e9 Mon Sep 17 00:00:00 2001 From: Joseph Huber Date: Mon, 29 Jan 2024 08:12:35 -0600 Subject: [PATCH] [NVPTX} Add builtin support for 'globaltimer' Summary: This

[clang] [clang] emit an error when the same identifier appears with both internal and external linkage in a translation unit (PR #78064)

2024-01-28 Thread via cfe-commits
@@ -4754,6 +4754,11 @@ void Sema::MergeVarDecl(VarDecl *New, LookupResult ) { return New->setInvalidDecl(); } + if (Old->getFormalLinkage() != New->getFormalLinkage()) { +Diag(New->getLocation(), diag::err_multiple_linkage) << New->getDeclName(); +return

[clang] [clang] Improved isSimpleTypeSpecifier (PR #79037)

2024-01-28 Thread Carl Peto via cfe-commits
https://github.com/carlos4242 updated https://github.com/llvm/llvm-project/pull/79037 >From fdc1e0dbec6821e292ba3da7770dbae22923db20 Mon Sep 17 00:00:00 2001 From: Carl Peto Date: Fri, 26 Jan 2024 14:20:48 + Subject: [PATCH 1/2] [clang] - Sema::isSimpleTypeSpecifier return true

[clang] [polly] [clang-format] Add AllowShortType option for AlwaysBreakAfterReturnType. (PR #78011)

2024-01-28 Thread Björn Schäpers via cfe-commits
HazardyKnusperkeks wrote: > @mydeveloperday @HazardyKnusperkeks @rymiel this patch fixes a very old bug > and will cause behavior changes whether the default is changed to the new > `AllowShortType` or left at `None`. Which way should we go? What would change if the default was kept at

[clang] [polly] [clang-format] Add AllowShortType option for AlwaysBreakAfterReturnType. (PR #78011)

2024-01-28 Thread Björn Schäpers via cfe-commits
@@ -474,7 +474,7 @@ class State: opts = sorted(opts, key=lambda x: x.name) options_text = "\n\n".join(map(str, opts)) -with open(DOC_FILE) as f: +with open(DOC_FILE, encoding="utf-8") as f: HazardyKnusperkeks wrote: Unrelated.

[clang] [polly] [clang-format] Add AllowShortType option for AlwaysBreakAfterReturnType. (PR #78011)

2024-01-28 Thread Björn Schäpers via cfe-commits
@@ -922,8 +922,23 @@ struct FormatStyle { /// }; /// int f(); /// int f() { return 1; } +/// int f:: +/// bar(); /// \endcode RTBS_None, +/// Break after return

[clang] [polly] [clang-format] Add AllowShortType option for AlwaysBreakAfterReturnType. (PR #78011)

2024-01-28 Thread Björn Schäpers via cfe-commits
@@ -922,8 +922,23 @@ struct FormatStyle { /// }; /// int f(); /// int f() { return 1; } +/// int f:: +/// bar(); /// \endcode RTBS_None, +/// Break after return

[polly] [clang] [clang-format] Add AllowShortType option for AlwaysBreakAfterReturnType. (PR #78011)

2024-01-28 Thread Björn Schäpers via cfe-commits
@@ -922,8 +922,23 @@ struct FormatStyle { /// }; /// int f(); /// int f() { return 1; } +/// int f:: HazardyKnusperkeks wrote: I'd go with short names, and just name them like `LongName`

[clang] [polly] [clang-format] Add AllowShortType option for AlwaysBreakAfterReturnType. (PR #78011)

2024-01-28 Thread Björn Schäpers via cfe-commits
@@ -587,7 +590,7 @@ bool ContinuationIndenter::mustBreak(const LineState ) { !State.Line->ReturnTypeWrapped && // Don't break before a C# function when no break after return type. (!Style.isCSharp() || - Style.AlwaysBreakAfterReturnType !=

[clang] [compiler-rt] [clang-tools-extra] [flang] [llvm] [VPlan] Replace VPRecipeOrVPValue with VP2VP recipe simplification. (PR #76090)

2024-01-28 Thread Florian Hahn via cfe-commits
@@ -8292,13 +8271,13 @@ VPRecipeOrVPValueTy VPRecipeBuilder::tryToBlend(PHINode *Phi, for (unsigned In = 0; In < NumIncoming; In++) { VPValue *EdgeMask = createEdgeMask(Phi->getIncomingBlock(In), Phi->getParent(), *Plan); -assert((EdgeMask || NumIncoming ==

[clang] [compiler-rt] [clang-tools-extra] [llvm] [flang] [VPlan] Replace VPRecipeOrVPValue with VP2VP recipe simplification. (PR #76090)

2024-01-28 Thread Florian Hahn via cfe-commits
@@ -88,8 +86,8 @@ class VPRecipeBuilder { /// or a new VPBlendRecipe otherwise. Currently all such phi nodes are turned fhahn wrote: Updated, thanks! https://github.com/llvm/llvm-project/pull/76090 ___ cfe-commits

[flang] [clang-tools-extra] [llvm] [clang] [compiler-rt] [VPlan] Replace VPRecipeOrVPValue with VP2VP recipe simplification. (PR #76090)

2024-01-28 Thread Florian Hahn via cfe-commits
@@ -116,12 +111,11 @@ class VPRecipeBuilder { /// Check if an existing VPValue can be used for \p Instr or a recipe can be /// create for \p I withing the given VF \p Range. If an existing VPValue can fhahn wrote: Updated, thanks!

[llvm] [flang] [compiler-rt] [clang] [clang-tools-extra] [VPlan] Replace VPRecipeOrVPValue with VP2VP recipe simplification. (PR #76090)

2024-01-28 Thread Florian Hahn via cfe-commits
@@ -8999,6 +8963,18 @@ void LoopVectorizationPlanner::adjustRecipesForReductions( LinkVPBB->insert(FMulRecipe, CurrentLink->getIterator()); VecOp = FMulRecipe; } else { +auto *Blend = dyn_cast(CurrentLink); +if (PhiR->isInLoop() && Blend)

[clang] [llvm] [clang-tools-extra] [flang] [compiler-rt] [VPlan] Replace VPRecipeOrVPValue with VP2VP recipe simplification. (PR #76090)

2024-01-28 Thread Florian Hahn via cfe-commits
@@ -8999,6 +8963,18 @@ void LoopVectorizationPlanner::adjustRecipesForReductions( LinkVPBB->insert(FMulRecipe, CurrentLink->getIterator()); VecOp = FMulRecipe; } else { +auto *Blend = dyn_cast(CurrentLink); +if (PhiR->isInLoop() && Blend)

  1   2   >