https://github.com/pasko updated https://github.com/llvm/llvm-project/pull/92171
>From df3f8dfc47cd8d7b220ed712dc7c2cab1c563f50 Mon Sep 17 00:00:00 2001
From: Egor Pasko
Date: Mon, 6 May 2024 19:48:59 +0200
Subject: [PATCH 01/15] wip: Move instrumentation passes
This change is not ready for lan
@@ -1030,6 +1036,12 @@
PassBuilder::buildModuleSimplificationPipeline(OptimizationLevel Level,
Phase != ThinOrFullLTOPhase::ThinLTOPostLink)
MPM.addPass(SampleProfileProbePass(TM));
+ // Instrument function entry and exit before all inlining.
+ if (!isLTOPostLink(
https://github.com/pasko updated https://github.com/llvm/llvm-project/pull/92171
>From df3f8dfc47cd8d7b220ed712dc7c2cab1c563f50 Mon Sep 17 00:00:00 2001
From: Egor Pasko
Date: Mon, 6 May 2024 19:48:59 +0200
Subject: [PATCH 01/16] wip: Move instrumentation passes
This change is not ready for lan
pasko wrote:
> looks like `CodeGen/AMDGPU/llc-pipeline.ll` is failing
Fixed.
https://github.com/llvm/llvm-project/pull/92171
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/pasko created https://github.com/llvm/llvm-project/pull/92171
This change is not ready for landing yet.
Move EntryExitInstrumenter(PostInlining=true) to as late as possible and
EntryExitInstrumenter(PostInlining=false) to an early pre-inlining stage (but
skip for ThinLTO pos
https://github.com/pasko converted_to_draft
https://github.com/llvm/llvm-project/pull/92171
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -670,9 +670,6 @@ void CodeGenPassBuilder::addIRPasses(
!Opt.DisablePartialLibcallInlining)
addPass(PartiallyInlineLibCallsPass());
- // Instrument function entry and exit, e.g. with calls to mcount().
- addPass(EntryExitInstrumenterPass(/*PostInlining=*/true));
@@ -1016,6 +1000,11 @@ void EmitAssemblyHelper::RunOptimizationPipeline(
if (!IsThinLTOPostLink) {
addSanitizers(TargetTriple, CodeGenOpts, LangOpts, PB);
addKCFIPass(TargetTriple, LangOpts, PB);
+ PB.registerPipelineStartEPCallback(
pasko
@@ -135,6 +138,65 @@ static bool runOnFunction(Function &F, bool PostInlining) {
return Changed;
}
+namespace {
+struct EntryExitInstrumenter : public FunctionPass {
+ static char ID;
+ EntryExitInstrumenter() : FunctionPass(ID) {
+initializeEntryExitInstrumenterPass(*
https://github.com/pasko edited https://github.com/llvm/llvm-project/pull/92171
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/pasko updated https://github.com/llvm/llvm-project/pull/92171
>From df3f8dfc47cd8d7b220ed712dc7c2cab1c563f50 Mon Sep 17 00:00:00 2001
From: Egor Pasko
Date: Mon, 6 May 2024 19:48:59 +0200
Subject: [PATCH 1/2] wip: Move instrumentation passes
This change is not ready for landi
https://github.com/pasko edited https://github.com/llvm/llvm-project/pull/92171
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
pasko wrote:
> can you add links to https://reviews.llvm.org/D97608,
> [rust-lang/rust#92109](https://github.com/rust-lang/rust/issues/92109), #52853
Done (Updated the toplevel comment on the PR)
https://github.com/llvm/llvm-project/pull/92171
___
c
pasko wrote:
@aeubanks Thanks for the first set of comments. I think I addressed them all
and checked that instrumentation is still WAI in my ThinkLTO example. I did not
run/update tests yet, this is TBD. Another round of review pre-tests would be
appreciated.
https://github.com/llvm/llvm-pro
@@ -101,6 +101,7 @@ void initializeEarlyMachineLICMPass(PassRegistry&);
void initializeEarlyTailDuplicatePass(PassRegistry&);
void initializeEdgeBundlesPass(PassRegistry&);
void initializeEHContGuardCatchretPass(PassRegistry &);
+void initializeEntryExitInstrumenterPass(PassReg
@@ -1028,6 +1029,14 @@
PassBuilder::buildModuleSimplificationPipeline(OptimizationLevel Level,
Phase != ThinOrFullLTOPhase::ThinLTOPostLink)
MPM.addPass(SampleProfileProbePass(TM));
+ // Instrument function entry and exit before all inlining.
+ if (Phase != ThinOr
https://github.com/pasko updated https://github.com/llvm/llvm-project/pull/92171
>From df3f8dfc47cd8d7b220ed712dc7c2cab1c563f50 Mon Sep 17 00:00:00 2001
From: Egor Pasko
Date: Mon, 6 May 2024 19:48:59 +0200
Subject: [PATCH 1/3] wip: Move instrumentation passes
This change is not ready for landi
https://github.com/pasko updated https://github.com/llvm/llvm-project/pull/92171
>From df3f8dfc47cd8d7b220ed712dc7c2cab1c563f50 Mon Sep 17 00:00:00 2001
From: Egor Pasko
Date: Mon, 6 May 2024 19:48:59 +0200
Subject: [PATCH 1/4] wip: Move instrumentation passes
This change is not ready for landi
pasko wrote:
Hello @aeubanks,
I added a couple of new tests as you suggested. I do not have good intuition on
their coverage. I think I will need to add a few cases, like always_inline or
slightly more complicated code. Can you please take a look at the general
structure? Does it roughly matc
@@ -0,0 +1,29 @@
+; RUN: llc -mtriple=x86_64-- -O0 < %s | FileCheck %s
+; RUN: llc -mtriple=x86_64-- -O1 < %s | FileCheck %s
+; RUN: llc -mtriple=x86_64-- -O2 < %s | FileCheck %s
+
+; The codegen should insert post-inlining instrumentation calls and should not
+; insert pre-inlini
@@ -0,0 +1,31 @@
+; RUN: opt -passes="default" -S < %s | FileCheck %s
+; RUN: opt -passes="thinlto-pre-link" -S < %s | FileCheck %s
+; RUN: opt -passes="thinlto-pre-link,thinlto" -S < %s | FileCheck %s
+
+target triple = "x86_64-unknown-linux"
+
+define void @leaf_function() #0 {
@@ -0,0 +1,31 @@
+; RUN: opt -passes="default" -S < %s | FileCheck %s
+; RUN: opt -passes="thinlto-pre-link" -S < %s | FileCheck %s
+; RUN: opt -passes="thinlto-pre-link,thinlto" -S < %s | FileCheck %s
pasko wrote:
Ah, good idea! I still went with O2 for lto/thin
https://github.com/pasko updated https://github.com/llvm/llvm-project/pull/92171
>From df3f8dfc47cd8d7b220ed712dc7c2cab1c563f50 Mon Sep 17 00:00:00 2001
From: Egor Pasko
Date: Mon, 6 May 2024 19:48:59 +0200
Subject: [PATCH 1/6] wip: Move instrumentation passes
This change is not ready for landi
https://github.com/pasko updated https://github.com/llvm/llvm-project/pull/92171
>From df3f8dfc47cd8d7b220ed712dc7c2cab1c563f50 Mon Sep 17 00:00:00 2001
From: Egor Pasko
Date: Mon, 6 May 2024 19:48:59 +0200
Subject: [PATCH 1/7] wip: Move instrumentation passes
This change is not ready for landi
@@ -0,0 +1,31 @@
+; RUN: opt -passes="default" -S < %s | FileCheck %s
pasko wrote:
Done, I think, but it is evening, and I might be missing something.
https://github.com/llvm/llvm-project/pull/92171
___
cfe-commits mai
@@ -0,0 +1,29 @@
+; RUN: llc -mtriple=x86_64-- -O0 < %s | FileCheck %s
+; RUN: llc -mtriple=x86_64-- -O1 < %s | FileCheck %s
+; RUN: llc -mtriple=x86_64-- -O2 < %s | FileCheck %s
+
+; The codegen should insert post-inlining instrumentation calls and should not
+; insert pre-inlini
@@ -0,0 +1,44 @@
+; RUN: opt -passes="default" -S < %s | FileCheck -check-prefix=PRELTO %s
+; RUN: opt -passes="default" -S < %s | FileCheck -check-prefix=PRELTO %s
+; RUN: opt -passes="thinlto-pre-link,thinlto" -S < %s | FileCheck
-check-prefix=PRELTO %s
+; RUN: opt -passes="thi
@@ -0,0 +1,44 @@
+; RUN: opt -passes="default" -S < %s | FileCheck -check-prefix=PRELTO %s
pasko wrote:
Done. Went with INSTRUMENT/NOINSTRUMENT.
https://github.com/llvm/llvm-project/pull/92171
___
cfe-commits mailing l
@@ -0,0 +1,44 @@
+; RUN: opt -passes="default" -S < %s | FileCheck -check-prefix=PRELTO %s
+; RUN: opt -passes="default" -S < %s | FileCheck -check-prefix=PRELTO %s
+; RUN: opt -passes="thinlto-pre-link,thinlto" -S < %s | FileCheck
-check-prefix=PRELTO %s
pasko w
https://github.com/pasko updated https://github.com/llvm/llvm-project/pull/92171
>From df3f8dfc47cd8d7b220ed712dc7c2cab1c563f50 Mon Sep 17 00:00:00 2001
From: Egor Pasko
Date: Mon, 6 May 2024 19:48:59 +0200
Subject: [PATCH 1/9] wip: Move instrumentation passes
This change is not ready for landi
https://github.com/pasko updated https://github.com/llvm/llvm-project/pull/92171
>From df3f8dfc47cd8d7b220ed712dc7c2cab1c563f50 Mon Sep 17 00:00:00 2001
From: Egor Pasko
Date: Mon, 6 May 2024 19:48:59 +0200
Subject: [PATCH 1/9] wip: Move instrumentation passes
This change is not ready for landi
@@ -1,41 +0,0 @@
-// REQUIRES: arm-registered-target,aarch64-registered-target
-
-// RUN: %clang -target armv7-unknown-none-eabi -pg -S -emit-llvm -o - %s |
FileCheck %s -check-prefixes=CHECK,UNSUPPORTED
-// RUN: %clang -target armv7-unknown-none-eabi -pg -meabi gnu -S -emit-llvm
https://github.com/pasko updated https://github.com/llvm/llvm-project/pull/92171
>From df3f8dfc47cd8d7b220ed712dc7c2cab1c563f50 Mon Sep 17 00:00:00 2001
From: Egor Pasko
Date: Mon, 6 May 2024 19:48:59 +0200
Subject: [PATCH 01/10] wip: Move instrumentation passes
This change is not ready for lan
@@ -1,37 +1,27 @@
// REQUIRES: x86-registered-target
-// RUN: %clang_cc1 -triple x86_64-unknown-unknown -finstrument-functions -O0
-o - -emit-llvm %s | FileCheck %s
-// RUN: %clang_cc1 -triple x86_64-unknown-unknown -finstrument-functions -O2
-o - -emit-llvm %s | FileCheck %s
-
@@ -1,37 +1,27 @@
// REQUIRES: x86-registered-target
-// RUN: %clang_cc1 -triple x86_64-unknown-unknown -finstrument-functions -O0
-o - -emit-llvm %s | FileCheck %s
-// RUN: %clang_cc1 -triple x86_64-unknown-unknown -finstrument-functions -O2
-o - -emit-llvm %s | FileCheck %s
-
@@ -1,37 +1,27 @@
// REQUIRES: x86-registered-target
-// RUN: %clang_cc1 -triple x86_64-unknown-unknown -finstrument-functions -O0
-o - -emit-llvm %s | FileCheck %s
-// RUN: %clang_cc1 -triple x86_64-unknown-unknown -finstrument-functions -O2
-o - -emit-llvm %s | FileCheck %s
-
https://github.com/pasko updated https://github.com/llvm/llvm-project/pull/92171
>From df3f8dfc47cd8d7b220ed712dc7c2cab1c563f50 Mon Sep 17 00:00:00 2001
From: Egor Pasko
Date: Mon, 6 May 2024 19:48:59 +0200
Subject: [PATCH 01/11] wip: Move instrumentation passes
This change is not ready for lan
https://github.com/pasko edited https://github.com/llvm/llvm-project/pull/92171
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/pasko edited https://github.com/llvm/llvm-project/pull/92171
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/pasko ready_for_review
https://github.com/llvm/llvm-project/pull/92171
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/pasko edited https://github.com/llvm/llvm-project/pull/92171
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -1,5 +1,5 @@
// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -debug-info-kind=standalone
-emit-llvm -o - %s -finstrument-functions | FileCheck %s
pasko wrote:
Done.
https://github.com/llvm/llvm-project/pull/92171
___
@@ -1,25 +1,13 @@
// RUN: %clang_cc1 -pg -triple powerpc-ibm-aix7.2.0.0 -emit-llvm %s -o - |
FileCheck %s
pasko wrote:
Done.
https://github.com/llvm/llvm-project/pull/92171
___
cfe-commits mailing list
cfe-commits@li
https://github.com/pasko updated https://github.com/llvm/llvm-project/pull/92171
>From df3f8dfc47cd8d7b220ed712dc7c2cab1c563f50 Mon Sep 17 00:00:00 2001
From: Egor Pasko
Date: Mon, 6 May 2024 19:48:59 +0200
Subject: [PATCH 01/12] wip: Move instrumentation passes
This change is not ready for lan
@@ -1030,6 +1036,12 @@
PassBuilder::buildModuleSimplificationPipeline(OptimizationLevel Level,
Phase != ThinOrFullLTOPhase::ThinLTOPostLink)
MPM.addPass(SampleProfileProbePass(TM));
+ // Instrument function entry and exit before all inlining.
+ if (!isLTOPostLink(
45 matches
Mail list logo