[llvm-branch-commits] [llvm] [CodeGen][StaticDataSplitter]Support constant pool partitioning (PR #129781)

2025-03-25 Thread David Li via llvm-branch-commits
https://github.com/david-xl approved this pull request. https://github.com/llvm/llvm-project/pull/129781 ___ 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] [CodeGen][StaticDataSplitter]Support constant pool partitioning (PR #129781)

2025-03-07 Thread David Li via llvm-branch-commits
@@ -386,6 +386,16 @@ MCSection *TargetLoweringObjectFile::getSectionForConstant( return DataSection; } +MCSection *TargetLoweringObjectFile::getSectionForConstant( +const DataLayout &DL, SectionKind Kind, const Constant *C, Align &Alignment, +StringRef SectionPrefix

[llvm-branch-commits] [llvm] [ctx_prof] Flattened profile lowering pass (PR #107329)

2024-09-06 Thread David Li via llvm-branch-commits
https://github.com/david-xl approved this pull request. https://github.com/llvm/llvm-project/pull/107329 ___ 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] [ctx_prof] Flattened profile lowering pass (PR #107329)

2024-09-05 Thread David Li via llvm-branch-commits
@@ -0,0 +1,341 @@ +//===- PGOCtxProfFlattening.cpp - Contextual Instr. Flattening ===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Ap

[llvm-branch-commits] [llvm] [ctx_prof] Flattened profile lowering pass (PR #107329)

2024-09-05 Thread David Li via llvm-branch-commits
@@ -0,0 +1,333 @@ +//===- PGOCtxProfFlattening.cpp - Contextual Instr. Flattening ===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Ap

[llvm-branch-commits] [llvm] [ctx_prof] Flattened profile lowering pass (PR #107329)

2024-09-05 Thread David Li via llvm-branch-commits
@@ -0,0 +1,333 @@ +//===- PGOCtxProfFlattening.cpp - Contextual Instr. Flattening ===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Ap

[llvm-branch-commits] [llvm] [ctx_prof] Flattened profile lowering pass (PR #107329)

2024-09-05 Thread David Li via llvm-branch-commits
@@ -0,0 +1,333 @@ +//===- PGOCtxProfFlattening.cpp - Contextual Instr. Flattening ===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Ap

[llvm-branch-commits] [llvm] [ctx_prof] Flattened profile lowering pass (PR #107329)

2024-09-05 Thread David Li via llvm-branch-commits
@@ -0,0 +1,341 @@ +//===- PGOCtxProfFlattening.cpp - Contextual Instr. Flattening ===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Ap

[llvm-branch-commits] [llvm] [ctx_prof] Flattened profile lowering pass (PR #107329)

2024-09-05 Thread David Li via llvm-branch-commits
@@ -0,0 +1,341 @@ +//===- PGOCtxProfFlattening.cpp - Contextual Instr. Flattening ===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Ap

[llvm-branch-commits] [llvm][IR] Extend BranchWeightMetadata to track provenance of weights (PR #86609)

2024-06-06 Thread David Li via llvm-branch-commits
@@ -55,6 +55,17 @@ MDNode *getBranchWeightMDNode(const Instruction &I); /// Nullptr otherwise. MDNode *getValidBranchWeightMDNode(const Instruction &I); +/// Check if Branch Weight Metadata has an "expected" field from an llvm.expect* +/// intrinsic +bool hasBranchWeightProve

[llvm-branch-commits] [llvm][IR] Extend BranchWeightMetadata to track provenance of weights (PR #86609)

2024-06-05 Thread David Li via llvm-branch-commits
@@ -123,6 +121,25 @@ bool hasValidBranchWeightMD(const Instruction &I) { return getValidBranchWeightMDNode(I); } +bool hasBranchWeightProvenance(const Instruction &I) { + auto *ProfileData = I.getMetadata(LLVMContext::MD_prof); + return hasBranchWeightProvenance(ProfileDat

[llvm-branch-commits] [llvm][IR] Extend BranchWeightMetadata to track provenance of weights (PR #86609)

2024-06-05 Thread David Li via llvm-branch-commits
@@ -55,6 +55,17 @@ MDNode *getBranchWeightMDNode(const Instruction &I); /// Nullptr otherwise. MDNode *getValidBranchWeightMDNode(const Instruction &I); +/// Check if Branch Weight Metadata has an "expected" field from an llvm.expect* +/// intrinsic +bool hasBranchWeightProve

[llvm-branch-commits] [llvm][IR] Extend BranchWeightMetadata to track provenance of weights (PR #86609)

2024-06-05 Thread David Li via llvm-branch-commits
https://github.com/david-xl edited https://github.com/llvm/llvm-project/pull/86609 ___ 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][IR] Extend BranchWeightMetadata to track provenance of weights (PR #86609)

2024-04-05 Thread David Li via llvm-branch-commits
@@ -1210,12 +1210,22 @@ Instruction *Instruction::cloneImpl() const { void Instruction::swapProfMetadata() { MDNode *ProfileData = getBranchWeightMDNode(*this); - if (!ProfileData || ProfileData->getNumOperands() != 3) + if (!isBranchWeightMD(ProfileData))

[llvm-branch-commits] [llvm] [Inline][PGO] After inline, update profile for invoke instruction in both cloned instruction in the caller and original callee (PR #83809)

2024-03-05 Thread David Li via llvm-branch-commits
https://github.com/david-xl commented: The invoke instruction can have 3 different kinds of prof data 1) call count (if a direct call) 2) VP profile data (if an indirect call) 3) branch weights for landing pad. 3) can coexist with 2) and does not need to be updated. Is there an existing test c

[llvm-branch-commits] [llvm] [Inline][PGO] After inline, update profile for invoke instruction in both cloned instruction in the caller and original callee (PR #83809)

2024-03-04 Thread David Li via llvm-branch-commits
@@ -918,6 +918,18 @@ LandingPadInst *InvokeInst::getLandingPadInst() const { return cast(getUnwindDest()->getFirstNonPHI()); } +void InvokeInst::updateProfWeight(uint64_t S, uint64_t T) { david-xl wrote: should this be moved to CallBase? https://github.com