[clang] [clang][Interp] Support AddOffset with 128bit offsets (PR #68679)

2023-10-12 Thread Timm Baeder via cfe-commits
https://github.com/tbaederr updated https://github.com/llvm/llvm-project/pull/68679 >From 5fff64e74c885472abcd2a320d6db9005cc7c4fd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timm=20B=C3=A4der?= Date: Tue, 10 Oct 2023 08:52:43 +0200 Subject: [PATCH] [clang][Interp] Support AddOffset with 128bit of

[clang] [Clang] Check features of tune CPU against target CPU (PR #68861)

2023-10-12 Thread Qiu Chaofan via cfe-commits
https://github.com/ecnelises created https://github.com/llvm/llvm-project/pull/68861 Tune CPU relies on model of instruction sets. Compiler should warn if not all instruction sets of current target CPU are supported by tune CPU. Although there is limitation that Clang cannot analyze actual req

[clang] [Clang] Check features of tune CPU against target CPU (PR #68861)

2023-10-12 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: Qiu Chaofan (ecnelises) Changes Tune CPU relies on model of instruction sets. Compiler should warn if not all instruction sets of current target CPU are supported by tune CPU. Although there is limitation that Clang cannot analyze actual

[clang-tools-extra] Clean up strange uses of getAnalysisIfAvailable (PR #65729)

2023-10-12 Thread Björn Pettersson via cfe-commits
bjope wrote: > > I guess I don't know how pull requests and reviewing works in github. I > > actually added 3 comments on this patch a several days (or weeks) ago. But > > turns out that they were "pending" because I had only "started review" and > > not found the place to "submit review". >

[clang] [TSAN] add support for riscv64 (PR #68735)

2023-10-12 Thread Alex Fan via cfe-commits
https://github.com/alexfanqi approved this pull request. https://github.com/llvm/llvm-project/pull/68735 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] LoongArch fp16,fp128 basic support (PR #68851)

2023-10-12 Thread WÁNG Xuěruì via cfe-commits
https://github.com/xen0n edited https://github.com/llvm/llvm-project/pull/68851 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] LoongArch fp16,fp128 basic support (PR #68851)

2023-10-12 Thread WÁNG Xuěruì via cfe-commits
@@ -214,6 +214,13 @@ LoongArchTargetLowering::LoongArchTargetLowering(const TargetMachine &TM, setOperationAction(ISD::FRINT, MVT::f64, Legal); } + setOperationAction(ISD::FP16_TO_FP,MVT::f32, Expand); + setOperationAction(ISD::FP_TO_FP16,MVT::f32,

[clang] LoongArch fp16,fp128 basic support (PR #68851)

2023-10-12 Thread WÁNG Xuěruì via cfe-commits
https://github.com/xen0n commented: Thanks for the contribution and welcome! As for the commit message, please take a look at the existing commits for the general feel. (For example, people typically prefix the commit title with the involved topic(s) in brackets, and use a verb phrase for the

[clang-tools-extra] [InstCombine] Canonicalize `(X +/- Y) & Y` into `~X & Y` when Y is a power of 2 (PR #67915)

2023-10-12 Thread Nikita Popov via cfe-commits
https://github.com/nikic approved this pull request. LGTM https://github.com/llvm/llvm-project/pull/67915 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [InstCombine] Canonicalize `(X +/- Y) & Y` into `~X & Y` when Y is a power of 2 (PR #67915)

2023-10-12 Thread Nikita Popov via cfe-commits
https://github.com/nikic approved this pull request. LGTM https://github.com/llvm/llvm-project/pull/67915 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [InstCombine] Canonicalize `(X +/- Y) & Y` into `~X & Y` when Y is a power of 2 (PR #67915)

2023-10-12 Thread Yingwei Zheng via cfe-commits
https://github.com/dtcxzyw closed https://github.com/llvm/llvm-project/pull/67915 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] Draft:[clang][ASTImporter] Fix crash when template class static member imported to other translation unit. (PR #68774)

2023-10-12 Thread via cfe-commits
https://github.com/mzyKi updated https://github.com/llvm/llvm-project/pull/68774 >From ad651d68e6ac161da4e521cc0bebd6d59a5f38cb Mon Sep 17 00:00:00 2001 From: miaozhiyuan Date: Wed, 11 Oct 2023 15:45:36 +0800 Subject: [PATCH] [clang][ASTImporter] Fix crash when template class static member impo

[clang] Draft:[clang][ASTImporter] Fix crash when template class static member imported to other translation unit. (PR #68774)

2023-10-12 Thread via cfe-commits
https://github.com/mzyKi edited https://github.com/llvm/llvm-project/pull/68774 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][ASTImporter] Fix crash when template class static member imported to other translation unit. (PR #68774)

2023-10-12 Thread via cfe-commits
https://github.com/mzyKi edited https://github.com/llvm/llvm-project/pull/68774 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] ac0015f - [flang][driver] add command line arguments for alias tags pass

2023-10-12 Thread Tom Eccles via cfe-commits
Author: Tom Eccles Date: 2023-10-12T09:37:58Z New Revision: ac0015fe21110700fb5e7e9f89b377e80fc843dd URL: https://github.com/llvm/llvm-project/commit/ac0015fe21110700fb5e7e9f89b377e80fc843dd DIFF: https://github.com/llvm/llvm-project/commit/ac0015fe21110700fb5e7e9f89b377e80fc843dd.diff LOG: [f

[clang] [flang] Add flags controlling whether to run the fir alias tags pass (PR #68595)

2023-10-12 Thread Tom Eccles via cfe-commits
https://github.com/tblah closed https://github.com/llvm/llvm-project/pull/68595 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [flang] Add flags controlling whether to run the fir alias tags pass (PR #68595)

2023-10-12 Thread Tom Eccles via cfe-commits
tblah wrote: Merged manually with ac0015fe21110700fb5e7e9f89b377e80fc843dd https://github.com/llvm/llvm-project/pull/68595 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][Interp] Handle unknown-size arrays better (PR #68868)

2023-10-12 Thread Timm Baeder via cfe-commits
https://github.com/tbaederr created https://github.com/llvm/llvm-project/pull/68868 We unfortunately actually need to do some checks for array-to-pointer decays it seems. >From 4947d93ac3487941c83728725c219bb23f884cce Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timm=20B=C3=A4der?= Date: Thu, 12

[clang] [clang][Interp] Handle unknown-size arrays better (PR #68868)

2023-10-12 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: Timm Baeder (tbaederr) Changes We unfortunately actually need to do some checks for array-to-pointer decays it seems. --- Full diff: https://github.com/llvm/llvm-project/pull/68868.diff 6 Files Affected: - (modified) clang/lib/AST/Inte

[clang] [AMDGPU] Change the representation of double literals in operands (PR #68740)

2023-10-12 Thread Stanislav Mekhanoshin via cfe-commits
https://github.com/rampitec updated https://github.com/llvm/llvm-project/pull/68740 >From cc9e065a9218eb36750a2c2a4a4d08fae3f329fa Mon Sep 17 00:00:00 2001 From: Stanislav Mekhanoshin Date: Wed, 4 Oct 2023 13:36:25 -0700 Subject: [PATCH 1/3] [AMDGPU] Change the representation of double literals

[clang] [AMDGPU] Change the representation of double literals in operands (PR #68740)

2023-10-12 Thread Stanislav Mekhanoshin via cfe-commits
@@ -2241,7 +2242,10 @@ void AMDGPUOperand::addLiteralImmOperand(MCInst &Inst, int64_t Val, bool ApplyMo return; } -Inst.addOperand(MCOperand::createImm(Lo_32(Val))); +if (isInt<32>(Val) || isUInt<32>(Val)) + Val = AMDGPU::isSISrcFPOperand(InstDesc, OpNu

[clang] [clang] Add /Zc:__STDC__ flag to clang-cl (PR #68690)

2023-10-12 Thread via cfe-commits
https://github.com/xbjfk updated https://github.com/llvm/llvm-project/pull/68690 >From 92899d94e91a6812de8fa5ec7c15c37a81280108 Mon Sep 17 00:00:00 2001 From: Reagan Bohan Date: Tue, 10 Oct 2023 11:32:47 + Subject: [PATCH 1/2] [clang] Add /Zc:__STDC__ flag to clang-cl This commit adds the /

[clang] [clang] Add /Zc:__STDC__ flag to clang-cl (PR #68690)

2023-10-12 Thread via cfe-commits
https://github.com/xbjfk updated https://github.com/llvm/llvm-project/pull/68690 >From 92899d94e91a6812de8fa5ec7c15c37a81280108 Mon Sep 17 00:00:00 2001 From: Reagan Bohan Date: Tue, 10 Oct 2023 11:32:47 + Subject: [PATCH 1/3] [clang] Add /Zc:__STDC__ flag to clang-cl This commit adds the /

[clang] [clang] Add /Zc:__STDC__ flag to clang-cl (PR #68690)

2023-10-12 Thread via cfe-commits
https://github.com/xbjfk updated https://github.com/llvm/llvm-project/pull/68690 >From 92899d94e91a6812de8fa5ec7c15c37a81280108 Mon Sep 17 00:00:00 2001 From: Reagan Bohan Date: Tue, 10 Oct 2023 11:32:47 + Subject: [PATCH 1/4] [clang] Add /Zc:__STDC__ flag to clang-cl This commit adds the /

[clang] [clang] Add /Zc:__STDC__ flag to clang-cl (PR #68690)

2023-10-12 Thread via cfe-commits
@@ -123,6 +123,10 @@ // CHECK-CHAR8_T_: "-fno-char8_t" +// RUN: %clang_cl /dev/null /E -Xclang -dM 2> /dev/null | FileCheck -match-full-lines %s --check-prefix=STDCOFF +// RUN: %clang_cl /dev/null /E -Xclang -dM /Zc:__STDC__ 2> /dev/null | FileCheck -match-full-lines %s --c

[clang] 22b6b8d - [clang][Interp][NFC] Remove Pointer.h include from Function.h

2023-10-12 Thread Timm Bäder via cfe-commits
Author: Timm Bäder Date: 2023-10-12T12:51:38+02:00 New Revision: 22b6b8d7b53105bb7fbcbb94c7dd77ce028a8c23 URL: https://github.com/llvm/llvm-project/commit/22b6b8d7b53105bb7fbcbb94c7dd77ce028a8c23 DIFF: https://github.com/llvm/llvm-project/commit/22b6b8d7b53105bb7fbcbb94c7dd77ce028a8c23.diff LO

[clang] 2f43ace - [clang][Interp] Fix expected values for Pointer API

2023-10-12 Thread Timm Bäder via cfe-commits
Author: Timm Bäder Date: 2023-10-12T13:08:42+02:00 New Revision: 2f43ace0f48f393e12a15af557aac6a8f84bfd2b URL: https://github.com/llvm/llvm-project/commit/2f43ace0f48f393e12a15af557aac6a8f84bfd2b DIFF: https://github.com/llvm/llvm-project/commit/2f43ace0f48f393e12a15af557aac6a8f84bfd2b.diff LO

[PATCH] D158069: [clang][Interp] Fix getIndex() for composite array elements

2023-10-12 Thread Timm Bäder via Phabricator via cfe-commits
This revision was landed with ongoing or failed builds. This revision was automatically updated to reflect the committed changes. Closed by commit rG2f43ace0f48f: [clang][Interp] Fix expected values for Pointer API (authored by tbaeder). Changed prior to commit: https://reviews.llvm.org/D158069

[clang] e54b0be - [clang][dataflow] Various formatting tweaks to HTMLLogger. (#68392)

2023-10-12 Thread via cfe-commits
Author: martinboehme Date: 2023-10-12T13:12:21+02:00 New Revision: e54b0bef53bcab9d040f1e965e10f3558fafba44 URL: https://github.com/llvm/llvm-project/commit/e54b0bef53bcab9d040f1e965e10f3558fafba44 DIFF: https://github.com/llvm/llvm-project/commit/e54b0bef53bcab9d040f1e965e10f3558fafba44.diff

[clang] [clang][dataflow] Various formatting tweaks to HTMLLogger. (PR #68392)

2023-10-12 Thread via cfe-commits
https://github.com/martinboehme closed https://github.com/llvm/llvm-project/pull/68392 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [ARM] fix "+fp.dp" in multilib selection (PR #67412)

2023-10-12 Thread via cfe-commits
@@ -366,26 +366,50 @@ StringRef ARM::getArchExtFeature(StringRef ArchExt) { } static ARM::FPUKind findDoublePrecisionFPU(ARM::FPUKind InputFPUKind) { + if (InputFPUKind == ARM::FK_INVALID || InputFPUKind == ARM::FK_NONE) +return ARM::FK_INVALID; + + const ARM::FPUName &I

[clang] 28e3552 - [clang][Tests] Add clangTooling dep to Interp unittest

2023-10-12 Thread Timm Bäder via cfe-commits
Author: Timm Bäder Date: 2023-10-12T13:17:06+02:00 New Revision: 28e3552e3ebf12ece3dfc69d707e7c60e21cdc36 URL: https://github.com/llvm/llvm-project/commit/28e3552e3ebf12ece3dfc69d707e7c60e21cdc36 DIFF: https://github.com/llvm/llvm-project/commit/28e3552e3ebf12ece3dfc69d707e7c60e21cdc36.diff LO

[clang] [clang] Add /Zc:__STDC__ flag to clang-cl (PR #68690)

2023-10-12 Thread via cfe-commits
https://github.com/xbjfk updated https://github.com/llvm/llvm-project/pull/68690 >From 92899d94e91a6812de8fa5ec7c15c37a81280108 Mon Sep 17 00:00:00 2001 From: Reagan Bohan Date: Tue, 10 Oct 2023 11:32:47 + Subject: [PATCH 1/5] [clang] Add /Zc:__STDC__ flag to clang-cl This commit adds the /

[clang] [clang] Add /Zc:__STDC__ flag to clang-cl (PR #68690)

2023-10-12 Thread via cfe-commits
xbjfk wrote: Okay, I made sure it says `argument unused during compilation: '/Zc:__STDC__'` and never defines __STDC__ in C++ mode, but I have couple of questions: - Where should I put the test to make sure `-fno-ms-define-stdc` is not accepted? - !IsCXX feels kind of wrong - is this a justi

[clang] [mlir][OpenMP] Added `omp.structured_region` operation (PR #68825)

2023-10-12 Thread Kiran Chandramohan via cfe-commits
@@ -1468,6 +1468,18 @@ LogicalResult CancellationPointOp::verify() { return success(); } +//===--===// +// RegionOp +//===--===// + +Logica

[clang] [mlir][OpenMP] Added `omp.structured_region` operation (PR #68825)

2023-10-12 Thread Kiran Chandramohan via cfe-commits
@@ -1987,4 +1987,40 @@ def ClauseRequiresAttr : EnumAttr { } + +def StructuredRegionOp : OpenMP_Op<"structured_region"> { + let summary = "Encapsulates a region in an OpenMP construct."; + let description = [{ +Encapsulates a region surrounded by an OpenMP Construct. T

[clang-tools-extra] [mlir][OpenMP] Added `omp.structured_region` operation (PR #68825)

2023-10-12 Thread Kiran Chandramohan via cfe-commits
@@ -1987,4 +1987,40 @@ def ClauseRequiresAttr : EnumAttr { } + +def StructuredRegionOp : OpenMP_Op<"structured_region"> { + let summary = "Encapsulates a region in an OpenMP construct."; + let description = [{ +Encapsulates a region surrounded by an OpenMP Construct. T

[clang-tools-extra] [mlir][OpenMP] Added `omp.structured_region` operation (PR #68825)

2023-10-12 Thread Kiran Chandramohan via cfe-commits
@@ -1468,6 +1468,18 @@ LogicalResult CancellationPointOp::verify() { return success(); } +//===--===// +// RegionOp +//===--===// + +Logica

[clang] [analyzer] Fix note for member reference (PR #68691)

2023-10-12 Thread via cfe-commits
@@ -41,3 +41,34 @@ int testRefToNullPtr2() { return *p2; //expected-warning {{Dereference of null pointer}} // expected-note@-1{{Dereference of null pointer}} } + +void testMemberNullPointerDeref() { + struct Wrapper {char c; int *ptr; }; + W

[clang] [analyzer] Fix note for member reference (PR #68691)

2023-10-12 Thread via cfe-commits
https://github.com/DonatNagyE approved this pull request. LGTM; my only suggestions are comment / naming clarifications. https://github.com/llvm/llvm-project/pull/68691 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-

[clang] [analyzer] Fix note for member reference (PR #68691)

2023-10-12 Thread via cfe-commits
@@ -132,6 +132,18 @@ const Expr *bugreporter::getDerefExpr(const Stmt *S) { } // Pattern match for a few useful cases: a[0], p->f, *p etc. else if (const auto *ME = dyn_cast(E)) { + // This handles the case when the dereferencing of a member reference + //

[clang] [analyzer] Fix note for member reference (PR #68691)

2023-10-12 Thread via cfe-commits
https://github.com/DonatNagyE edited https://github.com/llvm/llvm-project/pull/68691 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang]Transform uninstantiated ExceptionSpec in TemplateInstantiator (PR #68878)

2023-10-12 Thread Congcong Cai via cfe-commits
https://github.com/HerrCai0907 created https://github.com/llvm/llvm-project/pull/68878 Fixes #68543, #42496 >From b93096929aa98e17dfdb0240a9285d315fc95bfc Mon Sep 17 00:00:00 2001 From: Congcong Cai Date: Thu, 12 Oct 2023 19:31:08 +0800 Subject: [PATCH] [clang]Transform uninstantiated Exceptio

[clang] [analyzer] Fix note for member reference (PR #68691)

2023-10-12 Thread via cfe-commits
@@ -157,26 +169,43 @@ const Expr *bugreporter::getDerefExpr(const Stmt *S) { return E; } +static const VarDecl *getVarDeclForExpression(const Expr *E) { + if (const auto *DR = dyn_cast(E)) +return dyn_cast(DR->getDecl()); + return nullptr; +} + static const MemRegion

[clang] [analyzer] Fix note for member reference (PR #68691)

2023-10-12 Thread via cfe-commits
@@ -132,6 +132,18 @@ const Expr *bugreporter::getDerefExpr(const Stmt *S) { } // Pattern match for a few useful cases: a[0], p->f, *p etc. else if (const auto *ME = dyn_cast(E)) { + // This handles the case when the dereferencing of a member reference + //

[clang] [clang]Transform uninstantiated ExceptionSpec in TemplateInstantiator (PR #68878)

2023-10-12 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: Congcong Cai (HerrCai0907) Changes Fixes #68543, #42496 --- Full diff: https://github.com/llvm/llvm-project/pull/68878.diff 4 Files Affected: - (modified) clang/docs/ReleaseNotes.rst (+2) - (modified) clang/lib/Sema/SemaTemplateDeducti

[clang] [analyzer] Fix note for member reference (PR #68691)

2023-10-12 Thread Gábor Spaits via cfe-commits
https://github.com/spaits updated https://github.com/llvm/llvm-project/pull/68691 From bb9cb77cab7b073d45c0b998c926a0b60a75a35e Mon Sep 17 00:00:00 2001 From: Gabor Spaits Date: Tue, 10 Oct 2023 13:40:05 +0200 Subject: [PATCH 1/3] [analyzer] Fix note for member reference --- .../Core/BugRepor

[clang] [analyzer] Fix note for member reference (PR #68691)

2023-10-12 Thread Gábor Spaits via cfe-commits
https://github.com/spaits updated https://github.com/llvm/llvm-project/pull/68691 From bb9cb77cab7b073d45c0b998c926a0b60a75a35e Mon Sep 17 00:00:00 2001 From: Gabor Spaits Date: Tue, 10 Oct 2023 13:40:05 +0200 Subject: [PATCH 1/4] [analyzer] Fix note for member reference --- .../Core/BugRepor

[clang] [analyzer] Fix note for member reference (PR #68691)

2023-10-12 Thread Gábor Spaits via cfe-commits
https://github.com/spaits updated https://github.com/llvm/llvm-project/pull/68691 From bb9cb77cab7b073d45c0b998c926a0b60a75a35e Mon Sep 17 00:00:00 2001 From: Gabor Spaits Date: Tue, 10 Oct 2023 13:40:05 +0200 Subject: [PATCH 1/5] [analyzer] Fix note for member reference --- .../Core/BugRepor

[clang] [analyzer] Fix note for member reference (PR #68691)

2023-10-12 Thread Gábor Spaits via cfe-commits
https://github.com/spaits updated https://github.com/llvm/llvm-project/pull/68691 From bb9cb77cab7b073d45c0b998c926a0b60a75a35e Mon Sep 17 00:00:00 2001 From: Gabor Spaits Date: Tue, 10 Oct 2023 13:40:05 +0200 Subject: [PATCH 1/6] [analyzer] Fix note for member reference --- .../Core/BugRepor

[clang] [ASAN] Adjust asan instrumented GlobalVariable size to not include redzone (PR #66666)

2023-10-12 Thread Mitch Phillips via cfe-commits
hctim wrote: My gut feeling is that it's a really bad idea to have a global variable whose symtab size differs from the underlying GV size. So I tested against lld, gold, and ld, and they all seem to end up with `int`-typed GVs having a filesize of 32 bytes and an ELF `st_size` of 4 bytes, and

[clang] e44c9fd - [Clang] Regenerate test checks (NFC)

2023-10-12 Thread Nikita Popov via cfe-commits
Author: Nikita Popov Date: 2023-10-12T14:24:26+02:00 New Revision: e44c9fd197a2209b6b7b266fb0a381ee8fcec12b URL: https://github.com/llvm/llvm-project/commit/e44c9fd197a2209b6b7b266fb0a381ee8fcec12b DIFF: https://github.com/llvm/llvm-project/commit/e44c9fd197a2209b6b7b266fb0a381ee8fcec12b.diff

[clang] [flang] add tbaa tags to global and direct values (PR #68727)

2023-10-12 Thread Tom Eccles via cfe-commits
https://github.com/tblah edited https://github.com/llvm/llvm-project/pull/68727 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [ARM] fix "+fp.dp" in multilib selection (PR #67412)

2023-10-12 Thread via cfe-commits
@@ -420,20 +444,35 @@ bool ARM::appendArchExtFeatures(StringRef CPU, ARM::ArchKind AK, CPU = "generic"; if (ArchExt == "fp" || ArchExt == "fp.dp") { +const ARM::FPUKind DefaultFPU = getDefaultFPU(CPU, AK); ARM::FPUKind FPUKind; if (ArchExt == "fp.dp") { +

[PATCH] D158069: [clang][Interp] Fix getIndex() for composite array elements

2023-10-12 Thread Nico Weber via Phabricator via cfe-commits
thakis added inline comments. Comment at: clang/unittests/AST/Interp/CMakeLists.txt:2 +add_clang_unittest(InterpTests + Descriptor.cpp + ) Why is this in a separate executable instead of in ASTTests? So it can have fewer deps? Repository: rG LLVM Github Mo

[clang] [InstCombine] Canonicalize constant GEPs to i8 source element type (PR #68882)

2023-10-12 Thread Nikita Popov via cfe-commits
@@ -560,14 +560,15 @@ define i32 @test28() nounwind { ; CHECK-NEXT: entry: ; CHECK-NEXT:[[ORIENTATIONS:%.*]] = alloca [1 x [1 x %struct.x]], align 8 ; CHECK-NEXT:[[T3:%.*]] = call i32 @puts(ptr noundef nonnull dereferenceable(1) @.str) #[[ATTR0]] +; CHECK-NEXT:[[

[clang] [InstCombine] Canonicalize constant GEPs to i8 source element type (PR #68882)

2023-10-12 Thread Nikita Popov via cfe-commits
@@ -3,8 +3,9 @@ define ptr @f1(ptr %arg, i64 %arg1) { ; CHECK-LABEL: @f1( -; CHECK-NEXT:[[TMP1:%.*]] = getelementptr [6 x i32], ptr [[ARG:%.*]], i64 3, i64 [[ARG1:%.*]] -; CHECK-NEXT:ret ptr [[TMP1]] +; CHECK-NEXT:[[TMP1:%.*]] = getelementptr i8, ptr [[ARG:%.*]],

[clang] [InstCombine] Canonicalize constant GEPs to i8 source element type (PR #68882)

2023-10-12 Thread Nikita Popov via cfe-commits
https://github.com/nikic edited https://github.com/llvm/llvm-project/pull/68882 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [InstCombine] Canonicalize constant GEPs to i8 source element type (PR #68882)

2023-10-12 Thread Nikita Popov via cfe-commits
https://github.com/nikic commented: I looked through the test diffs, and it seems like the only substantial regressions are all related to the indexed compare fold, which should be made type-independent. https://github.com/llvm/llvm-project/pull/68882 __

[clang] [InstCombine] Canonicalize constant GEPs to i8 source element type (PR #68882)

2023-10-12 Thread Nikita Popov via cfe-commits
@@ -597,14 +598,13 @@ define ptr @gep_of_phi_of_gep_different_type(i1 %c, ptr %p) { ; CHECK-LABEL: @gep_of_phi_of_gep_different_type( ; CHECK-NEXT:br i1 [[C:%.*]], label [[IF:%.*]], label [[ELSE:%.*]] ; CHECK: if: -; CHECK-NEXT:[[GEP1:%.*]] = getelementptr i32, p

[clang] [InstCombine] Canonicalize constant GEPs to i8 source element type (PR #68882)

2023-10-12 Thread Nikita Popov via cfe-commits
@@ -637,9 +637,8 @@ define ptr @select_of_gep(i1 %c, ptr %p) { define ptr @select_of_gep_different_type(i1 %c, ptr %p) { ; CHECK-LABEL: @select_of_gep_different_type( -; CHECK-NEXT:[[GEP1:%.*]] = getelementptr i32, ptr [[P:%.*]], i64 1 -; CHECK-NEXT:[[GEP2:%.*]] = gete

[clang] [InstCombine] Canonicalize constant GEPs to i8 source element type (PR #68882)

2023-10-12 Thread Nikita Popov via cfe-commits
@@ -6,15 +6,16 @@ target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:32-f3 define ptr@test1(ptr %A, i32 %Offset) { ; CHECK-LABEL: @test1( ; CHECK-NEXT: entry: +; CHECK-NEXT:[[TMP:%.*]] = getelementptr inbounds i32, ptr [[A:%.*]], i32 [[OFFSET:%.*]

[PATCH] D158069: [clang][Interp] Fix getIndex() for composite array elements

2023-10-12 Thread Timm Bäder via Phabricator via cfe-commits
tbaeder added inline comments. Comment at: clang/unittests/AST/Interp/CMakeLists.txt:2 +add_clang_unittest(InterpTests + Descriptor.cpp + ) thakis wrote: > Why is this in a separate executable instead of in ASTTests? So it can have > fewer deps? Mostly because

[clang] [time-trace] Add a new time trace scope variable named "ParseDeclarationOrFunctionDefinition". (PR #65268)

2023-10-12 Thread via cfe-commits
https://github.com/MaggieYingYi updated https://github.com/llvm/llvm-project/pull/65268 >From cc5cf9500cbdbb2fdd332c7de26c0516e49594bf Mon Sep 17 00:00:00 2001 From: Ying Yi Date: Fri, 1 Sep 2023 15:30:44 +0100 Subject: [PATCH 1/2] Add a new time trace scope variable named "ParseDeclarationOrF

[clang] [time-trace] Add a new time trace scope variable named "ParseDeclarationOrFunctionDefinition". (PR #65268)

2023-10-12 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang-driver Author: None (MaggieYingYi) Changes When profiling code using `-ftime-trace` with the default `time-trace-granularity` value (500 microseconds), in some code there is a large empty timeline in the flame chart profiling view (using Chrome T

[clang] [clang][Interp] Add explicit dummy descriptors (PR #68888)

2023-10-12 Thread Timm Baeder via cfe-commits
https://github.com/tbaederr created https://github.com/llvm/llvm-project/pull/6 Instead of (ab)using incomplete array types for this, add a 'Dummy' bit to Descriptor. We need to be able to differentiate between the two when adding an offset. >From 03184302329bfd3e02cd97ccfa26613379d8767f

[clang] [clang][Interp] Add explicit dummy descriptors (PR #68888)

2023-10-12 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: Timm Baeder (tbaederr) Changes Instead of (ab)using incomplete array types for this, add a 'Dummy' bit to Descriptor. We need to be able to differentiate between the two when adding an offset. --- Full diff: https://github.com/llvm/llvm-

[clang] [clang][Interp] Only evaluate the source array initialization of an `ArrayInitLoopExpr` once (PR #68039)

2023-10-12 Thread Timm Baeder via cfe-commits
https://github.com/tbaederr requested changes to this pull request. https://github.com/llvm/llvm-project/pull/68039 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][Interp] Only evaluate the source array initialization of an `ArrayInitLoopExpr` once (PR #68039)

2023-10-12 Thread Timm Baeder via cfe-commits
https://github.com/tbaederr edited https://github.com/llvm/llvm-project/pull/68039 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][Interp] Only evaluate the source array initialization of an `ArrayInitLoopExpr` once (PR #68039)

2023-10-12 Thread Timm Baeder via cfe-commits
@@ -478,6 +480,43 @@ template class SourceLocScope final { bool Enabled = false; }; +template class StoredOpaqueValueScope final { +public: + StoredOpaqueValueScope(ByteCodeExprGen *Ctx) : Ctx(Ctx) {} + + bool VisitAndStoreOpaqueValue(const OpaqueValueExpr *Ove) { +a

[clang] [clang][Interp] Only evaluate the source array initialization of an `ArrayInitLoopExpr` once (PR #68039)

2023-10-12 Thread Timm Baeder via cfe-commits
@@ -478,6 +480,43 @@ template class SourceLocScope final { bool Enabled = false; }; +template class StoredOpaqueValueScope final { +public: + StoredOpaqueValueScope(ByteCodeExprGen *Ctx) : Ctx(Ctx) {} + + bool VisitAndStoreOpaqueValue(const OpaqueValueExpr *Ove) { +a

[clang] [clang][Interp] Only evaluate the source array initialization of an `ArrayInitLoopExpr` once (PR #68039)

2023-10-12 Thread Timm Baeder via cfe-commits
@@ -366,8 +363,7 @@ namespace ArrayInitLoop { auto [a, b, c] = f(n).arr; return a + b + c; } - static_assert(g() == 6); // expected-error {{failed}} \ - // expected-note {{15 == 6}} + static_assert(g() == 6); tbaederr w

[clang] [clang][Interp] Only evaluate the source array initialization of an `ArrayInitLoopExpr` once (PR #68039)

2023-10-12 Thread Timm Baeder via cfe-commits
@@ -827,6 +829,9 @@ bool ByteCodeExprGen::VisitArrayInitLoopExpr( template bool ByteCodeExprGen::VisitOpaqueValueExpr(const OpaqueValueExpr *E) { + if (OpaqueExprs.contains(E)) +return this->emitGetLocal(*classify(E), OpaqueExprs[E], E); tbaederr wrote:

[clang] [time-trace] Add a new time trace scope variable named "ParseDeclarationOrFunctionDefinition". (PR #65268)

2023-10-12 Thread via cfe-commits
@@ -1224,6 +1225,9 @@ Parser::DeclGroupPtrTy Parser::ParseDeclOrFunctionDefInternal( Parser::DeclGroupPtrTy Parser::ParseDeclarationOrFunctionDefinition( ParsedAttributes &Attrs, ParsedAttributes &DeclSpecAttrs, ParsingDeclSpec *DS, AccessSpecifier AS) { + // Add an e

[clang] [clang][Interp] Fix crash during `InterpStack` printing (PR #68246)

2023-10-12 Thread Timm Baeder via cfe-commits
tbaederr wrote: > Although the previous > implementation didn't have unittests either, so I'm not sure if we actually > care that much or not. We don't, I think I've used this function once. But I don't want to delete it either because it could come in handy in the future. LGTM https://gith

[clang] [clang][Interp] Fix crash during `InterpStack` printing (PR #68246)

2023-10-12 Thread Timm Baeder via cfe-commits
https://github.com/tbaederr approved this pull request. https://github.com/llvm/llvm-project/pull/68246 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [CodeGen][OpenMP] Set the default schedule for loops to static,1 if TSan is enabled (PR #68891)

2023-10-12 Thread via cfe-commits
https://github.com/felilxtomski created https://github.com/llvm/llvm-project/pull/68891 To ease the race detection in OpenMP for loops where no schedule is specified as in the new archer test from DRB. >From 6f6cba41a85598f28e70fbfdebcd3e5aef4e9df4 Mon Sep 17 00:00:00 2001 From: "felix.tomski"

[clang] [CodeGen][OpenMP] Set the default schedule for loops to static,1 if TSan is enabled (PR #68891)

2023-10-12 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 30240e428f0ec7d4a6d1b84f9f807ce12b46cfd1 8b25e95008c4d794c4423d026c39382a0c7cfbf8 --

[clang] [CUDA][HIP] Fix host/device context in concept (PR #67721)

2023-10-12 Thread Yaxun Liu via cfe-commits
yxsamliu wrote: ping https://github.com/llvm/llvm-project/pull/67721 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [CodeGen][OpenMP] Set the default schedule for loops to static,1 if TSan is enabled (PR #68891)

2023-10-12 Thread Shilei Tian via cfe-commits
@@ -0,0 +1,161 @@ +/* + * DRB006-indirectaccess2-orig-yes.c -- Archer testcase + */ +//===--===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// +// See tools/archer/LIC

[clang] [ASAN] Adjust asan instrumented GlobalVariable size to not include redzone (PR #66666)

2023-10-12 Thread via cfe-commits
b-sumner wrote: @hctim *any* implementation will have a problem when copying the redzone padding. That is simply because the redzone is poisoned (hence the name). Any access to a poisoned location will be reported and the application terminated. That is how ASAN works. https://github.com/l

[clang] [clang]Transform uninstantiated ExceptionSpec in TemplateInstantiator (PR #68878)

2023-10-12 Thread Erich Keane via cfe-commits
https://github.com/erichkeane commented: I'll have to think on this... First blush is that it is fine, but I want a chance to get other opinions as well https://github.com/llvm/llvm-project/pull/68878 ___ cfe-commits mailing list cfe-commits@lists.llv

[clang] [clang]Transform uninstantiated ExceptionSpec in TemplateInstantiator (PR #68878)

2023-10-12 Thread Erich Keane via cfe-commits
@@ -377,6 +377,8 @@ Bug Fixes in This Version cannot be used with ``Release`` mode builds. (`#68237 `_). - Fix crash in evaluating ``constexpr`` value for invalid template function. Fixes (`#68542

[clang] [clang]Transform uninstantiated ExceptionSpec in TemplateInstantiator (PR #68878)

2023-10-12 Thread Erich Keane via cfe-commits
https://github.com/erichkeane edited https://github.com/llvm/llvm-project/pull/68878 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [flang][driver] support -dumpversion and -dumpmachine (PR #68896)

2023-10-12 Thread Yuanfang Chen via cfe-commits
https://github.com/yuanfang-chen created https://github.com/llvm/llvm-project/pull/68896 Match GCC driver. GCC has -cc1/-fc1 support too, but this patch does not address that. >From b248b63c74853cfd57809ffc32f437c517a926ef Mon Sep 17 00:00:00 2001 From: Yuanfang Chen Date: Thu, 12 Oct 2023 07

[clang] [flang][driver] support -dumpversion and -dumpmachine (PR #68896)

2023-10-12 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-flang-driver Author: Yuanfang Chen (yuanfang-chen) Changes Match GCC driver. GCC has -cc1/-fc1 support too, but this patch does not address that. --- Full diff: https://github.com/llvm/llvm-project/pull/68896.diff 7 Files Affected: - (modified) clan

[clang] [Sema] Add check for bitfield assignments to larger integral types (PR #68276)

2023-10-12 Thread via cfe-commits
vabridgers wrote: Hi all, I believe all comments have been addressed to date. Please let me know if there's anything else required. Thank you! https://github.com/llvm/llvm-project/pull/68276 ___ cfe-commits mailing list cfe-commits@lists.llvm.org htt

[clang] Add Documentation for Execution Results Handling in Clang-Repl (PR #65650)

2023-10-12 Thread Vassil Vassilev via cfe-commits
https://github.com/vgvassilev approved this pull request. LGTM! Let's move forward. https://github.com/llvm/llvm-project/pull/65650 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] b9b8fc4 - Add Documentation for Execution Results Handling in Clang-Repl (#65650)

2023-10-12 Thread via cfe-commits
Author: Krishna Narayanan Date: 2023-10-12T07:31:56-07:00 New Revision: b9b8fc4878b6f7708f2ca2df6036a9c7bb5077b0 URL: https://github.com/llvm/llvm-project/commit/b9b8fc4878b6f7708f2ca2df6036a9c7bb5077b0 DIFF: https://github.com/llvm/llvm-project/commit/b9b8fc4878b6f7708f2ca2df6036a9c7bb5077b0.d

[clang] Add Documentation for Execution Results Handling in Clang-Repl (PR #65650)

2023-10-12 Thread Vassil Vassilev via cfe-commits
https://github.com/vgvassilev closed https://github.com/llvm/llvm-project/pull/65650 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[PATCH] D153131: [clang analysis][thread-safety] Handle return-by-reference...

2023-10-12 Thread Clement Courbet via Phabricator via cfe-commits
courbet added a comment. In D153131#4653664 , @aaronpuchert wrote: > In D153131#4653564 , @courbet wrote: > >> We have a large number of users of `-Werror -Wthread-safety-analysis` >> internally. When we make th

[clang] [time-trace] Add a new time trace scope variable named "ParseDeclarationOrFunctionDefinition". (PR #65268)

2023-10-12 Thread Aaron Ballman via cfe-commits
@@ -1224,6 +1225,9 @@ Parser::DeclGroupPtrTy Parser::ParseDeclOrFunctionDefInternal( Parser::DeclGroupPtrTy Parser::ParseDeclarationOrFunctionDefinition( ParsedAttributes &Attrs, ParsedAttributes &DeclSpecAttrs, ParsingDeclSpec *DS, AccessSpecifier AS) { + // Add an e

[clang] [Driver] Have -rdynamic be a no-op on Haiku (PR #67872)

2023-10-12 Thread Niels Sascha Reedijk via cfe-commits
nielx wrote: Can confirm this is the case on Haiku and this is expected behaviour. Unfortunately, I do not have reviewing rights in GitHub. https://github.com/llvm/llvm-project/pull/67872 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https:/

[clang] [clang] Add information about lld presence in RISCVToolchain. (PR #68904)

2023-10-12 Thread Bushev Dmitry via cfe-commits
https://github.com/dybv-sc created https://github.com/llvm/llvm-project/pull/68904 When compiling for target riscv64/32-uknown-elf clang assumes that it do not use lld linker even if explicitly told ('-fuse-ld=lld'). >From 8512bbcee108751776591160797af32885377587 Mon Sep 17 00:00:00 2001 From:

[clang] [clang] Add information about lld presence in RISCVToolchain. (PR #68904)

2023-10-12 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang-driver Author: Bushev Dmitry (dybv-sc) Changes When compiling for target riscv64/32-uknown-elf clang assumes that it do not use lld linker even if explicitly told ('-fuse-ld=lld'). --- Full diff: https://github.com/llvm/llvm-project/pull/68904.di

[clang] [LLVM] Add new attribute `optdebug` to optimize for debugging (PR #66632)

2023-10-12 Thread Stephen Tozer via cfe-commits
https://github.com/SLTozer updated https://github.com/llvm/llvm-project/pull/66632 >From 18f494a4006b4c21b364a91107d4a07ceaf88213 Mon Sep 17 00:00:00 2001 From: Stephen Tozer Date: Mon, 18 Sep 2023 09:59:11 +0100 Subject: [PATCH 1/3] [LLVM] Add new attribute `optdebug` to optimize for debuggin

[clang] [clang] Add information about lld presence in RISCVToolchain. (PR #68904)

2023-10-12 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 a574ef61766d49db4350b6f06a108f36bccb25bb 8512bbcee108751776591160797af32885377587 --

[clang] [Sema] Add check for bitfield assignments to larger integral types (PR #68276)

2023-10-12 Thread Aaron Ballman via cfe-commits
https://github.com/AaronBallman approved this pull request. Just some minor things to cleanup, but this otherwise LGTM, thank you! https://github.com/llvm/llvm-project/pull/68276 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llv

[clang] [Sema] Add check for bitfield assignments to larger integral types (PR #68276)

2023-10-12 Thread Aaron Ballman via cfe-commits
https://github.com/AaronBallman edited https://github.com/llvm/llvm-project/pull/68276 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Sema] Add check for bitfield assignments to larger integral types (PR #68276)

2023-10-12 Thread Aaron Ballman via cfe-commits
@@ -0,0 +1,37 @@ +// RUN: %clang_cc1 -Wconversion -fsyntax-only -verify %s +// RUN: %clang_cc1 -Wbitfield-conversion -fsyntax-only -verify %s + +typedef struct _xx { + int bf:9; // expected-note{{declared here}} + // expected-note@-1{{declared here}} + // expected-note

  1   2   3   >