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
@@ -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
-
@@ -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/aeubanks 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/aeubanks commented:
forgot to hit "submit 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
@@ -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/10] wip: Move instrumentation passes
This change is not ready for lan
@@ -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 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
@@ -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
@@ -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
+; RUN: opt -passes="thi
@@ -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,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
@@ -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
@@ -0,0 +1,44 @@
+; RUN: opt -passes="default" -S < %s | FileCheck -check-prefix=PRELTO %s
aeubanks wrote:
`PRELTO` isn't quite accurate since we also instrument in the default
pipelines, I'd use `INSTRUMENT`/`NOINSTRUMENT` or even just `YES`/`NO` :)
https://gi
@@ -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
aeubank
@@ -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
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
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
@@ -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
@@ -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,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,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
aeubanks wrote:
should also test `O0` versions of these, plus `lto-pre-link`
https://github.com/llvm/llvm-project/pull/92171
___
cfe-commits mailing
@@ -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
aeubanks wrote:
no need to run `thinlto` here, but we should
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
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
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
@@ -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
@@ -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/aeubanks commented:
looks pretty good to me
for testing the pre-inliner one, we should add some tests in
`llvm/test/Transforms/EntryExitInstrumenter/` that invoke things like `opt
-passes='default'`, `opt -passes='thinlto-pre-link'`, `opt
-passes='thinlto'` to make sure tha
https://github.com/aeubanks 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
@@ -101,6 +101,7 @@ void initializeEarlyMachineLICMPass(PassRegistry&);
void initializeEarlyTailDuplicatePass(PassRegistry&);
void initializeEdgeBundlesPass(PassRegistry&);
void initializeEHContGuardCatchretPass(PassRegistry &);
+void initializeEntryExitInstrumenterPass(PassReg
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
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
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
@@ -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(*
@@ -1016,6 +1000,11 @@ void EmitAssemblyHelper::RunOptimizationPipeline(
if (!IsThinLTOPostLink) {
addSanitizers(TargetTriple, CodeGenOpts, LangOpts, PB);
addKCFIPass(TargetTriple, LangOpts, PB);
+ PB.registerPipelineStartEPCallback(
pasko
@@ -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));
aeubanks wrote:
can you add links to https://reviews.llvm.org/D97608,
https://github.com/rust-lang/rust/issues/92109,
https://github.com/llvm/llvm-project/issues/52853
https://github.com/llvm/llvm-project/pull/92171
___
cfe-commits mailing list
cfe-c
@@ -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(*
@@ -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(
aeuban
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
llvmbot wrote:
@llvm/pr-subscribers-clang
@llvm/pr-subscribers-clang-codegen
Author: Egor Pasko (pasko)
Changes
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-inl
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
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
57 matches
Mail list logo