snehasish wrote:
### Merge activity
* **May 19, 7:09 PM EDT**: A user started a stack merge that includes this pull
request via
[Graphite](https://app.graphite.dev/github/pr/llvm/llvm-project/140501).
https://github.com/llvm/llvm-project/pull/140501
__
snehasish wrote:
### Merge activity
* **May 19, 7:09 PM EDT**: A user started a stack merge that includes this pull
request via
[Graphite](https://app.graphite.dev/github/pr/llvm/llvm-project/140503).
https://github.com/llvm/llvm-project/pull/140503
__
snehasish wrote:
### Merge activity
* **May 19, 7:09 PM EDT**: A user started a stack merge that includes this pull
request via
[Graphite](https://app.graphite.dev/github/pr/llvm/llvm-project/140502).
https://github.com/llvm/llvm-project/pull/140502
__
snehasish wrote:
### Merge activity
* **May 19, 7:09 PM EDT**: A user started a stack merge that includes this pull
request via
[Graphite](https://app.graphite.dev/github/pr/llvm/llvm-project/140505).
https://github.com/llvm/llvm-project/pull/140505
__
snehasish wrote:
### Merge activity
* **May 19, 7:09 PM EDT**: A user started a stack merge that includes this pull
request via
[Graphite](https://app.graphite.dev/github/pr/llvm/llvm-project/140504).
https://github.com/llvm/llvm-project/pull/140504
__
https://github.com/snehasish updated
https://github.com/llvm/llvm-project/pull/140502
>From 9028dc98ac740d72c9c6ad02e4503da5e9c02a13 Mon Sep 17 00:00:00 2001
From: Snehasish Kumar
Date: Fri, 16 May 2025 20:20:00 -0700
Subject: [PATCH 1/2] [NFC][MemProf] Move getGUID out of IndexedMemProfRecord
https://github.com/snehasish updated
https://github.com/llvm/llvm-project/pull/140501
>From 178cc0cac2258349b482f9315694f84e9d3581a5 Mon Sep 17 00:00:00 2001
From: Snehasish Kumar
Date: Fri, 16 May 2025 18:54:05 -0700
Subject: [PATCH 1/2] [NFC][MemProf] Move Radix tree methods to their own
hea
https://github.com/snehasish updated
https://github.com/llvm/llvm-project/pull/140505
>From 305e2bdbab27828633afb3d1e2698002f7ccadda Mon Sep 17 00:00:00 2001
From: Snehasish Kumar
Date: Mon, 19 May 2025 00:03:59 -0700
Subject: [PATCH] [NFC][MemProf] Move types shared between Analysis,
ProfileD
https://github.com/snehasish updated
https://github.com/llvm/llvm-project/pull/140503
>From 1f2f80df22f154bc317ae9298cf20c9f91574f55 Mon Sep 17 00:00:00 2001
From: Snehasish Kumar
Date: Fri, 16 May 2025 23:41:29 -0700
Subject: [PATCH 1/2] [NFC][MemProf] Move IndexedMemProfData to its own header
https://github.com/snehasish updated
https://github.com/llvm/llvm-project/pull/140503
>From 1f2f80df22f154bc317ae9298cf20c9f91574f55 Mon Sep 17 00:00:00 2001
From: Snehasish Kumar
Date: Fri, 16 May 2025 23:41:29 -0700
Subject: [PATCH 1/2] [NFC][MemProf] Move IndexedMemProfData to its own header
https://github.com/snehasish updated
https://github.com/llvm/llvm-project/pull/140504
>From 36aeb3a179b64b9631af7849ed08d8cf7c7564e5 Mon Sep 17 00:00:00 2001
From: Snehasish Kumar
Date: Fri, 16 May 2025 23:55:43 -0700
Subject: [PATCH] [NFC][MemProf] Add the LLVM license text and minor clean up.
https://github.com/snehasish updated
https://github.com/llvm/llvm-project/pull/140501
>From 178cc0cac2258349b482f9315694f84e9d3581a5 Mon Sep 17 00:00:00 2001
From: Snehasish Kumar
Date: Fri, 16 May 2025 18:54:05 -0700
Subject: [PATCH 1/2] [NFC][MemProf] Move Radix tree methods to their own
hea
https://github.com/snehasish updated
https://github.com/llvm/llvm-project/pull/140504
>From 36aeb3a179b64b9631af7849ed08d8cf7c7564e5 Mon Sep 17 00:00:00 2001
From: Snehasish Kumar
Date: Fri, 16 May 2025 23:55:43 -0700
Subject: [PATCH] [NFC][MemProf] Add the LLVM license text and minor clean up.
https://github.com/snehasish updated
https://github.com/llvm/llvm-project/pull/140502
>From 9028dc98ac740d72c9c6ad02e4503da5e9c02a13 Mon Sep 17 00:00:00 2001
From: Snehasish Kumar
Date: Fri, 16 May 2025 20:20:00 -0700
Subject: [PATCH 1/2] [NFC][MemProf] Move getGUID out of IndexedMemProfRecord
https://github.com/snehasish updated
https://github.com/llvm/llvm-project/pull/140505
>From 305e2bdbab27828633afb3d1e2698002f7ccadda Mon Sep 17 00:00:00 2001
From: Snehasish Kumar
Date: Mon, 19 May 2025 00:03:59 -0700
Subject: [PATCH] [NFC][MemProf] Move types shared between Analysis,
ProfileD
@@ -46,6 +46,7 @@
#include "llvm/Transforms/Utils/ModuleUtils.h"
#include
#include
+#include
snehasish wrote:
Yes, we need it for the `LocHashToCallSites` type but we were including it via
ModuleSummaryIndex.h.
https://github.com/llvm/llvm-project/pull/14
snehasish wrote:
> [!WARNING]
> This pull request is not mergeable via GitHub because a downstack PR is
> open. Once all requirements are satisfied, merge this PR as a stack href="https://app.graphite.dev/github/pr/llvm/llvm-project/140501?utm_source=stack-comment-downstack-mergeability-warning
https://github.com/snehasish edited
https://github.com/llvm/llvm-project/pull/140505
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
https://github.com/snehasish created
https://github.com/llvm/llvm-project/pull/140502
None
>From 83ff2babe9dc5e71bc01eefb0aa78e6634d25351 Mon Sep 17 00:00:00 2001
From: Snehasish Kumar
Date: Fri, 16 May 2025 20:20:00 -0700
Subject: [PATCH] [NFC][MemProf] Move getGUID out of IndexedMemProfRecor
https://github.com/snehasish updated
https://github.com/llvm/llvm-project/pull/140505
>From 8751ae1be821ebc4803bddd05ddb49a84c0b2773 Mon Sep 17 00:00:00 2001
From: Snehasish Kumar
Date: Mon, 19 May 2025 00:03:59 -0700
Subject: [PATCH] [NFC][MemProf] Move types shared between Analysis,
ProfileD
https://github.com/snehasish created
https://github.com/llvm/llvm-project/pull/140501
None
>From c8e520c48fe9e64f9e2ac389498d0e27797bf362 Mon Sep 17 00:00:00 2001
From: Snehasish Kumar
Date: Fri, 16 May 2025 18:54:05 -0700
Subject: [PATCH] [NFC][MemProf] Move Radix tree methods to their own he
https://github.com/snehasish edited
https://github.com/llvm/llvm-project/pull/140503
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
https://github.com/snehasish edited
https://github.com/llvm/llvm-project/pull/140504
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
https://github.com/snehasish edited
https://github.com/llvm/llvm-project/pull/140502
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
https://github.com/snehasish edited
https://github.com/llvm/llvm-project/pull/140501
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
snehasish wrote:
> [!WARNING]
> This pull request is not mergeable via GitHub because a downstack PR is
> open. Once all requirements are satisfied, merge this PR as a stack href="https://app.graphite.dev/github/pr/llvm/llvm-project/140502?utm_source=stack-comment-downstack-mergeability-warning
snehasish wrote:
> [!WARNING]
> This pull request is not mergeable via GitHub because a downstack PR is
> open. Once all requirements are satisfied, merge this PR as a stack href="https://app.graphite.dev/github/pr/llvm/llvm-project/140505?utm_source=stack-comment-downstack-mergeability-warning
snehasish wrote:
> [!WARNING]
> This pull request is not mergeable via GitHub because a downstack PR is
> open. Once all requirements are satisfied, merge this PR as a stack href="https://app.graphite.dev/github/pr/llvm/llvm-project/140503?utm_source=stack-comment-downstack-mergeability-warning
snehasish wrote:
> [!WARNING]
> This pull request is not mergeable via GitHub because a downstack PR is
> open. Once all requirements are satisfied, merge this PR as a stack href="https://app.graphite.dev/github/pr/llvm/llvm-project/140504?utm_source=stack-comment-downstack-mergeability-warning
https://github.com/snehasish created
https://github.com/llvm/llvm-project/pull/140504
None
>From 532d85a11742e5a3994e5efce357f85c0c60a6c7 Mon Sep 17 00:00:00 2001
From: Snehasish Kumar
Date: Fri, 16 May 2025 23:55:43 -0700
Subject: [PATCH] [NFC][MemProf] Add the LLVM license text and minor cle
https://github.com/snehasish created
https://github.com/llvm/llvm-project/pull/140503
None
>From 61b636b6367ff9fe41eefce3430ee58551ffedf3 Mon Sep 17 00:00:00 2001
From: Snehasish Kumar
Date: Fri, 16 May 2025 23:41:29 -0700
Subject: [PATCH] [NFC][MemProf] Move IndexedMemProfData to its own head
https://github.com/snehasish created
https://github.com/llvm/llvm-project/pull/140505
None
>From d4413c619035039133f7d3509bbe6c94a1650adf Mon Sep 17 00:00:00 2001
From: Snehasish Kumar
Date: Mon, 19 May 2025 00:03:59 -0700
Subject: [PATCH] [NFC][MemProf] Move types shared between Analysis,
Pr
https://github.com/snehasish edited
https://github.com/llvm/llvm-project/pull/134766
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
@@ -414,6 +417,58 @@ void removeInstrumentation(Function &F) {
I.eraseFromParent();
}
+void annotateIndirectCall(
+Module &M, CallBase &CB,
+const DenseMap &FlatProf,
+const InstrProfCallsite &Ins) {
+ auto Idx = Ins.getIndex()->getZExtValue();
+ auto FIt
https://github.com/snehasish approved this pull request.
lgtm
https://github.com/llvm/llvm-project/pull/134766
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
@@ -414,6 +417,58 @@ void removeInstrumentation(Function &F) {
I.eraseFromParent();
}
+void annotateIndirectCall(
+Module &M, CallBase &CB,
+const DenseMap &FlatProf,
+const InstrProfCallsite &Ins) {
+ auto Idx = Ins.getIndex()->getZExtValue();
+ auto FIt
https://github.com/snehasish updated
https://github.com/llvm/llvm-project/pull/132433
>From 4680029efc3f4e350f7a07033088a9925b9300d7 Mon Sep 17 00:00:00 2001
From: Snehasish Kumar
Date: Fri, 21 Mar 2025 17:00:38 +
Subject: [PATCH] Update tests, apply clang-tidy suggestions
---
llvm/lib/Tr
https://github.com/snehasish updated
https://github.com/llvm/llvm-project/pull/132433
>From 4680029efc3f4e350f7a07033088a9925b9300d7 Mon Sep 17 00:00:00 2001
From: Snehasish Kumar
Date: Fri, 21 Mar 2025 17:00:38 +
Subject: [PATCH] Update tests, apply clang-tidy suggestions
---
llvm/lib/Tr
@@ -0,0 +1,62 @@
+; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
UTC_ARGS: --check-globals --version 2
+; RUN: opt < %s -passes='simplifycfg'
-simplifycfg-require-and-preserve-domtree=1 -S | FileCheck %s
--check-prefix=HOIST
+
+; Test case based on C+
@@ -3436,6 +3433,16 @@ static void combineMetadata(Instruction *K, const
Instruction *J,
K->setMetadata(LLVMContext::MD_callsite,
MDNode::getMergedCallsiteMetadata(KCallSite, JCallSite));
}
+
+ // Merge prof metadata.
+ // Handle separately to suppor
https://github.com/snehasish updated
https://github.com/llvm/llvm-project/pull/132433
>From 42a9972571f8c8872e7d71def2236be400428606 Mon Sep 17 00:00:00 2001
From: Snehasish Kumar
Date: Fri, 21 Mar 2025 17:00:38 +
Subject: [PATCH] Update tests, apply clang-tidy suggestions
---
llvm/lib/Tr
https://github.com/snehasish updated
https://github.com/llvm/llvm-project/pull/132433
>From 42a9972571f8c8872e7d71def2236be400428606 Mon Sep 17 00:00:00 2001
From: Snehasish Kumar
Date: Fri, 21 Mar 2025 17:00:38 +
Subject: [PATCH] Update tests, apply clang-tidy suggestions
---
llvm/lib/Tr
https://github.com/snehasish 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
@@ -0,0 +1,141 @@
+; RUN: llc -mtriple=aarch64 -enable-split-machine-functions \
snehasish wrote:
Yeah, it makes sense to rely on a more precise profile due to the fine grained
nature of this optimization. Refactoring out the requirement as a condition
common t
@@ -0,0 +1,131 @@
+target datalayout =
"e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
+target triple = "x86_64-grtev4-linux-gnu"
+
+; Tests that constant pool hotness is aggregated across the module. The
snehasish wrote:
I thin
https://github.com/snehasish edited
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
https://github.com/snehasish approved this pull request.
lgtm with some suggested changes to the tests.
https://github.com/llvm/llvm-project/pull/129781
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-
@@ -0,0 +1,141 @@
+; RUN: llc -mtriple=aarch64 -enable-split-machine-functions \
+; RUN: -partition-static-data-sections=true -function-sections=true \
+; RUN: -unique-section-names=false \
+; RUN: %s -o - 2>&1 | FileCheck %s --dump-input=always
+
+; Repeat the RUN com
@@ -0,0 +1,141 @@
+; RUN: llc -mtriple=aarch64 -enable-split-machine-functions \
+; RUN: -partition-static-data-sections=true -function-sections=true \
+; RUN: -unique-section-names=false \
+; RUN: %s -o - 2>&1 | FileCheck %s --dump-input=always
+
+; Repeat the RUN com
@@ -0,0 +1,141 @@
+; RUN: llc -mtriple=aarch64 -enable-split-machine-functions \
+; RUN: -partition-static-data-sections=true -function-sections=true \
+; RUN: -unique-section-names=false \
+; RUN: %s -o - 2>&1 | FileCheck %s --dump-input=always
+
+; Repeat the RUN com
@@ -0,0 +1,141 @@
+; RUN: llc -mtriple=aarch64 -enable-split-machine-functions \
snehasish wrote:
Can we drop the `-enable-split-machine-functions` flag here and below?
https://github.com/llvm/llvm-project/pull/129781
https://github.com/snehasish created
https://github.com/llvm/llvm-project/pull/132433
Preserve branch weight metadata when merging instructions if one of the
instructions is missing metadata. This is similar in behaviour to what
we do today for other types of metadata such as mmra, memprof and
c
https://github.com/snehasish updated
https://github.com/llvm/llvm-project/pull/132433
>From 5b2f87db7ec72d12e4d8837203c3c7b953649907 Mon Sep 17 00:00:00 2001
From: Snehasish Kumar
Date: Fri, 21 Mar 2025 17:00:38 +
Subject: [PATCH] [Metadata] Preserve MD_prof when merging instructions when
snehasish wrote:
> [!WARNING]
> This pull request is not mergeable via GitHub because a downstack PR is
> open. Once all requirements are satisfied, merge this PR as a stack href="https://app.graphite.dev/github/pr/llvm/llvm-project/132433?utm_source=stack-comment-downstack-mergeability-warning
@@ -265,7 +275,16 @@ Error llvm::createCtxProfFromYAML(StringRef Profile,
raw_ostream &Out) {
if (!TopList)
return createStringError(
"Unexpected error converting internal structure to ctx profile");
- Writer.writeContextual(*TopList, DC.TotalRoo
@@ -246,22 +246,37 @@ ContextNode *getFlatProfile(FunctionData &Data, GUID Guid,
ContextNode *getUnhandledContext(FunctionData &Data, GUID Guid,
uint32_t NumCounters) {
- // 1) if we are under a root (regardless if this thread is collecting or
@@ -246,22 +246,37 @@ ContextNode *getFlatProfile(FunctionData &Data, GUID Guid,
ContextNode *getUnhandledContext(FunctionData &Data, GUID Guid,
uint32_t NumCounters) {
- // 1) if we are under a root (regardless if this thread is collecting or
@@ -83,6 +84,20 @@ struct ContextRoot {
// Count the number of entries - regardless if we could take the `Taken`
mutex
::__sanitizer::atomic_uint64_t TotalEntries = {};
+ // Profiles for functions we encounter when collecting a contexutal profile,
+ // that are not asso
@@ -206,14 +234,10 @@ void
StaticDataSplitter::annotateStaticDataWithoutProfiles(
for (const auto &MBB : MF) {
for (const MachineInstr &I : MBB) {
for (const MachineOperand &Op : I.operands()) {
-if (!Op.isGlobal())
- continue;
-const Globa
@@ -2769,6 +2769,23 @@ namespace {
} // end anonymous namespace
+StringRef AsmPrinter::getConstantSectionSuffix(const Constant *C) const {
snehasish wrote:
Consider refactoring a bit to reduce nesting --
```
if(!TM.Options.EnableStaticDataPartitioning || C
@@ -2769,6 +2769,23 @@ namespace {
} // end anonymous namespace
+StringRef AsmPrinter::getConstantSectionSuffix(const Constant *C) const {
+ SmallString<8> SectionNameSuffix;
+ if (TM.Options.EnableStaticDataPartitioning) {
+if (C && SDPI && PSI) {
+ auto Count = S
@@ -456,3 +463,170 @@ declare void @_ZN5Base35func3Ev(ptr)
// 1 call instruction from the entry block.
EXPECT_EQ(F->front().size(), OrigEntryBBSize + 4);
}
+
+using namespace llvm::ctx_profile;
+
+class ContextManager final {
+ std::vector> Nodes;
+ std::map Roots;
+
+pub
https://github.com/snehasish approved this pull request.
lgtm, rest are minor nits.
https://github.com/llvm/llvm-project/pull/105469
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo
@@ -456,3 +463,170 @@ declare void @_ZN5Base35func3Ev(ptr)
// 1 call instruction from the entry block.
EXPECT_EQ(F->front().size(), OrigEntryBBSize + 4);
}
+
+using namespace llvm::ctx_profile;
+
+class ContextManager final {
+ std::vector> Nodes;
+ std::map Roots;
+
+pub
@@ -456,3 +463,170 @@ declare void @_ZN5Base35func3Ev(ptr)
// 1 call instruction from the entry block.
EXPECT_EQ(F->front().size(), OrigEntryBBSize + 4);
}
+
+using namespace llvm::ctx_profile;
+
+class ContextManager final {
+ std::vector> Nodes;
+ std::map Roots;
+
+pub
https://github.com/snehasish edited
https://github.com/llvm/llvm-project/pull/105469
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
@@ -572,6 +575,89 @@ CallBase &llvm::promoteCallWithIfThenElse(CallBase &CB,
Function *Callee,
return promoteCall(NewInst, Callee);
}
+CallBase *llvm::promoteCallWithIfThenElse(CallBase &CB, Function &Callee,
+ PGOContextualProfile &
@@ -456,3 +463,170 @@ declare void @_ZN5Base35func3Ev(ptr)
// 1 call instruction from the entry block.
EXPECT_EQ(F->front().size(), OrigEntryBBSize + 4);
}
+
+using namespace llvm::ctx_profile;
+
+class ContextManager final {
+ std::vector> Nodes;
+ std::map Roots;
+
+pub
@@ -572,6 +575,89 @@ CallBase &llvm::promoteCallWithIfThenElse(CallBase &CB,
Function *Callee,
return promoteCall(NewInst, Callee);
}
+CallBase *llvm::promoteCallWithIfThenElse(CallBase &CB, Function &Callee,
+ PGOContextualProfile &
@@ -572,6 +575,89 @@ CallBase &llvm::promoteCallWithIfThenElse(CallBase &CB,
Function *Callee,
return promoteCall(NewInst, Callee);
}
+CallBase *llvm::promoteCallWithIfThenElse(CallBase &CB, Function &Callee,
+ PGOContextualProfile &
@@ -572,6 +575,89 @@ CallBase &llvm::promoteCallWithIfThenElse(CallBase &CB,
Function *Callee,
return promoteCall(NewInst, Callee);
}
+CallBase *llvm::promoteCallWithIfThenElse(CallBase &CB, Function &Callee,
+ PGOContextualProfile &
@@ -300,6 +305,11 @@ Value *InstrProfCallsite::getCallee() const {
return nullptr;
}
+void InstrProfCallsite::setCallee(Value *V) {
snehasish wrote:
nit: `Value* Callee` to match the decl.
https://github.com/llvm/llvm-project/pull/105469
__
@@ -572,6 +575,89 @@ CallBase &llvm::promoteCallWithIfThenElse(CallBase &CB,
Function *Callee,
return promoteCall(NewInst, Callee);
}
+CallBase *llvm::promoteCallWithIfThenElse(CallBase &CB, Function &Callee,
+ PGOContextualProfile &
@@ -572,6 +575,89 @@ CallBase &llvm::promoteCallWithIfThenElse(CallBase &CB,
Function *Callee,
return promoteCall(NewInst, Callee);
}
+CallBase *llvm::promoteCallWithIfThenElse(CallBase &CB, Function &Callee,
+ PGOContextualProfile &
74 matches
Mail list logo