[llvm-branch-commits] [clang] [serialization] No transitive type change (PR #92511)

2024-06-19 Thread Chuanqi Xu via llvm-branch-commits
@@ -12,44 +12,44 @@ // RUN: -fmodule-file=Module=%t/Module.pcm -emit-llvm -o - | FileCheck %t/Object.cppm // Test again with reduced BMI. -// RUN: rm -rf %t -// RUN: mkdir -p %t -// RUN: split-file %s %t +// RUNX: rm -rf %t ChuanqiXu9 wrote: Oh, sorry.

[llvm-branch-commits] [clang] [serialization] No transitive type change (PR #92511)

2024-06-19 Thread Chuanqi Xu via llvm-branch-commits
@@ -6659,13 +6655,22 @@ void ASTWriter::MacroRead(serialization::MacroID ID, MacroInfo *MI) { } void ASTWriter::TypeRead(TypeIdx Idx, QualType T) { - // Always take the highest-numbered type index. This copes with an interesting + // Always take the type index that comes

[llvm-branch-commits] [clang] [serialization] No transitive type change (PR #92511)

2024-06-19 Thread Chuanqi Xu via llvm-branch-commits
@@ -6659,13 +6655,22 @@ void ASTWriter::MacroRead(serialization::MacroID ID, MacroInfo *MI) { } void ASTWriter::TypeRead(TypeIdx Idx, QualType T) { - // Always take the highest-numbered type index. This copes with an interesting + // Always take the type index that comes

[llvm-branch-commits] [clang] [serialization] No transitive type change (PR #92511)

2024-06-19 Thread Chuanqi Xu via llvm-branch-commits
@@ -70,38 +71,53 @@ using DeclID = DeclIDBase::DeclID; /// An ID number that refers to a type in an AST file. /// -/// The ID of a type is partitioned into two parts: the lower +/// The ID of a type is partitioned into three parts: +/// - the lower /// three bits are used to

[llvm-branch-commits] [clang] [serialization] No transitive type change (PR #92511)

2024-06-19 Thread Chuanqi Xu via llvm-branch-commits
@@ -7100,14 +7084,25 @@ TypeSourceInfo *ASTRecordReader::readTypeSourceInfo() { return TInfo; } +std::pair +ASTReader::translateTypeIDToIndex(serialization::TypeID ID) const { + unsigned Index = + (ID & llvm::maskTrailingOnes(32)) >> Qualifiers::FastWidth; + +

[llvm-branch-commits] [clang] [serialization] No transitive type change (PR #92511)

2024-06-19 Thread Chuanqi Xu via llvm-branch-commits
ChuanqiXu9 wrote: > Thanks for the change! I have done a round of review and left a few > suggestion and also have a bunch of questions. I am sorry if some of them may > look too obvious, I did try to dig into the code where I could, but Clang's > serialization is complicated and some things

[llvm-branch-commits] [clang] [clang] Implement pointer authentication for C++ virtual functions, v-tables, and VTTs (PR #94056)

2024-06-19 Thread Anton Korobeynikov via llvm-branch-commits
https://github.com/asl approved this pull request. Thanks! https://github.com/llvm/llvm-project/pull/94056 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits

[llvm-branch-commits] [clang] [clang] Define ptrauth_sign_constant builtin. (PR #93904)

2024-06-19 Thread Daniil Kovalev via llvm-branch-commits
https://github.com/kovdan01 edited https://github.com/llvm/llvm-project/pull/93904 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits

[llvm-branch-commits] [clang] [clang] Define ptrauth_sign_constant builtin. (PR #93904)

2024-06-19 Thread Daniil Kovalev via llvm-branch-commits
https://github.com/kovdan01 approved this pull request. LGTM with a couple of documentation-related comments https://github.com/llvm/llvm-project/pull/93904 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org

[llvm-branch-commits] [clang] [clang] Define ptrauth_sign_constant builtin. (PR #93904)

2024-06-19 Thread Daniil Kovalev via llvm-branch-commits
@@ -354,6 +354,23 @@ Given that ``signedPointer`` matches the layout for signed pointers signed with the given key, extract the raw pointer from it. This operation does not trap and cannot fail, even if the pointer is not validly signed. +``ptrauth_sign_constant``

[llvm-branch-commits] [clang] [clang] Define ptrauth_sign_constant builtin. (PR #93904)

2024-06-19 Thread Daniil Kovalev via llvm-branch-commits
@@ -58,6 +58,35 @@ void test_string_discriminator(const char *str) { } +void test_sign_constant(int *dp, int (*fp)(int)) { + __builtin_ptrauth_sign_constant(, VALID_DATA_KEY); // expected-error {{too few arguments}} + __builtin_ptrauth_sign_constant(, VALID_DATA_KEY, , );

[llvm-branch-commits] [clang] [clang] Define ptrauth_sign_constant builtin. (PR #93904)

2024-06-19 Thread Daniil Kovalev via llvm-branch-commits
@@ -354,6 +354,23 @@ Given that ``signedPointer`` matches the layout for signed pointers signed with the given key, extract the raw pointer from it. This operation does not trap and cannot fail, even if the pointer is not validly signed. +``ptrauth_sign_constant``

[llvm-branch-commits] [libcxx] Add release note for #95264 (PR #96116)

2024-06-19 Thread via llvm-branch-commits
llvmbot wrote: @llvm/pr-subscribers-libcxx Author: Louis Dionne (ldionne) Changes --- Full diff: https://github.com/llvm/llvm-project/pull/96116.diff 1 Files Affected: - (modified) libcxx/docs/ReleaseNotes/18.rst (+9) ``diff diff --git a/libcxx/docs/ReleaseNotes/18.rst

[llvm-branch-commits] [libcxx] Add release note for #95264 (PR #96116)

2024-06-19 Thread Louis Dionne via llvm-branch-commits
https://github.com/ldionne milestoned https://github.com/llvm/llvm-project/pull/96116 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits

[llvm-branch-commits] [libcxx] Add release note for #95264 (PR #96116)

2024-06-19 Thread Louis Dionne via llvm-branch-commits
https://github.com/ldionne created https://github.com/llvm/llvm-project/pull/96116 None >From 4044e7c930381e5e070c7131c5b14a3dfd373259 Mon Sep 17 00:00:00 2001 From: Louis Dionne Date: Wed, 19 Jun 2024 16:50:07 -0400 Subject: [PATCH] [libc++] Add release note for #95264 ---

[llvm-branch-commits] [clang] [libcxx] [clang] Finish implementation of P0522 (PR #96023)

2024-06-19 Thread Louis Dionne via llvm-branch-commits
https://github.com/ldionne approved this pull request. libcxx/ nit LGTM. https://github.com/llvm/llvm-project/pull/96023 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org

[llvm-branch-commits] [clang] [libcxx] [clang] Finish implementation of P0522 (PR #96023)

2024-06-19 Thread Matheus Izvekov via llvm-branch-commits
https://github.com/mizvekov updated https://github.com/llvm/llvm-project/pull/96023 >From dd761ef307502c69dd6fdbf2fa56275f56e8cb6a Mon Sep 17 00:00:00 2001 From: Matheus Izvekov Date: Mon, 17 Jun 2024 21:39:08 -0300 Subject: [PATCH] [clang] Finish implementation of P0522 This finishes the

[llvm-branch-commits] [clang] [libcxx] [clang] Finish implementation of P0522 (PR #96023)

2024-06-19 Thread Matheus Izvekov via llvm-branch-commits
https://github.com/mizvekov updated https://github.com/llvm/llvm-project/pull/96023 >From 7c84cd61f2c1bf7ec30d77aaf6b1a87cccf96d2f Mon Sep 17 00:00:00 2001 From: Matheus Izvekov Date: Mon, 17 Jun 2024 21:39:08 -0300 Subject: [PATCH] [clang] Finish implementation of P0522 This finishes the

[llvm-branch-commits] [clang] [serialization] No transitive type change (PR #92511)

2024-06-19 Thread Ilya Biryukov via llvm-branch-commits
@@ -7392,27 +7388,28 @@ QualType ASTReader::GetType(TypeID ID) { return TypesLoaded[Index].withFastQualifiers(FastQuals); } -QualType ASTReader::getLocalType(ModuleFile , unsigned LocalID) { +QualType ASTReader::getLocalType(ModuleFile , TypeID LocalID) {

[llvm-branch-commits] [clang] [serialization] No transitive type change (PR #92511)

2024-06-19 Thread Ilya Biryukov via llvm-branch-commits
@@ -70,38 +71,53 @@ using DeclID = DeclIDBase::DeclID; /// An ID number that refers to a type in an AST file. /// -/// The ID of a type is partitioned into two parts: the lower +/// The ID of a type is partitioned into three parts: +/// - the lower /// three bits are used to

[llvm-branch-commits] [clang] [serialization] No transitive type change (PR #92511)

2024-06-19 Thread Ilya Biryukov via llvm-branch-commits
@@ -12,44 +12,44 @@ // RUN: -fmodule-file=Module=%t/Module.pcm -emit-llvm -o - | FileCheck %t/Object.cppm // Test again with reduced BMI. -// RUN: rm -rf %t -// RUN: mkdir -p %t -// RUN: split-file %s %t +// RUNX: rm -rf %t ilya-biryukov wrote: are

[llvm-branch-commits] [clang] [serialization] No transitive type change (PR #92511)

2024-06-19 Thread Ilya Biryukov via llvm-branch-commits
@@ -70,38 +71,53 @@ using DeclID = DeclIDBase::DeclID; /// An ID number that refers to a type in an AST file. /// -/// The ID of a type is partitioned into two parts: the lower +/// The ID of a type is partitioned into three parts: +/// - the lower /// three bits are used to

[llvm-branch-commits] [clang] [serialization] No transitive type change (PR #92511)

2024-06-19 Thread Ilya Biryukov via llvm-branch-commits
@@ -6659,13 +6655,22 @@ void ASTWriter::MacroRead(serialization::MacroID ID, MacroInfo *MI) { } void ASTWriter::TypeRead(TypeIdx Idx, QualType T) { - // Always take the highest-numbered type index. This copes with an interesting + // Always take the type index that comes

[llvm-branch-commits] [clang] [serialization] No transitive type change (PR #92511)

2024-06-19 Thread Ilya Biryukov via llvm-branch-commits
@@ -6659,13 +6655,22 @@ void ASTWriter::MacroRead(serialization::MacroID ID, MacroInfo *MI) { } void ASTWriter::TypeRead(TypeIdx Idx, QualType T) { - // Always take the highest-numbered type index. This copes with an interesting + // Always take the type index that comes

[llvm-branch-commits] [clang] [serialization] No transitive type change (PR #92511)

2024-06-19 Thread Ilya Biryukov via llvm-branch-commits
@@ -6659,13 +6655,22 @@ void ASTWriter::MacroRead(serialization::MacroID ID, MacroInfo *MI) { } void ASTWriter::TypeRead(TypeIdx Idx, QualType T) { - // Always take the highest-numbered type index. This copes with an interesting + // Always take the type index that comes

[llvm-branch-commits] [clang] [serialization] No transitive type change (PR #92511)

2024-06-19 Thread Ilya Biryukov via llvm-branch-commits
@@ -3262,17 +3262,18 @@ void ASTWriter::WritePragmaDiagnosticMappings(const DiagnosticsEngine , /// Write the representation of a type to the AST stream. void ASTWriter::WriteType(QualType T) { TypeIdx = TypeIdxs[T]; - if (IdxRef.getIndex() == 0) // we haven't seen this

[llvm-branch-commits] [clang] [serialization] No transitive type change (PR #92511)

2024-06-19 Thread Ilya Biryukov via llvm-branch-commits
@@ -7650,6 +7647,16 @@ ModuleFile *ASTReader::getOwningModuleFile(GlobalDeclID ID) const { return ()[ModuleFileIndex - 1]; } +ModuleFile *ASTReader::getOwningModuleFile(TypeID ID) const { + if (ID < NUM_PREDEF_TYPE_IDS) +return nullptr; + + uint64_t ModuleFileIndex =

[llvm-branch-commits] [clang] [serialization] No transitive type change (PR #92511)

2024-06-19 Thread Ilya Biryukov via llvm-branch-commits
@@ -70,38 +71,53 @@ using DeclID = DeclIDBase::DeclID; /// An ID number that refers to a type in an AST file. /// -/// The ID of a type is partitioned into two parts: the lower +/// The ID of a type is partitioned into three parts: +/// - the lower /// three bits are used to

[llvm-branch-commits] [clang] [serialization] No transitive type change (PR #92511)

2024-06-19 Thread Ilya Biryukov via llvm-branch-commits
@@ -7100,14 +7084,25 @@ TypeSourceInfo *ASTRecordReader::readTypeSourceInfo() { return TInfo; } +std::pair +ASTReader::translateTypeIDToIndex(serialization::TypeID ID) const { + unsigned Index = + (ID & llvm::maskTrailingOnes(32)) >> Qualifiers::FastWidth; + +

[llvm-branch-commits] [clang] [serialization] No transitive type change (PR #92511)

2024-06-19 Thread Ilya Biryukov via llvm-branch-commits
https://github.com/ilya-biryukov commented: Thanks for the change! I have done a round of review and left a few suggestion and also have a bunch of questions. I am sorry if some of them may look too obvious, I did try to dig into the code where I could, but Clang's serialization is

[llvm-branch-commits] [clang] [serialization] No transitive type change (PR #92511)

2024-06-19 Thread Ilya Biryukov via llvm-branch-commits
https://github.com/ilya-biryukov edited https://github.com/llvm/llvm-project/pull/92511 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits

[llvm-branch-commits] [clang] [clang] Finish implementation of P0522 (PR #96023)

2024-06-19 Thread Matheus Izvekov via llvm-branch-commits
@@ -6369,27 +6451,88 @@ bool Sema::isTemplateTemplateParameterAtLeastAsSpecializedAs( // be inverted between Ps and As. On non-deduced context, matching needs to // happen both ways, according to [temp.arg.template]p3, but this is // currently implemented as a

[llvm-branch-commits] [clang] [clang] Finish implementation of P0522 (PR #96023)

2024-06-19 Thread Matheus Izvekov via llvm-branch-commits
@@ -6369,27 +6451,88 @@ bool Sema::isTemplateTemplateParameterAtLeastAsSpecializedAs( // be inverted between Ps and As. On non-deduced context, matching needs to // happen both ways, according to [temp.arg.template]p3, but this is // currently implemented as a

[llvm-branch-commits] [clang] [clang] Finish implementation of P0522 (PR #96023)

2024-06-19 Thread Matheus Izvekov via llvm-branch-commits
@@ -6369,27 +6451,88 @@ bool Sema::isTemplateTemplateParameterAtLeastAsSpecializedAs( // be inverted between Ps and As. On non-deduced context, matching needs to // happen both ways, according to [temp.arg.template]p3, but this is // currently implemented as a

[llvm-branch-commits] [clang] [clang] Finish implementation of P0522 (PR #96023)

2024-06-19 Thread Matheus Izvekov via llvm-branch-commits
@@ -3284,16 +3345,20 @@ DeduceTemplateArguments(Sema , T *Partial, if (Inst.isInvalid()) return TemplateDeductionResult::InstantiationDepth; - if (Trap.hasErrorOccurred()) -return TemplateDeductionResult::SubstitutionFailure; - TemplateDeductionResult Result;

[llvm-branch-commits] [clang] [clang] Finish implementation of P0522 (PR #96023)

2024-06-19 Thread Matheus Izvekov via llvm-branch-commits
@@ -2513,49 +2545,76 @@ DeduceTemplateArguments(Sema , TemplateParameterList *TemplateParams, TemplateDeductionInfo , SmallVectorImpl , bool NumberOfArgumentsMustMatch, PackFold PackFold) { - if

[llvm-branch-commits] [clang] [clang] Finish implementation of P0522 (PR #96023)

2024-06-19 Thread Matheus Izvekov via llvm-branch-commits
@@ -2513,49 +2545,76 @@ DeduceTemplateArguments(Sema , TemplateParameterList *TemplateParams, TemplateDeductionInfo , SmallVectorImpl , bool NumberOfArgumentsMustMatch, PackFold PackFold) { - if

[llvm-branch-commits] [SPARC][IAS] Enable `ParseForAllFeatures` in `MatchOperandParserImpl` (PR #96021)

2024-06-19 Thread Sergei Barannikov via llvm-branch-commits
@@ -11,7 +11,7 @@ ! V9: unknown membar tag membar #BadTag -! V8: instruction requires a CPU feature not currently enabled +! V8: unexpected token ! V9: invalid membar mask number membar -127 s-barannikov

[llvm-branch-commits] [SPARC][IAS] Rework ASI tag matching in prep for `ParseForAllFeatures` (PR #96020)

2024-06-19 Thread Sergei Barannikov via llvm-branch-commits
@@ -1085,13 +1085,24 @@ ParseStatus SparcAsmParser::parseASITag(OperandVector ) { SMLoc E = Parser.getTok().getEndLoc(); int64_t ASIVal = 0; - if (is64Bit() && (getLexer().getKind() == AsmToken::Hash)) { + switch (getLexer().getKind()) { + case AsmToken::LParen: +

[llvm-branch-commits] [llvm] AMDGPU: Handle legal v2bf16 atomicrmw fadd for gfx12 (PR #95930)

2024-06-19 Thread Jay Foad via llvm-branch-commits
@@ -1735,8 +1737,11 @@ defm : SIBufferAtomicPat<"SIbuffer_atomic_dec", i64, "BUFFER_ATOMIC_DEC_X2">; let OtherPredicates = [HasAtomicCSubNoRtnInsts] in defm : SIBufferAtomicPat<"SIbuffer_atomic_csub", i32, "BUFFER_ATOMIC_CSUB", ["noret"]>; -let SubtargetPredicate =

[llvm-branch-commits] [SPARC][IAS] Enable `ParseForAllFeatures` in `MatchOperandParserImpl` (PR #96021)

2024-06-19 Thread Sergei Barannikov via llvm-branch-commits
https://github.com/s-barannikov edited https://github.com/llvm/llvm-project/pull/96021 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits

[llvm-branch-commits] [SPARC][IAS] Enable `ParseForAllFeatures` in `MatchOperandParserImpl` (PR #96021)

2024-06-19 Thread Sergei Barannikov via llvm-branch-commits
https://github.com/s-barannikov edited https://github.com/llvm/llvm-project/pull/96021 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits

[llvm-branch-commits] [SPARC][IAS] Enable `ParseForAllFeatures` in `MatchOperandParserImpl` (PR #96021)

2024-06-19 Thread Sergei Barannikov via llvm-branch-commits
https://github.com/s-barannikov edited https://github.com/llvm/llvm-project/pull/96021 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits

[llvm-branch-commits] [SPARC][IAS] Enable `ParseForAllFeatures` in `MatchOperandParserImpl` (PR #96021)

2024-06-19 Thread Sergei Barannikov via llvm-branch-commits
@@ -11,7 +11,7 @@ ! V9: unknown membar tag membar #BadTag -! V8: instruction requires a CPU feature not currently enabled +! V8: unexpected token ! V9: invalid membar mask number membar -127 s-barannikov

[llvm-branch-commits] [clang] [clang] Finish implementation of P0522 (PR #96023)

2024-06-19 Thread Vlad Serebrennikov via llvm-branch-commits
https://github.com/Endilll commented: `Sema.h` changes look good. https://github.com/llvm/llvm-project/pull/96023 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org

[llvm-branch-commits] [clang] [clang] Finish implementation of P0522 (PR #96023)

2024-06-19 Thread via llvm-branch-commits
@@ -8513,64 +8513,46 @@ bool Sema::CheckTemplateTemplateArgument(TemplateTemplateParmDecl *Param, << Template; } + if (!getLangOpts().RelaxedTemplateTemplateArgs) +return !TemplateParameterListsAreEqual( +Template->getTemplateParameters(), Params,

[llvm-branch-commits] [clang] [clang] Finish implementation of P0522 (PR #96023)

2024-06-19 Thread via llvm-branch-commits
@@ -3284,16 +3345,20 @@ DeduceTemplateArguments(Sema , T *Partial, if (Inst.isInvalid()) return TemplateDeductionResult::InstantiationDepth; - if (Trap.hasErrorOccurred()) -return TemplateDeductionResult::SubstitutionFailure; - TemplateDeductionResult Result;

[llvm-branch-commits] [clang] [clang] Finish implementation of P0522 (PR #96023)

2024-06-19 Thread via llvm-branch-commits
@@ -6038,14 +6107,23 @@ static bool isAtLeastAsSpecializedAs(Sema , QualType T1, QualType T2, return false; const auto *TST1 = cast(T1); - bool AtLeastAsSpecialized; + + Sema::SFINAETrap Trap(S); + + TemplateDeductionResult Result;

[llvm-branch-commits] [clang] [clang] Finish implementation of P0522 (PR #96023)

2024-06-19 Thread via llvm-branch-commits
@@ -6369,27 +6451,88 @@ bool Sema::isTemplateTemplateParameterAtLeastAsSpecializedAs( // be inverted between Ps and As. On non-deduced context, matching needs to // happen both ways, according to [temp.arg.template]p3, but this is // currently implemented as a

[llvm-branch-commits] [clang] [clang] Finish implementation of P0522 (PR #96023)

2024-06-19 Thread via llvm-branch-commits
@@ -2513,49 +2545,76 @@ DeduceTemplateArguments(Sema , TemplateParameterList *TemplateParams, TemplateDeductionInfo , SmallVectorImpl , bool NumberOfArgumentsMustMatch, PackFold PackFold) { - if

[llvm-branch-commits] [clang] [clang] Finish implementation of P0522 (PR #96023)

2024-06-19 Thread via llvm-branch-commits
@@ -3351,14 +3416,18 @@ Sema::DeduceTemplateArgumentsFromType(TemplateDecl *TD, QualType FromType, if (Inst.isInvalid()) return TemplateDeductionResult::InstantiationDepth; - if (Trap.hasErrorOccurred()) -return TemplateDeductionResult::SubstitutionFailure; -

[llvm-branch-commits] [clang] [clang] Finish implementation of P0522 (PR #96023)

2024-06-19 Thread via llvm-branch-commits
@@ -6369,27 +6451,88 @@ bool Sema::isTemplateTemplateParameterAtLeastAsSpecializedAs( // be inverted between Ps and As. On non-deduced context, matching needs to // happen both ways, according to [temp.arg.template]p3, but this is // currently implemented as a

[llvm-branch-commits] [clang] [clang] Finish implementation of P0522 (PR #96023)

2024-06-19 Thread via llvm-branch-commits
@@ -3186,20 +3239,36 @@ static TemplateDeductionResult FinishTemplateArgumentDeduction( // Check that we produced the correct argument list. TemplateParameterList *TemplateParams = Template->getTemplateParameters(); + auto notSame = [&](unsigned I, const

[llvm-branch-commits] [clang] [clang] Finish implementation of P0522 (PR #96023)

2024-06-19 Thread via llvm-branch-commits
@@ -2513,49 +2545,76 @@ DeduceTemplateArguments(Sema , TemplateParameterList *TemplateParams, TemplateDeductionInfo , SmallVectorImpl , bool NumberOfArgumentsMustMatch, PackFold PackFold) { - if

[llvm-branch-commits] [clang] [clang] Finish implementation of P0522 (PR #96023)

2024-06-19 Thread via llvm-branch-commits
@@ -139,7 +139,7 @@ static TemplateDeductionResult DeduceTemplateArgumentsByTypeMatch( SmallVectorImpl , unsigned TDF, bool PartialOrdering = false, bool DeducedFromArrayBound = false); -enum class PackFold { ParameterToArgument, ArgumentToParameter }; +enum class

[llvm-branch-commits] [clang] [clang] Finish implementation of P0522 (PR #96023)

2024-06-19 Thread via llvm-branch-commits
@@ -2513,49 +2545,76 @@ DeduceTemplateArguments(Sema , TemplateParameterList *TemplateParams, TemplateDeductionInfo , SmallVectorImpl , bool NumberOfArgumentsMustMatch, PackFold PackFold) { - if

[llvm-branch-commits] [clang] [clang] Finish implementation of P0522 (PR #96023)

2024-06-19 Thread via llvm-branch-commits
@@ -9934,6 +9935,9 @@ class Sema final : public SemaBase { /// We are instantiating a type alias template declaration. TypeAliasTemplateInstantiation, + + /// We are performing partial ordering for template template parameters. + PartialOrderTTP,

[llvm-branch-commits] [clang] [clang] Finish implementation of P0522 (PR #96023)

2024-06-19 Thread via llvm-branch-commits
https://github.com/cor3ntin commented: Thanks Matheus. I left a few nitpicky comments. The design looks good to me I think but it's not a trivial change so Ill want to review it more and have other people look at it too. https://github.com/llvm/llvm-project/pull/96023

[llvm-branch-commits] [clang] [clang] Finish implementation of P0522 (PR #96023)

2024-06-19 Thread via llvm-branch-commits
https://github.com/cor3ntin edited https://github.com/llvm/llvm-project/pull/96023 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits

[llvm-branch-commits] [clang] [llvm] [clang] Implement function pointer signing and authenticated function calls (PR #93906)

2024-06-19 Thread Daniil Kovalev via llvm-branch-commits
@@ -0,0 +1,5 @@ +// RUN: %clang_cc1 -triple arm64e-apple-ios -fptrauth-calls %s -verify -emit-llvm -o - + +void f(void); + +int *pf = (int *) + 1; // expected-error{{cannot compile this static initializer yet}} kovdan01 wrote: > I'll see if I can improve the

[llvm-branch-commits] [clang] [clang] Finish implementation of P0522 (PR #96023)

2024-06-18 Thread Matheus Izvekov via llvm-branch-commits
https://github.com/mizvekov updated https://github.com/llvm/llvm-project/pull/96023 >From 03d5720d113ff3ce03694b27d376230d06d7693e Mon Sep 17 00:00:00 2001 From: Matheus Izvekov Date: Mon, 17 Jun 2024 21:39:08 -0300 Subject: [PATCH] [clang] Finish implementation of P0522 This finishes the

[llvm-branch-commits] [clang] [clang] Finish implementation of P0522 (PR #96023)

2024-06-18 Thread via llvm-branch-commits
llvmbot wrote: @llvm/pr-subscribers-clang-modules @llvm/pr-subscribers-clang Author: Matheus Izvekov (mizvekov) Changes This finishes the clang implementation of P0522, getting rid of the fallback to the old, pre-P0522 rules. Before this patch, when partial ordering template template

[llvm-branch-commits] [clang] [clang] Finish implementation of P0522 (PR #96023)

2024-06-18 Thread Matheus Izvekov via llvm-branch-commits
https://github.com/mizvekov created https://github.com/llvm/llvm-project/pull/96023 This finishes the clang implementation of P0522, getting rid of the fallback to the old, pre-P0522 rules. Before this patch, when partial ordering template template parameters, we would perform, in order: *

[llvm-branch-commits] [clang] [llvm] [clang] Implement function pointer signing and authenticated function calls (PR #93906)

2024-06-18 Thread Akira Hatanaka via llvm-branch-commits
@@ -0,0 +1,10 @@ +// RUN: %clang_cc1 -triple arm64-apple-ios -fptrauth-calls -fptrauth-intrinsics -emit-llvm %s -o - | FileCheck %s ahatanak wrote: We can probably consolidate some of the tests. I'll look into it later.

[llvm-branch-commits] [clang] [llvm] [clang] Implement function pointer signing and authenticated function calls (PR #93906)

2024-06-18 Thread Akira Hatanaka via llvm-branch-commits
@@ -0,0 +1,31 @@ +// RUN: %clang_cc1 %s -triple arm64e-apple-ios13 -fptrauth-calls -fptrauth-intrinsics -disable-llvm-passes -emit-llvm -o- | FileCheck %s +// RUN: %clang_cc1 -xc++ %s -triple arm64e-apple-ios13 -fptrauth-calls -fptrauth-intrinsics -disable-llvm-passes

[llvm-branch-commits] [clang] [llvm] [clang] Implement function pointer signing and authenticated function calls (PR #93906)

2024-06-18 Thread Akira Hatanaka via llvm-branch-commits
@@ -0,0 +1,5 @@ +// RUN: %clang_cc1 -triple arm64e-apple-ios -fptrauth-calls %s -verify -emit-llvm -o - + +void f(void); + +int *pf = (int *) + 1; // expected-error{{cannot compile this static initializer yet}} ahatanak wrote: As commented in the test case,

[llvm-branch-commits] [clang] [llvm] [clang] Implement function pointer signing and authenticated function calls (PR #93906)

2024-06-18 Thread Akira Hatanaka via llvm-branch-commits
@@ -0,0 +1,13 @@ +// RUN: %clang_cc1 -triple arm64-apple-ios-emit-llvm %s -o - | FileCheck %s --check-prefixes=ALL,OFF ahatanak wrote: I've added RUN lines for `aarch64-linux-gnu`. https://github.com/llvm/llvm-project/pull/93906

[llvm-branch-commits] [clang] [llvm] [clang] Implement function pointer signing and authenticated function calls (PR #93906)

2024-06-18 Thread Akira Hatanaka via llvm-branch-commits
@@ -0,0 +1,9 @@ +// RUN: %clang -target arm64-apple-macosx -fptrauth-calls -c %s -### 2>&1 | FileCheck %s --check-prefix PTRAUTH_CALLS ahatanak wrote: I removed the file. https://github.com/llvm/llvm-project/pull/93906

[llvm-branch-commits] [clang] [llvm] [clang] Implement function pointer signing and authenticated function calls (PR #93906)

2024-06-18 Thread Akira Hatanaka via llvm-branch-commits
@@ -61,3 +79,28 @@ CodeGen::getConstantSignedPointer(CodeGenModule , llvm::Constant *Pointer, return CGM.getConstantSignedPointer(Pointer, Key, StorageAddress, OtherDiscriminator); } + +/// If applicable, sign a given constant function

[llvm-branch-commits] [clang] [llvm] [clang] Implement function pointer signing and authenticated function calls (PR #93906)

2024-06-18 Thread Akira Hatanaka via llvm-branch-commits
@@ -61,3 +79,28 @@ CodeGen::getConstantSignedPointer(CodeGenModule , llvm::Constant *Pointer, return CGM.getConstantSignedPointer(Pointer, Key, StorageAddress, OtherDiscriminator); } + +/// If applicable, sign a given constant function

[llvm-branch-commits] [clang] [llvm] [clang] Implement function pointer signing and authenticated function calls (PR #93906)

2024-06-18 Thread Akira Hatanaka via llvm-branch-commits
@@ -128,12 +136,12 @@ class CGCallee { static CGCallee forDirect(llvm::Constant *functionPtr, const CGCalleeInfo = CGCalleeInfo()) { -return CGCallee(abstractInfo, functionPtr); +return CGCallee(abstractInfo, functionPtr,

[llvm-branch-commits] [clang] [llvm] [clang] Implement function pointer signing and authenticated function calls (PR #93906)

2024-06-18 Thread Akira Hatanaka via llvm-branch-commits
@@ -104,10 +109,13 @@ class CGCallee { /// Construct a callee. Call this constructor directly when this /// isn't a direct call. - CGCallee(const CGCalleeInfo , llvm::Value *functionPtr) + CGCallee( + const CGCalleeInfo , llvm::Value *functionPtr, + const

[llvm-branch-commits] [clang] [llvm] [clang] Implement function pointer signing and authenticated function calls (PR #93906)

2024-06-18 Thread Akira Hatanaka via llvm-branch-commits
@@ -351,6 +351,9 @@ def err_drv_omp_host_ir_file_not_found : Error< "target regions but cannot be found">; def err_drv_omp_host_target_not_supported : Error< "target '%0' is not a supported OpenMP host target">; +def err_drv_ptrauth_not_supported : Error< + "target '%0'

[llvm-branch-commits] [SPARC][IAS] Enable `ParseForAllFeatures` in `MatchOperandParserImpl` (PR #96021)

2024-06-18 Thread via llvm-branch-commits
@@ -657,22 +657,22 @@ ! V9: prefetcha [%i1+3968] %asi, #one_read! encoding: [0xc3,0xee,0x6f,0x80] prefetcha [ %i1 + 0xf80 ] %asi, #one_read koachan wrote: This is also suffering from the same issue as the membars, IAS doesn't seem to

[llvm-branch-commits] [SPARC][IAS] Enable `ParseForAllFeatures` in `MatchOperandParserImpl` (PR #96021)

2024-06-18 Thread via llvm-branch-commits
@@ -11,7 +11,7 @@ ! V9: unknown membar tag membar #BadTag -! V8: instruction requires a CPU feature not currently enabled +! V8: unexpected token ! V9: invalid membar mask number membar -127 koachan wrote:

[llvm-branch-commits] [SPARC][IAS] Enable `ParseForAllFeatures` in `MatchOperandParserImpl` (PR #96021)

2024-06-18 Thread via llvm-branch-commits
llvmbot wrote: @llvm/pr-subscribers-mc Author: Koakuma (koachan) Changes This enables `ParseForAllFeatures` to report the correct error message when trying to assemble instructions not available in V8 mode. --- Full diff: https://github.com/llvm/llvm-project/pull/96021.diff 3 Files

[llvm-branch-commits] [SPARC][IAS] Rework ASI tag matching in prep for `ParseForAllFeatures` (PR #96020)

2024-06-18 Thread via llvm-branch-commits
llvmbot wrote: @llvm/pr-subscribers-backend-sparc Author: Koakuma (koachan) Changes This changes the ASI tag matching at `parseASITag` to use a similar implementation to `parsePrefetchTag`. This introduces a slight regression to error messages, but is needed so we can enable

[llvm-branch-commits] [SPARC][IAS] Enable `ParseForAllFeatures` in `MatchOperandParserImpl` (PR #96021)

2024-06-18 Thread via llvm-branch-commits
https://github.com/koachan created https://github.com/llvm/llvm-project/pull/96021 This enables `ParseForAllFeatures` to report the correct error message when trying to assemble instructions not available in V8 mode. ___ llvm-branch-commits mailing

[llvm-branch-commits] [SPARC][IAS] Rework ASI tag matching in prep for `ParseForAllFeatures` (PR #96020)

2024-06-18 Thread via llvm-branch-commits
https://github.com/koachan created https://github.com/llvm/llvm-project/pull/96020 This changes the ASI tag matching at `parseASITag` to use a similar implementation to `parsePrefetchTag`. This introduces a slight regression to error messages, but is needed so we can enable

[llvm-branch-commits] [llvm] [BOLT] Hash-based function matching (PR #95821)

2024-06-18 Thread Amir Ayupov via llvm-branch-commits
https://github.com/aaupov commented: Looks very good, but please address some minor issues. https://github.com/llvm/llvm-project/pull/95821 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org

[llvm-branch-commits] [llvm] [BOLT] Hash-based function matching (PR #95821)

2024-06-18 Thread Amir Ayupov via llvm-branch-commits
@@ -383,6 +381,30 @@ Error YAMLProfileReader::readProfile(BinaryContext ) { matchProfileToFunction(YamlBF, Function); } + // Uses the strict hash of profiled and binary functions to match functions + // that are not matched by name or common name. +

[llvm-branch-commits] [llvm] [BOLT] Hash-based function matching (PR #95821)

2024-06-18 Thread Amir Ayupov via llvm-branch-commits
https://github.com/aaupov edited https://github.com/llvm/llvm-project/pull/95821 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits

[llvm-branch-commits] [llvm] [BOLT] Hash-based function matching (PR #95821)

2024-06-18 Thread Amir Ayupov via llvm-branch-commits
@@ -383,6 +381,30 @@ Error YAMLProfileReader::readProfile(BinaryContext ) { matchProfileToFunction(YamlBF, Function); } + // Uses the strict hash of profiled and binary functions to match functions + // that are not matched by name or common name. +

[llvm-branch-commits] [llvm] [BOLT] Hash-based function matching (PR #95821)

2024-06-18 Thread Amir Ayupov via llvm-branch-commits
@@ -383,6 +381,30 @@ Error YAMLProfileReader::readProfile(BinaryContext ) { matchProfileToFunction(YamlBF, Function); } + // Uses the strict hash of profiled and binary functions to match functions aaupov wrote: Let's put this under `if

[llvm-branch-commits] [llvm] [BOLT] Hash-based function matching (PR #95821)

2024-06-18 Thread Amir Ayupov via llvm-branch-commits
@@ -420,6 +442,7 @@ Error YAMLProfileReader::readProfile(BinaryContext ) { errs() << "BOLT-WARNING: profile ignored for function " << YamlBF.Name << '\n'; + aaupov wrote: nit: please drop https://github.com/llvm/llvm-project/pull/95821

[llvm-branch-commits] [llvm] [BOLT] Hash-based function matching (PR #95821)

2024-06-18 Thread Amir Ayupov via llvm-branch-commits
@@ -0,0 +1,67 @@ +## Test YAMLProfileReader support for pass-through blocks in non-matching edges: +## match the profile edge A -> C to the CFG with blocks A -> B -> C. + +# REQUIRES: system-linux +# RUN: split-file %s %t +# RUN: llvm-mc -filetype=obj -triple

[llvm-branch-commits] [clang] [clang] Define ptrauth_sign_constant builtin. (PR #93904)

2024-06-18 Thread Ahmed Bougacha via llvm-branch-commits
@@ -2126,14 +2219,16 @@ static ExprResult PointerAuthSignGenericData(Sema , CallExpr *Call) { } static ExprResult PointerAuthSignOrAuth(Sema , CallExpr *Call, -PointerAuthOpKind OpKind) { +

[llvm-branch-commits] [clang] [clang] Define ptrauth_sign_constant builtin. (PR #93904)

2024-06-18 Thread Ahmed Bougacha via llvm-branch-commits
@@ -1856,6 +1856,12 @@ class ConstantLValueEmitter : public ConstStmtVisitor ahmedbougacha wrote: The more interesting question is the usage of Constant; I think we can safely assume the integer component is always going to be a ConstantInt (because it's

[llvm-branch-commits] [clang] [clang] Define ptrauth_sign_constant builtin. (PR #93904)

2024-06-18 Thread Ahmed Bougacha via llvm-branch-commits
@@ -938,6 +938,11 @@ class CodeGenModule : public CodeGenTypeCache { // Return the function body address of the given function. llvm::Constant *GetFunctionStart(const ValueDecl *Decl); + llvm::Constant *getConstantSignedPointer(llvm::Constant *Pointer, +

[llvm-branch-commits] [clang] [clang] Define ptrauth_sign_constant builtin. (PR #93904)

2024-06-18 Thread Ahmed Bougacha via llvm-branch-commits
@@ -2030,8 +2030,25 @@ bool Sema::checkConstantPointerAuthKey(Expr *Arg, unsigned ) { return false; } +static std::pair +findConstantBaseAndOffset(Sema , Expr *E) { + // Must evaluate as a pointer. + Expr::EvalResult Result; + if (!E->EvaluateAsRValue(Result, S.Context)

[llvm-branch-commits] [clang] [clang] Define ptrauth_sign_constant builtin. (PR #93904)

2024-06-18 Thread Ahmed Bougacha via llvm-branch-commits
@@ -2074,16 +2091,91 @@ static bool checkPointerAuthValue(Sema , Expr *, if (convertArgumentToType(S, Arg, ExpectedTy)) return true; - // Warn about null pointers for non-generic sign and auth operations. - if ((OpKind == PAO_Sign || OpKind == PAO_Auth) && -

[llvm-branch-commits] [clang] [clang] Define ptrauth_sign_constant builtin. (PR #93904)

2024-06-18 Thread Ahmed Bougacha via llvm-branch-commits
@@ -2074,16 +2091,91 @@ static bool checkPointerAuthValue(Sema , Expr *, if (convertArgumentToType(S, Arg, ExpectedTy)) return true; - // Warn about null pointers for non-generic sign and auth operations. - if ((OpKind == PAO_Sign || OpKind == PAO_Auth) && -

[llvm-branch-commits] [clang] [clang] Define ptrauth_sign_constant builtin. (PR #93904)

2024-06-18 Thread Ahmed Bougacha via llvm-branch-commits
@@ -0,0 +1,21 @@ +// RUN: %clang_cc1 -triple arm64-apple-ios -fptrauth-intrinsics -emit-llvm %s -o - | FileCheck %s +// RUN: %clang_cc1 -triple aarch64-elf -fptrauth-intrinsics -emit-llvm %s -o - | FileCheck %s + +extern int external; + +// CHECK: @ptr1 = global ptr

[llvm-branch-commits] [clang] [clang] Define ptrauth_sign_constant builtin. (PR #93904)

2024-06-18 Thread Ahmed Bougacha via llvm-branch-commits
https://github.com/ahmedbougacha updated https://github.com/llvm/llvm-project/pull/93904 >From 20bbad26fa9f068910baf50b5abb60a0f4557564 Mon Sep 17 00:00:00 2001 From: Ahmed Bougacha Date: Thu, 30 May 2024 17:33:04 -0700 Subject: [PATCH 1/5] [clang] Define ptrauth_sign_constant builtin. This

[llvm-branch-commits] [clang] [clang] Define ptrauth_sign_constant builtin. (PR #93904)

2024-06-18 Thread Ahmed Bougacha via llvm-branch-commits
https://github.com/ahmedbougacha updated https://github.com/llvm/llvm-project/pull/93904 >From 20bbad26fa9f068910baf50b5abb60a0f4557564 Mon Sep 17 00:00:00 2001 From: Ahmed Bougacha Date: Thu, 30 May 2024 17:33:04 -0700 Subject: [PATCH 1/4] [clang] Define ptrauth_sign_constant builtin. This

[llvm-branch-commits] [flang] 13a0c13 - Revert "[flang] Add FLANG_PARALLEL_COMPILE_JOBS option (#95672)"

2024-06-18 Thread via llvm-branch-commits
Author: Tom Stellard Date: 2024-06-18T14:58:02-07:00 New Revision: 13a0c13519b356c004127cf23c79b57cd33fc969 URL: https://github.com/llvm/llvm-project/commit/13a0c13519b356c004127cf23c79b57cd33fc969 DIFF: https://github.com/llvm/llvm-project/commit/13a0c13519b356c004127cf23c79b57cd33fc969.diff

[llvm-branch-commits] [llvm] [BOLT] Hash-based function matching (PR #95821)

2024-06-18 Thread shaw young via llvm-branch-commits
https://github.com/shawbyoung updated https://github.com/llvm/llvm-project/pull/95821 >From 92212c96ea169d26ac10bf8d750539bc5dd72c49 Mon Sep 17 00:00:00 2001 From: shawbyoung Date: Mon, 17 Jun 2024 15:39:02 -0700 Subject: [PATCH 1/6] spr amend Created using spr 1.3.4 ---

[llvm-branch-commits] [llvm] AMDGPU: Handle legal v2bf16 atomicrmw fadd for gfx12 (PR #95930)

2024-06-18 Thread Matt Arsenault via llvm-branch-commits
@@ -1735,8 +1737,11 @@ defm : SIBufferAtomicPat<"SIbuffer_atomic_dec", i64, "BUFFER_ATOMIC_DEC_X2">; let OtherPredicates = [HasAtomicCSubNoRtnInsts] in defm : SIBufferAtomicPat<"SIbuffer_atomic_csub", i32, "BUFFER_ATOMIC_CSUB", ["noret"]>; -let SubtargetPredicate =

[llvm-branch-commits] [llvm] AMDGPU: Handle legal v2bf16 atomicrmw fadd for gfx12 (PR #95930)

2024-06-18 Thread Matt Arsenault via llvm-branch-commits
@@ -1735,8 +1737,11 @@ defm : SIBufferAtomicPat<"SIbuffer_atomic_dec", i64, "BUFFER_ATOMIC_DEC_X2">; let OtherPredicates = [HasAtomicCSubNoRtnInsts] in defm : SIBufferAtomicPat<"SIbuffer_atomic_csub", i32, "BUFFER_ATOMIC_CSUB", ["noret"]>; -let SubtargetPredicate =

[llvm-branch-commits] [llvm] AMDGPU: Handle legal v2bf16 atomicrmw fadd for gfx12 (PR #95930)

2024-06-18 Thread Stanislav Mekhanoshin via llvm-branch-commits
@@ -1735,8 +1737,11 @@ defm : SIBufferAtomicPat<"SIbuffer_atomic_dec", i64, "BUFFER_ATOMIC_DEC_X2">; let OtherPredicates = [HasAtomicCSubNoRtnInsts] in defm : SIBufferAtomicPat<"SIbuffer_atomic_csub", i32, "BUFFER_ATOMIC_CSUB", ["noret"]>; -let SubtargetPredicate =

<    1   2   3   4   5   6   7   8   9   10   >