[clang] buffer rsrc builtin (PR #95276)

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

[clang] [Clang][AMDGPU] Add a builtin for llvm.amdgcn.make.buffer.rsrc intrinsic (PR #95276)

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

[clang] [Clang][AMDGPU] Add a builtin for llvm.amdgcn.make.buffer.rsrc intrinsic (PR #95276)

2024-06-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 ea2ee5dc2f14a17ff4486b41c9475c0b261412a4 d42a42de8596b63712aa7a7fc79d1790c7bd9f09 --

[clang] [llvm] [DebugInfo][BPF] Add 'btf:type_tag' annotation in DWARF (PR #91423)

2024-06-12 Thread via cfe-commits
https://github.com/eddyz87 updated https://github.com/llvm/llvm-project/pull/91423 >From 475699f1f8cbe17c41a1c9a8be9584c357855a21 Mon Sep 17 00:00:00 2001 From: Eduard Zingerman Date: Tue, 14 Feb 2023 00:49:33 +0200 Subject: [PATCH 1/3] [DebugInfo][BPF] Add 'annotations' field for DIBasicType

[clang] [Clang][AMDGPU] Add a builtin for llvm.amdgcn.make.buffer.rsrc intrinsic (PR #95276)

2024-06-12 Thread Matt Arsenault via cfe-commits
@@ -0,0 +1,14 @@ +// NOTE: Assertions have been autogenerated by utils/update_cc_test_checks.py +// REQUIRES: amdgpu-registered-target +// RUN: %clang_cc1 -triple amdgcn-unknown-unknown -target-cpu verde -emit-llvm -o - %s | FileCheck %s +// RUN: %clang_cc1 -triple amdgcn-unknown

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

2024-06-12 Thread Carlos Galvez via cfe-commits
Paul =?utf-8?q?Heidekrüger?= , Paul =?utf-8?q?Heidekrüger?= , Paul =?utf-8?q?Heidekrüger?= , Paul =?utf-8?q?Heidekrüger?= , Paul =?utf-8?q?Heidekrüger?= , Paul =?utf-8?q?Heidekrüger?= , Paul =?utf-8?q?Heidekrüger?= , Paul =?utf-8?q?Heidekrüger?= Message-ID: In-Reply-To: carlosgalvezp wrote: >

[clang] [llvm] Reapply "[llvm][IR] Extend BranchWeightMetadata to track provenance o… (PR #95281)

2024-06-12 Thread Paul Kirth via cfe-commits
https://github.com/ilovepi created https://github.com/llvm/llvm-project/pull/95281 …f weights" #95136 Reverts #95060, and relands #86609, with the unintended code generation changes addressed. This patch implements the changes to LLVM IR discussed in https://discourse.llvm.org/t/rfc-update-b

[clang] [llvm] Reapply "[llvm][IR] Extend BranchWeightMetadata to track provenance of weights" (PR #95136)

2024-06-12 Thread Paul Kirth via cfe-commits
ilovepi wrote: So, I think I made a mistake when I started the revert w/ the `revert` button. That created a very long branch name, and I'm a bit concerned I can't update it easily. I'm about 80% sure `git push g...@github.com:llvm/llvm-project.git HEAD:revert-95060-revert-86609-users/ilovepi

[clang] [llvm] Reapply "[llvm][IR] Extend BranchWeightMetadata to track provenance of weights" (PR #95136)

2024-06-12 Thread Paul Kirth via cfe-commits
https://github.com/ilovepi closed https://github.com/llvm/llvm-project/pull/95136 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] Reapply "[llvm][IR] Extend BranchWeightMetadata to track provenance o… (PR #95281)

2024-06-12 Thread Paul Kirth via cfe-commits
https://github.com/ilovepi ready_for_review https://github.com/llvm/llvm-project/pull/95281 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] Reapply "[llvm][IR] Extend BranchWeightMetadata to track provenance o… (PR #95281)

2024-06-12 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-pgo Author: Paul Kirth (ilovepi) Changes …f weights" #95136 Reverts #95060, and relands #86609, with the unintended code generation changes addressed. This patch implements the changes to LLVM IR discussed in https://discourse.llvm.org/t/rfc-update-b

[clang] Support [[guarded_by(mutex)]] attribute inside C struct (PR #94216)

2024-06-12 Thread Dan Liew via cfe-commits
https://github.com/delcypher approved this pull request. Thanks for fixing my requested changes. LGTM https://github.com/llvm/llvm-project/pull/94216 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinf

[clang] [llvm] Reapply "[llvm][IR] Extend BranchWeightMetadata to track provenance o… (PR #95281)

2024-06-12 Thread Paul Kirth via cfe-commits
@@ -241,9 +264,11 @@ void scaleProfData(Instruction &I, uint64_t S, uint64_t T) { if (ProfDataName->getString() == "branch_weights" && ProfileData->getNumOperands() > 0) { // Using APInt::div may be expensive, but most cases should fit 64 bits. -APInt Val(128,

[clang] [llvm] Reapply "[llvm][IR] Extend BranchWeightMetadata to track provenance o… (PR #95281)

2024-06-12 Thread Paul Kirth via cfe-commits
ilovepi wrote: @nikic can you confirm the latest version doesn't regress anything? I tested locally, and with the missing line, the text section is unchanged from the previous commit. https://github.com/llvm/llvm-project/pull/95281 ___ cfe-commits ma

[clang] af0d712 - Support `guarded_by` attribute and related attributes inside C structs and support late parsing them (#94216)

2024-06-12 Thread via cfe-commits
Author: Pierre d'Herbemont Date: 2024-06-12T11:20:05-07:00 New Revision: af0d7128c8fd053d3de8af208d7d1682bc7a525a URL: https://github.com/llvm/llvm-project/commit/af0d7128c8fd053d3de8af208d7d1682bc7a525a DIFF: https://github.com/llvm/llvm-project/commit/af0d7128c8fd053d3de8af208d7d1682bc7a525a.

[clang] Support [[guarded_by(mutex)]] attribute inside C struct (PR #94216)

2024-06-12 Thread Dan Liew via cfe-commits
https://github.com/delcypher closed https://github.com/llvm/llvm-project/pull/94216 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] Support [[guarded_by(mutex)]] attribute inside C struct (PR #94216)

2024-06-12 Thread via cfe-commits
github-actions[bot] wrote: @pdherbemont Congratulations on having your first Pull Request (PR) merged into the LLVM Project! Your changes will be combined with recent changes from other authors, then tested by our [build bots](https://lab.llvm.org/buildbot/). If there is a problem with a bu

[clang] Support [[guarded_by(mutex)]] attribute inside C struct (PR #94216)

2024-06-12 Thread Dan Liew via cfe-commits
delcypher wrote: @pdherbemont I've landed on your behalf. I tweaked the commit message to be more descriptive of the change we finally landed and noted that you are the author of this patch. Thanks again for working on this :) https://github.com/llvm/llvm-project/pull/94216 __

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

2024-06-12 Thread Yaxun Liu via cfe-commits
yxsamliu wrote: > > how does a user initialize/populate this type of objects? by calling a > > builtin function? > > yes. The builtin functions will come next. > > > need a SemaCUDA test to make sure it is defined with %clang_cc1 -triple > > x86_64-unknown-gnu-linux -aux-triple amdgcn-amd-amd

[clang-tools-extra] [clang-tidy] ignoring macro with hash preprocessing token in cppcoreguidelines-macro-usage (PR #95265)

2024-06-12 Thread Piotr Zegar via cfe-commits
https://github.com/PiotrZSL approved this pull request. LGTM https://github.com/llvm/llvm-project/pull/95265 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang][AMDGPU] Add a builtin for llvm.amdgcn.make.buffer.rsrc intrinsic (PR #95276)

2024-06-12 Thread Shilei Tian via cfe-commits
https://github.com/shiltian updated https://github.com/llvm/llvm-project/pull/95276 >From 1b06131a10e1f8067961624b02bba3354d5057c0 Mon Sep 17 00:00:00 2001 From: Shilei Tian Date: Wed, 12 Jun 2024 09:18:49 -0400 Subject: [PATCH 1/2] [Clang][AMDGPU] Add a new builtin type for buffer rsrc --- c

[clang] [flang] [mlir] [flang] Add basic -mtune support (PR #95043)

2024-06-12 Thread Alexis Perry-Holby via cfe-commits
https://github.com/AlexisPerry updated https://github.com/llvm/llvm-project/pull/95043 >From 2312d31b14aecc6eeea2e81d221ee004e5de3efc Mon Sep 17 00:00:00 2001 From: Alexis Perry-Holby Date: Thu, 6 Jun 2024 14:02:52 -0600 Subject: [PATCH 1/6] [flang] Add basic -mtune support --- clang/include/

[clang] [flang] [mlir] [flang] Add basic -mtune support (PR #95043)

2024-06-12 Thread Alexis Perry-Holby via cfe-commits
@@ -32,6 +32,9 @@ class TargetOptions { /// If given, the name of the target CPU to generate code for. std::string cpu; + /// If given, the name of the target CPU to tune code for. + std::string tuneCPU; AlexisPerry wrote: Thank you for the suggestion.

[clang] [clang][CodeGen] Return RValue from `EmitVAArg` (PR #94635)

2024-06-12 Thread Mariya Podchishchaeva via cfe-commits
@@ -325,14 +325,19 @@ Address SparcV9ABIInfo::EmitVAArg(CodeGenFunction &CGF, Address VAListAddr, break; case ABIArgInfo::Ignore: -return Address(llvm::UndefValue::get(ArgPtrTy), ArgTy, TypeInfo.Align); +return CGF.EmitLoadOfAnyValue( +CGF.MakeAddrLValue

[clang] [clang] fix broken canonicalization of DeducedTemplateSpecializationType (PR #95202)

2024-06-12 Thread Matheus Izvekov via cfe-commits
https://github.com/mizvekov updated https://github.com/llvm/llvm-project/pull/95202 >From 5c4fa3ce2ce23fdaf877b71b2775244d15a149d3 Mon Sep 17 00:00:00 2001 From: Matheus Izvekov Date: Wed, 12 Jun 2024 00:42:48 -0300 Subject: [PATCH] [clang] fix broken canonicalization of DeducedTemplateSpecial

[clang] [clang] fix broken canonicalization of DeducedTemplateSpecializationType (PR #95202)

2024-06-12 Thread Matheus Izvekov via cfe-commits
mizvekov wrote: I don't think regression tests are the right level here, we risk creating an unstable test. I have added a new unittest module for Profiling tests. I hope some day we will have time to add one test case for each property of each AST node. Though I still think the first line of

[clang] [flang] [mlir] [flang] Add basic -mtune support (PR #95043)

2024-06-12 Thread Alexis Perry-Holby via cfe-commits
https://github.com/AlexisPerry updated https://github.com/llvm/llvm-project/pull/95043 >From 2312d31b14aecc6eeea2e81d221ee004e5de3efc Mon Sep 17 00:00:00 2001 From: Alexis Perry-Holby Date: Thu, 6 Jun 2024 14:02:52 -0600 Subject: [PATCH 1/7] [flang] Add basic -mtune support --- clang/include/

[clang] [flang] [mlir] [flang] Add basic -mtune support (PR #95043)

2024-06-12 Thread Alexis Perry-Holby via cfe-commits
@@ -1796,6 +1797,10 @@ void ModuleImport::processFunctionAttributes(llvm::Function *func, attr.isStringAttribute()) funcOp.setTargetCpuAttr(StringAttr::get(context, attr.getValueAsString())); + if (llvm::Attribute attr = func->getFnAttribute("tune-cpu"); + att

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

2024-06-12 Thread Dan McArdle via cfe-commits
https://github.com/dmcardle created https://github.com/llvm/llvm-project/pull/95290 With this change, Clang will generate a warning when a constructor is annotated as a trylock function. Issue #92408 >From f717082e700645f1fa6ca738a540aef20c2ba015 Mon Sep 17 00:00:00 2001 From: Dan McArdle Da

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

2024-06-12 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] [llvm] [ConstantFold] Drop gep of gep fold entirely (PR #95126)

2024-06-12 Thread Nikita Popov via cfe-commits
nikic wrote: @agozillon Thanks for looking into this! This change isn't urgent, so I'm happy to wait for your PR to go in first. https://github.com/llvm/llvm-project/pull/95126 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm

[clang] [clang] fix broken canonicalization of DeducedTemplateSpecializationType (PR #95202)

2024-06-12 Thread Matheus Izvekov via cfe-commits
https://github.com/mizvekov updated https://github.com/llvm/llvm-project/pull/95202 >From dadb9244bee22bc303af154b47f527b973940b40 Mon Sep 17 00:00:00 2001 From: Matheus Izvekov Date: Wed, 12 Jun 2024 00:42:48 -0300 Subject: [PATCH] [clang] fix broken canonicalization of DeducedTemplateSpecial

[clang] [flang] [mlir] [flang] Add basic -mtune support (PR #95043)

2024-06-12 Thread Alexis Perry-Holby via cfe-commits
https://github.com/AlexisPerry updated https://github.com/llvm/llvm-project/pull/95043 >From 2312d31b14aecc6eeea2e81d221ee004e5de3efc Mon Sep 17 00:00:00 2001 From: Alexis Perry-Holby Date: Thu, 6 Jun 2024 14:02:52 -0600 Subject: [PATCH 1/8] [flang] Add basic -mtune support --- clang/include/

[clang] [flang] [mlir] [flang] Add basic -mtune support (PR #95043)

2024-06-12 Thread Alexis Perry-Holby via cfe-commits
@@ -371,7 +371,7 @@ static mlir::LogicalResult convertFortranSourceToMLIR( ctx, semanticsContext, defKinds, semanticsContext.intrinsics(), semanticsContext.targetCharacteristics(), parsing.allCooked(), targetTriple, kindMap, loweringOptions, envDefaults, -

[clang] [llvm] [ConstantFold] Drop gep of gep fold entirely (PR #95126)

2024-06-12 Thread via cfe-commits
agozillon wrote: @nikic sounds good, if that changes don't hesitate to ping me and I'll be happy to deactivate the tests for a while (or feel free to do so yourself, just ping to tell me they're off so I know to turn them on again when the PR lands!) https://github.com/llvm/llvm-project/pull/9

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

2024-06-12 Thread Dan McArdle via cfe-commits
https://github.com/dmcardle updated https://github.com/llvm/llvm-project/pull/95290 >From 9a9bf80b0fc51dd4ef660e2a2fe625af26e85c2a Mon Sep 17 00:00:00 2001 From: Dan McArdle Date: Wed, 12 Jun 2024 14:57:49 -0400 Subject: [PATCH] [clang][ThreadSafety] Warn when constructor is trylock With this

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

2024-06-12 Thread Dan McArdle via cfe-commits
https://github.com/dmcardle ready_for_review https://github.com/llvm/llvm-project/pull/95290 ___ 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-12 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: Dan McArdle (dmcardle) Changes With this change, Clang will generate a warning when a constructor is annotated as a trylock function. Issue #92408 --- Full diff: https://github.com/llvm/llvm-project/pull/95290.diff 2 Files Affected: -

[clang] [clang-repl] Lay the foundation of pretty printing for C. (PR #89811)

2024-06-12 Thread Arthur Eubanks via cfe-commits
aeubanks wrote: So actually even the `export_executable_symbols_for_plugins` doesn't fix our bots. I've narrowed it down to `-DLLVM_ENABLE_PIC=ON/OFF`. Perhaps we're not exporting symbols when `-DLLVM_ENABLE_PIC=OFF`. https://github.com/llvm/llvm-project/pull/89811

[clang] [flang] [mlir] [flang] Add basic -mtune support (PR #95043)

2024-06-12 Thread Tobias Gysi via cfe-commits
@@ -1796,6 +1797,10 @@ void ModuleImport::processFunctionAttributes(llvm::Function *func, attr.isStringAttribute()) funcOp.setTargetCpuAttr(StringAttr::get(context, attr.getValueAsString())); + if (llvm::Attribute attr = func->getFnAttribute("tune-cpu"); + att

[clang] [compiler-rt] [llvm] [TypeProf][InstrFDO]Implement more efficient comparison sequence for indirect-call-promotion with vtable profiles. (PR #81442)

2024-06-12 Thread Mingming Liu via cfe-commits
https://github.com/minglotus-6 edited https://github.com/llvm/llvm-project/pull/81442 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [compiler-rt] [llvm] [TypeProf][InstrFDO]Implement more efficient comparison sequence for indirect-call-promotion with vtable profiles. (PR #81442)

2024-06-12 Thread Mingming Liu via cfe-commits
https://github.com/minglotus-6 commented: PTAL, thanks! https://github.com/llvm/llvm-project/pull/81442 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [compiler-rt] [llvm] [TypeProf][InstrFDO]Implement more efficient comparison sequence for indirect-call-promotion with vtable profiles. (PR #81442)

2024-06-12 Thread Mingming Liu via cfe-commits
@@ -103,30 +110,220 @@ static cl::opt ICPDUMPAFTER("icp-dumpafter", cl::init(false), cl::Hidden, cl::desc("Dump IR after transformation happens")); +// This option is meant to be used by LLVM regression test and test the +// transformation that compares vt

[clang] [compiler-rt] [llvm] [TypeProf][InstrFDO]Implement more efficient comparison sequence for indirect-call-promotion with vtable profiles. (PR #81442)

2024-06-12 Thread Mingming Liu via cfe-commits
@@ -276,35 +626,154 @@ CallBase &llvm::pgo::promoteIndirectCall(CallBase &CB, Function *DirectCallee, // Promote indirect-call to conditional direct-call for one callsite. bool IndirectCallPromoter::tryToPromoteWithFuncCmp( -CallBase &CB, const std::vector &Candidates, -

[clang] [compiler-rt] [llvm] [TypeProf][InstrFDO]Implement more efficient comparison sequence for indirect-call-promotion with vtable profiles. (PR #81442)

2024-06-12 Thread Mingming Liu via cfe-commits
@@ -321,14 +790,114 @@ bool IndirectCallPromoter::processFunction(ProfileSummaryInfo *PSI) { if (!NumCandidates || (PSI && PSI->hasProfileSummary() && !PSI->isHotCount(TotalCount))) continue; + auto PromotionCandidates = getPromotionCandidatesForCallSite

[clang] [compiler-rt] [llvm] [TypeProf][InstrFDO]Implement more efficient comparison sequence for indirect-call-promotion with vtable profiles. (PR #81442)

2024-06-12 Thread Mingming Liu via cfe-commits
@@ -276,35 +626,154 @@ CallBase &llvm::pgo::promoteIndirectCall(CallBase &CB, Function *DirectCallee, // Promote indirect-call to conditional direct-call for one callsite. bool IndirectCallPromoter::tryToPromoteWithFuncCmp( -CallBase &CB, const std::vector &Candidates, -

[clang] [compiler-rt] [llvm] [TypeProf][InstrFDO]Implement more efficient comparison sequence for indirect-call-promotion with vtable profiles. (PR #81442)

2024-06-12 Thread Mingming Liu via cfe-commits
@@ -276,35 +626,154 @@ CallBase &llvm::pgo::promoteIndirectCall(CallBase &CB, Function *DirectCallee, // Promote indirect-call to conditional direct-call for one callsite. bool IndirectCallPromoter::tryToPromoteWithFuncCmp( -CallBase &CB, const std::vector &Candidates, -

[clang] [compiler-rt] [llvm] [TypeProf][InstrFDO]Implement more efficient comparison sequence for indirect-call-promotion with vtable profiles. (PR #81442)

2024-06-12 Thread Mingming Liu via cfe-commits
@@ -103,27 +114,226 @@ static cl::opt ICPDUMPAFTER("icp-dumpafter", cl::init(false), cl::Hidden, cl::desc("Dump IR after transformation happens")); +// Indirect call promotion pass will fall back to function-based comparison if +// vtable-count / function-

[clang] [compiler-rt] [llvm] [TypeProf][InstrFDO]Implement more efficient comparison sequence for indirect-call-promotion with vtable profiles. (PR #81442)

2024-06-12 Thread Mingming Liu via cfe-commits
@@ -1967,11 +1969,23 @@ void llvm::updateProfileCallee( uint64_t CloneEntryCount = PriorEntryCount - NewEntryCount; for (auto Entry : *VMap) { if (isa(Entry.first)) -if (auto *CI = dyn_cast_or_null(Entry.second)) +if (auto *CI = dyn_cast_or_null(En

[clang] [compiler-rt] [llvm] [TypeProf][InstrFDO]Implement more efficient comparison sequence for indirect-call-promotion with vtable profiles. (PR #81442)

2024-06-12 Thread Mingming Liu via cfe-commits
@@ -321,14 +746,127 @@ bool IndirectCallPromoter::processFunction(ProfileSummaryInfo *PSI) { if (!NumCandidates || (PSI && PSI->hasProfileSummary() && !PSI->isHotCount(TotalCount))) continue; + auto PromotionCandidates = getPromotionCandidatesForCallSite

[clang] [compiler-rt] [llvm] [TypeProf][InstrFDO]Implement more efficient comparison sequence for indirect-call-promotion with vtable profiles. (PR #81442)

2024-06-12 Thread Mingming Liu via cfe-commits
@@ -321,14 +790,114 @@ bool IndirectCallPromoter::processFunction(ProfileSummaryInfo *PSI) { if (!NumCandidates || (PSI && PSI->hasProfileSummary() && !PSI->isHotCount(TotalCount))) continue; + auto PromotionCandidates = getPromotionCandidatesForCallSite

[clang] [Clang] Fix handling of brace ellison when building deduction guides (PR #94889)

2024-06-12 Thread Haojian Wu via cfe-commits
@@ -10918,22 +10944,24 @@ QualType Sema::DeduceTemplateSpecializationFromInitializer( if (!(RD->getDefinition() && RD->isAggregate())) return; QualType Ty = Context.getRecordType(RD); - SmallVector ElementTypes; - - InitListChecker CheckInitList(*

[clang] [Clang] Fix handling of brace ellison when building deduction guides (PR #94889)

2024-06-12 Thread Haojian Wu via cfe-commits
@@ -1449,7 +1449,10 @@ void InitListChecker::CheckSubElementType(const InitializedEntity &Entity, // dependent non-array type or an array type with a value-dependent // bound assert(AggrDeductionCandidateParamTypes); - if (!isa_and_nonnull( + //

[clang] [clang][CodeGen] Return RValue from `EmitVAArg` (PR #94635)

2024-06-12 Thread Eli Friedman via cfe-commits
@@ -789,27 +791,37 @@ Address AArch64ABIInfo::EmitAAPCSVAArg(Address VAListAddr, QualType Ty, OnStackBlock, "vaargs.addr"); if (IsIndirect) -return Address(CGF.Builder.CreateLoad(ResAddr, "vaarg.addr"), ElementTy, - TyA

[clang] [clang] Skip auto-init on scalar vars that have a non-constant Init and no self-ref (PR #94642)

2024-06-12 Thread Jan Voung via cfe-commits
https://github.com/jvoung updated https://github.com/llvm/llvm-project/pull/94642 >From 23ee93af279360dc94cc34f47f9bbef2ba40f815 Mon Sep 17 00:00:00 2001 From: Jan Voung Date: Thu, 6 Jun 2024 16:32:20 + Subject: [PATCH 1/3] Skip auto-init on scalar vars that have a non-constant Init and no

[clang] [clang][CodeGen] Return RValue from `EmitVAArg` (PR #94635)

2024-06-12 Thread Eli Friedman via cfe-commits
@@ -789,27 +791,37 @@ Address AArch64ABIInfo::EmitAAPCSVAArg(Address VAListAddr, QualType Ty, OnStackBlock, "vaargs.addr"); if (IsIndirect) -return Address(CGF.Builder.CreateLoad(ResAddr, "vaarg.addr"), ElementTy, - TyA

[clang] [flang] [flang] Add -mlink-builtin-bitcode option to fc1 (PR #94763)

2024-06-12 Thread Andrzej Warzyński via cfe-commits
https://github.com/banach-space approved this pull request. https://github.com/llvm/llvm-project/pull/94763 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-repl] Lay the foundation of pretty printing for C. (PR #89811)

2024-06-12 Thread Vassil Vassilev via cfe-commits
vgvassilev wrote: > So actually even the `export_executable_symbols_for_plugins` doesn't fix our > bots. I've narrowed it down to `-DLLVM_ENABLE_PIC=ON/OFF`. Perhaps we're not > exporting symbols when `-DLLVM_ENABLE_PIC=OFF`. That’s quite strange. Is that somehow related to ld64? @lhames donyi

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

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

[clang] (New) Add option to generate additional debug info for expression dereferencing pointer to pointers (PR #95298)

2024-06-12 Thread William Junda Huang via cfe-commits
https://github.com/huangjd created https://github.com/llvm/llvm-project/pull/95298 This is a different implementation to #94100, which has been reverted. When -fdebug-info-for-profiling is specified, for any Load expression if the pointer operand is not a declared variable, clang will emit deb

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

2024-06-12 Thread Shilei Tian via cfe-commits
@@ -0,0 +1,6 @@ +// RUN: %clang_cc1 -triple x86_64-unknown-linux-gnu -x hip -aux-triple amdgcn-amd-amdhsa %s -fsyntax-only -verify + +#define __device__ __attribute__((device)) + +__device__ __buffer_rsrc_t test_buffer_rsrc_t_device() {} // expected-warning {{non-void function d

[clang] (New) Add option to generate additional debug info for expression dereferencing pointer to pointers (PR #95298)

2024-06-12 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang-codegen Author: William Junda Huang (huangjd) Changes This is a different implementation to #94100, which has been reverted. When -fdebug-info-for-profiling is specified, for any Load expression if the pointer operand is not a declared variable,

[clang] (New) Add option to generate additional debug info for expression dereferencing pointer to pointers (PR #95298)

2024-06-12 Thread William Junda Huang via cfe-commits
huangjd wrote: It seems the restriction for dbg.value appearing in the front end was lifted recently, so now I can just emit dbg.value directly https://github.com/llvm/llvm-project/pull/95298 ___ cfe-commits mailing list cfe-commits@lists.llvm.org ht

[clang] added regcall struct by reg support (PR #95257)

2024-06-12 Thread Eli Friedman via cfe-commits
efriedma-quic wrote: Do you have a reference for the rules you're implementing? https://github.com/llvm/llvm-project/pull/95257 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] Skip auto-init on scalar vars that have a non-constant Init and no self-ref (PR #94642)

2024-06-12 Thread Jan Voung via cfe-commits
@@ -15,7 +15,7 @@ struct Foo { int foo(unsigned n) { bool var_size_1; - long var_size_8 = 123; jvoung wrote: Sure! Added those cases. https://github.com/llvm/llvm-project/pull/94642 ___ cfe-commits mailing list

[clang] [clang] Skip auto-init on scalar vars that have a non-constant Init and no self-ref (PR #94642)

2024-06-12 Thread Jan Voung via cfe-commits
jvoung wrote: > Drive-by comment: can you please either merge the two commits together, or > change their descriptions so that they are not 100% identical? Oops, changed the later commit description! https://github.com/llvm/llvm-project/pull/94642 __

[clang] [llvm] Reapply "[llvm][IR] Extend BranchWeightMetadata to track provenance o… (PR #95281)

2024-06-12 Thread Nikita Popov via cfe-commits
https://github.com/nikic approved this pull request. Looks good now, no text size of compile-time changes. https://github.com/llvm/llvm-project/pull/95281 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/li

[clang] (New) Add option to generate additional debug info for expression dereferencing pointer to pointers (PR #95298)

2024-06-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 511a1957258a16157e38f1a49e3de04e82ef001d 0c49ae55b4b05a9c701288f106c138cab4af37f0 --

[clang] 294f3ce - Reapply "[llvm][IR] Extend BranchWeightMetadata to track provenance o… (#95281)

2024-06-12 Thread via cfe-commits
Author: Paul Kirth Date: 2024-06-12T12:52:28-07:00 New Revision: 294f3ce5dde916c358d8f672b4a1c706c0387154 URL: https://github.com/llvm/llvm-project/commit/294f3ce5dde916c358d8f672b4a1c706c0387154 DIFF: https://github.com/llvm/llvm-project/commit/294f3ce5dde916c358d8f672b4a1c706c0387154.diff LO

[clang] [llvm] Reapply "[llvm][IR] Extend BranchWeightMetadata to track provenance o… (PR #95281)

2024-06-12 Thread Paul Kirth via cfe-commits
https://github.com/ilovepi closed https://github.com/llvm/llvm-project/pull/95281 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-tools-extra] Revert "✨ [Sema, Lex, Parse] Preprocessor embed in C and C++ (and Obj-C and Obj-C++ by-proxy)" (PR #95299)

2024-06-12 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang-tools-extra @llvm/pr-subscribers-clang-codegen @llvm/pr-subscribers-clang-static-analyzer-1 Author: Vitaly Buka (vitalybuka) Changes Reverts llvm/llvm-project#68620 Introduce or expose a memory leak and UB, see llvm/llvm-project#68620 --- Patch

[clang] [clang-tools-extra] Revert "✨ [Sema, Lex, Parse] Preprocessor embed in C and C++ (and Obj-C and Obj-C++ by-proxy)" (PR #95299)

2024-06-12 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang-driver Author: Vitaly Buka (vitalybuka) Changes Reverts llvm/llvm-project#68620 Introduce or expose a memory leak and UB, see llvm/llvm-project#68620 --- Patch is 185.50 KiB, truncated to 20.00 KiB below, full version: https://github.com/llvm/l

[clang] [clang-tools-extra] Revert "✨ [Sema, Lex, Parse] Preprocessor embed in C and C++ (and Obj-C and Obj-C++ by-proxy)" (PR #95299)

2024-06-12 Thread Vitaly Buka via cfe-commits
vitalybuka wrote: The patch is large, so I'll take another look, if there is a trivial fix. So please approve without merging. https://github.com/llvm/llvm-project/pull/95299 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.or

[clang] [clang-tools-extra] Revert "✨ [Sema, Lex, Parse] Preprocessor embed in C and C++ (and Obj-C and Obj-C++ by-proxy)" (PR #95299)

2024-06-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 7b8038426c52d5fee9c2f4cfe3e747e3a2b8efec 2f331308fcdc9c0d94644b673b61cbe478b6ed6f --

[clang] [Clang][AMDGPU] Add a builtin for llvm.amdgcn.make.buffer.rsrc intrinsic (PR #95276)

2024-06-12 Thread Yaxun Liu via cfe-commits
yxsamliu wrote: I am wondering whether prefix the builtin type with `__amdgcn_` would be better since I envision risk of conflicting with reserved names of other compilers or standard libraries. https://github.com/llvm/llvm-project/pull/95276 ___ cfe

[clang] [llvm] [clang] Reland Add tanf16 builtin and support for tan constrained intrinsic (PR #94559)

2024-06-12 Thread Arthur Eubanks via cfe-commits
aeubanks wrote: I believe this has exposed a preexisting issue in isel with tan: ``` $ cat /tmp/b.ll target datalayout = "e-m:e-p:32:32-Fi8-i64:64-v128:64:128-a:0:32-n32-S64" target triple = "thumbv7-unknown-linux-android26" define <2 x float> @g() { entry: %0 = call <2 x float> @llvm.tan.v2f

[clang] [Clang][AMDGPU] Add a builtin for llvm.amdgcn.make.buffer.rsrc intrinsic (PR #95276)

2024-06-12 Thread Yaxun Liu via cfe-commits
@@ -0,0 +1,95 @@ +// NOTE: Assertions have been autogenerated by utils/update_cc_test_checks.py +// REQUIRES: amdgpu-registered-target +// RUN: %clang_cc1 -triple amdgcn-unknown-unknown -cl-std=CL2.0 -target-cpu verde -emit-llvm -o - %s | FileCheck %s +// RUN: %clang_cc1 -triple

[clang] [clang-tools-extra] Revert "✨ [Sema, Lex, Parse] Preprocessor embed in C and C++ (and Obj-C and Obj-C++ by-proxy)" (PR #95299)

2024-06-12 Thread Vitaly Buka via cfe-commits
vitalybuka wrote: I guess I will proceed with revert, I don't know meaning that failed assert in the test, and expected ownership of EmbedAnnotationData is not clear to me. https://github.com/llvm/llvm-project/pull/95299 ___ cfe-commits mailing list c

[clang] [clang-tools-extra] Revert "✨ [Sema, Lex, Parse] Preprocessor embed in C and C++ (and Obj-C and Obj-C++ by-proxy)" (PR #95299)

2024-06-12 Thread Florian Mayer via cfe-commits
https://github.com/fmayer approved this pull request. https://github.com/llvm/llvm-project/pull/95299 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-tools-extra] Revert "✨ [Sema, Lex, Parse] Preprocessor embed in C and C++ (and Obj-C and Obj-C++ by-proxy)" (PR #95299)

2024-06-12 Thread Vitaly Buka via cfe-commits
https://github.com/vitalybuka closed https://github.com/llvm/llvm-project/pull/95299 ___ 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-12 Thread Dan McArdle via cfe-commits
dmcardle wrote: @AaronBallman, please take a look! What do you think of this approach? I suppose it might be even better to enforce that the function's return type is `bool`, which would align with the [ThreadSafetyAnalysis documentation](https://clang.llvm.org/docs/ThreadSafetyAnalysis.html#

[clang] [C++20] [Modules] [Itanium ABI] Generate the vtable in the module unit of dynamic classes (PR #75912)

2024-06-12 Thread Eli Friedman via cfe-commits
@@ -6853,6 +6853,13 @@ void CodeGenModule::EmitTopLevelDecl(Decl *D) { if (ES->hasExternalDefinitions(D) == ExternalASTSource::EK_Never) DI->completeUnusedClass(*CRD); } +// If we're emitting a dynamic class from the importable module we're +// emi

[clang] [C++20] [Modules] [Itanium ABI] Generate the vtable in the module unit of dynamic classes (PR #75912)

2024-06-12 Thread Eli Friedman via cfe-commits
@@ -318,6 +318,9 @@ namespace { if (Diags.hasUnrecoverableErrorOccurred()) return; + if (RD->shouldEmitInExternalSource()) efriedma-quic wrote: Maybe this check should be part of DefineUsedVTables()? https://github.com/llvm/llvm-project/pu

[clang] [llvm] Reapply "[llvm][IR] Extend BranchWeightMetadata to track provenance o… (PR #95281)

2024-06-12 Thread David Li via cfe-commits
@@ -241,9 +264,11 @@ void scaleProfData(Instruction &I, uint64_t S, uint64_t T) { if (ProfDataName->getString() == "branch_weights" && ProfileData->getNumOperands() > 0) { // Using APInt::div may be expensive, but most cases should fit 64 bits. -APInt Val(128,

[clang] [clang-format] Fix bad comment indentation before ifdef after braceless if (PR #94776)

2024-06-12 Thread Erich Reitz via cfe-commits
Erich-Reitz wrote: > This patch formats > > ``` > void f() { > if (foo) > bar(); // Comment > #if BAZ > baz(); > #endif > } > ``` > > to > > ``` > void f() { > if (foo) > bar(); > // Comment > #if BAZ > baz(); > #endif > } > ``` > > The trailing comment shouldn't be wr

[clang] [clang-format] Fix bad comment indentation before ifdef after braceless if (PR #94776)

2024-06-12 Thread Erich Reitz via cfe-commits
https://github.com/Erich-Reitz closed https://github.com/llvm/llvm-project/pull/94776 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] Reapply "[llvm][IR] Extend BranchWeightMetadata to track provenance o… (PR #95281)

2024-06-12 Thread Paul Kirth via cfe-commits
@@ -241,9 +264,11 @@ void scaleProfData(Instruction &I, uint64_t S, uint64_t T) { if (ProfDataName->getString() == "branch_weights" && ProfileData->getNumOperands() > 0) { // Using APInt::div may be expensive, but most cases should fit 64 bits. -APInt Val(128,

[clang] [flang] [mlir] [flang] Add basic -mtune support (PR #95043)

2024-06-12 Thread Alexis Perry-Holby via cfe-commits
https://github.com/AlexisPerry updated https://github.com/llvm/llvm-project/pull/95043 >From 2312d31b14aecc6eeea2e81d221ee004e5de3efc Mon Sep 17 00:00:00 2001 From: Alexis Perry-Holby Date: Thu, 6 Jun 2024 14:02:52 -0600 Subject: [PATCH 1/9] [flang] Add basic -mtune support --- clang/include/

[clang] [Clang] Remove preprocessor guards and global feature checks for NEON (PR #95224)

2024-06-12 Thread Maciej Gabka via cfe-commits
@@ -1,7 +1,8 @@ -// RUN: %clang_cc1 %s -triple armv7 -fsyntax-only -verify -// RUN: %clang_cc1 %s -triple aarch64 -fsyntax-only -verify -// RUN: %clang_cc1 %s -triple aarch64 -target-feature -fp-armv8 -target-abi aapcs-soft -fsyntax-only -verify +// RUN: %clang_cc1 %s -triple arm

[clang] [clang-repl] Lay the foundation of pretty printing for C. (PR #89811)

2024-06-12 Thread Arthur Eubanks via cfe-commits
aeubanks wrote: This was with `-DLLVM_ENABLE_LLD=ON`, so probably not? I'm guessing there's some CMake logic that doesn't fit with clang-repl's expectation of symbol availability, but that may be wrong. https://github.com/llvm/llvm-project/pull/89811 ___

[clang] [Clang][AMDGPU] Add a builtin for llvm.amdgcn.make.buffer.rsrc intrinsic (PR #95276)

2024-06-12 Thread Shilei Tian via cfe-commits
@@ -0,0 +1,95 @@ +// NOTE: Assertions have been autogenerated by utils/update_cc_test_checks.py +// REQUIRES: amdgpu-registered-target +// RUN: %clang_cc1 -triple amdgcn-unknown-unknown -cl-std=CL2.0 -target-cpu verde -emit-llvm -o - %s | FileCheck %s +// RUN: %clang_cc1 -triple

[clang] [Clang][AMDGPU] Add a builtin for llvm.amdgcn.make.buffer.rsrc intrinsic (PR #95276)

2024-06-12 Thread Shilei Tian via cfe-commits
shiltian wrote: > I am wondering whether prefix the builtin type with `__amdgcn_` would be > better since I envision risk of conflicting with reserved names of other > compilers or standard libraries. In the patch where the type was introduced we had a brief back-and-forth. I checked the refe

[clang] [compiler-rt] [llvm] [TypeProf][InstrFDO]Implement more efficient comparison sequence for indirect-call-promotion with vtable profiles. (PR #81442)

2024-06-12 Thread David Li via cfe-commits
@@ -1393,16 +1398,27 @@ MDNode *getPGOFuncNameMetadata(const Function &F) { return F.getMetadata(getPGOFuncNameMetadataName()); } -void createPGOFuncNameMetadata(Function &F, StringRef PGOFuncName) { - // Only for internal linkage functions. - if (PGOFuncName == F.getName(

[clang] [compiler-rt] [llvm] [TypeProf][InstrFDO]Implement more efficient comparison sequence for indirect-call-promotion with vtable profiles. (PR #81442)

2024-06-12 Thread David Li via cfe-commits
@@ -321,14 +790,114 @@ bool IndirectCallPromoter::processFunction(ProfileSummaryInfo *PSI) { if (!NumCandidates || (PSI && PSI->hasProfileSummary() && !PSI->isHotCount(TotalCount))) continue; + auto PromotionCandidates = getPromotionCandidatesForCallSite

[clang] [compiler-rt] [llvm] [TypeProf][InstrFDO]Implement more efficient comparison sequence for indirect-call-promotion with vtable profiles. (PR #81442)

2024-06-12 Thread David Li via cfe-commits
@@ -276,35 +626,154 @@ CallBase &llvm::pgo::promoteIndirectCall(CallBase &CB, Function *DirectCallee, // Promote indirect-call to conditional direct-call for one callsite. bool IndirectCallPromoter::tryToPromoteWithFuncCmp( -CallBase &CB, const std::vector &Candidates, -

[clang] [compiler-rt] [llvm] [TypeProf][InstrFDO]Implement more efficient comparison sequence for indirect-call-promotion with vtable profiles. (PR #81442)

2024-06-12 Thread David Li via cfe-commits
@@ -276,35 +626,154 @@ CallBase &llvm::pgo::promoteIndirectCall(CallBase &CB, Function *DirectCallee, // Promote indirect-call to conditional direct-call for one callsite. bool IndirectCallPromoter::tryToPromoteWithFuncCmp( -CallBase &CB, const std::vector &Candidates, -

[clang] [compiler-rt] [llvm] [TypeProf][InstrFDO]Implement more efficient comparison sequence for indirect-call-promotion with vtable profiles. (PR #81442)

2024-06-12 Thread David Li via cfe-commits
@@ -103,30 +110,220 @@ static cl::opt ICPDUMPAFTER("icp-dumpafter", cl::init(false), cl::Hidden, cl::desc("Dump IR after transformation happens")); +// This option is meant to be used by LLVM regression test and test the +// transformation that compares vt

[clang] [compiler-rt] [llvm] [TypeProf][InstrFDO]Implement more efficient comparison sequence for indirect-call-promotion with vtable profiles. (PR #81442)

2024-06-12 Thread David Li via cfe-commits
@@ -103,27 +114,226 @@ static cl::opt ICPDUMPAFTER("icp-dumpafter", cl::init(false), cl::Hidden, cl::desc("Dump IR after transformation happens")); +// Indirect call promotion pass will fall back to function-based comparison if +// vtable-count / function-

[clang] [compiler-rt] [llvm] [TypeProf][InstrFDO]Implement more efficient comparison sequence for indirect-call-promotion with vtable profiles. (PR #81442)

2024-06-12 Thread David Li via cfe-commits
@@ -321,14 +746,127 @@ bool IndirectCallPromoter::processFunction(ProfileSummaryInfo *PSI) { if (!NumCandidates || (PSI && PSI->hasProfileSummary() && !PSI->isHotCount(TotalCount))) continue; + auto PromotionCandidates = getPromotionCandidatesForCallSite

[clang] [clang-format] add an option to insert a space only for non-code block empty braces, not for empty parentheses (PR #93634)

2024-06-12 Thread Kohei Asano via cfe-commits
https://github.com/khei4 updated https://github.com/llvm/llvm-project/pull/93634 >From 447e0e46620281b2a6604ed7a79b473105f8ebe1 Mon Sep 17 00:00:00 2001 From: Kohei Asano Date: Mon, 3 Jun 2024 09:15:44 +0900 Subject: [PATCH] [clang-format] add an option to insert a space only for empty braces

<    1   2   3   4   5   >