[clang] [clang][deps] Remove pgo profile flags from modules (PR #87724)

2024-04-05 Thread Argyrios Kyrtzidis via cfe-commits

https://github.com/akyrtzi closed 
https://github.com/llvm/llvm-project/pull/87724
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] [clang][deps] Remove pgo profile flags from modules (PR #87724)

2024-04-05 Thread Jan Svoboda via cfe-commits

https://github.com/jansvoboda11 approved this pull request.

LGTM

https://github.com/llvm/llvm-project/pull/87724
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] [clang][deps] Remove pgo profile flags from modules (PR #87724)

2024-04-04 Thread via cfe-commits

llvmbot wrote:




@llvm/pr-subscribers-clang

Author: Argyrios Kyrtzidis (akyrtzi)


Changes

These are not necessary when not performing codegen.

---
Full diff: https://github.com/llvm/llvm-project/pull/87724.diff


3 Files Affected:

- (modified) clang/lib/Tooling/DependencyScanning/ModuleDepCollector.cpp (+3) 
- (modified) clang/test/ClangScanDeps/Inputs/removed-args/cdb.json.template 
(+1-1) 
- (modified) clang/test/ClangScanDeps/removed-args.c (+4) 


``diff
diff --git a/clang/lib/Tooling/DependencyScanning/ModuleDepCollector.cpp 
b/clang/lib/Tooling/DependencyScanning/ModuleDepCollector.cpp
index eb5c50c35428fe..94ccbd3351b09d 100644
--- a/clang/lib/Tooling/DependencyScanning/ModuleDepCollector.cpp
+++ b/clang/lib/Tooling/DependencyScanning/ModuleDepCollector.cpp
@@ -175,6 +175,9 @@ makeCommonInvocationForModuleBuild(CompilerInvocation CI) {
 CI.getCodeGenOpts().CoverageCompilationDir.clear();
 CI.getCodeGenOpts().CoverageDataFile.clear();
 CI.getCodeGenOpts().CoverageNotesFile.clear();
+CI.getCodeGenOpts().ProfileInstrumentUsePath.clear();
+CI.getCodeGenOpts().SampleProfileFile.clear();
+CI.getCodeGenOpts().ProfileRemappingFile.clear();
   }
 
   // Map output paths that affect behaviour to "-" so their existence is in the
diff --git a/clang/test/ClangScanDeps/Inputs/removed-args/cdb.json.template 
b/clang/test/ClangScanDeps/Inputs/removed-args/cdb.json.template
index 7ae3c88aedd8d2..ca56799cd08eab 100644
--- a/clang/test/ClangScanDeps/Inputs/removed-args/cdb.json.template
+++ b/clang/test/ClangScanDeps/Inputs/removed-args/cdb.json.template
@@ -1,7 +1,7 @@
 [
   {
 "directory": "DIR",
-"command": "clang -fsyntax-only DIR/tu.c -fmodules -fimplicit-module-maps 
-fmodules-validate-once-per-build-session 
-fbuild-session-file=DIR/build-session -fmodules-prune-interval=123 
-fmodules-prune-after=123 -fmodules-cache-path=DIR/cache -include DIR/header.h 
-grecord-command-line -fdebug-compilation-dir=DIR/debug 
-fcoverage-compilation-dir=DIR/coverage -ftest-coverage -o DIR/tu.o 
-serialize-diagnostics DIR/tu.diag -MT tu -MD -MF DIR/tu.d",
+"command": "clang -fsyntax-only DIR/tu.c -fmodules -fimplicit-module-maps 
-fmodules-validate-once-per-build-session 
-fbuild-session-file=DIR/build-session -fmodules-prune-interval=123 
-fmodules-prune-after=123 -fmodules-cache-path=DIR/cache -include DIR/header.h 
-grecord-command-line -fdebug-compilation-dir=DIR/debug 
-fcoverage-compilation-dir=DIR/coverage -ftest-coverage 
-fprofile-instr-use=DIR/tu.profdata -o DIR/tu.o -serialize-diagnostics 
DIR/tu.diag -MT tu -MD -MF DIR/tu.d",
 "file": "DIR/tu.c"
   }
 ]
diff --git a/clang/test/ClangScanDeps/removed-args.c 
b/clang/test/ClangScanDeps/removed-args.c
index 9a4ef25838e465..f49e4ead82f7bf 100644
--- a/clang/test/ClangScanDeps/removed-args.c
+++ b/clang/test/ClangScanDeps/removed-args.c
@@ -9,6 +9,8 @@
 // RUN: rm -rf %t && mkdir %t
 // RUN: cp %S/Inputs/removed-args/* %t
 // RUN: touch %t/build-session
+// RUN: touch %t/tu.proftext
+// RUN: llvm-profdata merge %t/tu.proftext -o %t/tu.profdata
 
 // RUN: sed "s|DIR|%/t|g" %S/Inputs/removed-args/cdb.json.template > 
%t/cdb.json
 // RUN: clang-scan-deps -compilation-database %t/cdb.json -format 
experimental-full > %t/result.json
@@ -25,6 +27,7 @@
 // CHECK-NOT:  "-fcoverage-compilation-dir="
 // CHECK-NOT:  "-coverage-notes-file
 // CHECK-NOT:  "-coverage-data-file
+// CHECK-NOT:  "-fprofile-instrument-use-path
 // CHECK-NOT:  "-dwarf-debug-flags"
 // CHECK-NOT:  "-main-file-name"
 // CHECK-NOT:  "-include"
@@ -50,6 +53,7 @@
 // CHECK-NOT:  "-fcoverage-compilation-dir=
 // CHECK-NOT:  "-coverage-notes-file
 // CHECK-NOT:  "-coverage-data-file
+// CHECK-NOT:  "-fprofile-instrument-use-path
 // CHECK-NOT:  "-dwarf-debug-flags"
 // CHECK-NOT:  "-main-file-name"
 // CHECK-NOT:  "-include"

``




https://github.com/llvm/llvm-project/pull/87724
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] [clang][deps] Remove pgo profile flags from modules (PR #87724)

2024-04-04 Thread Argyrios Kyrtzidis via cfe-commits

https://github.com/akyrtzi created 
https://github.com/llvm/llvm-project/pull/87724

These are not necessary when not performing codegen.

>From 4a2b299e264ce2833786ab035cbb0938284c73ac Mon Sep 17 00:00:00 2001
From: Argyrios Kyrtzidis 
Date: Thu, 4 Apr 2024 15:57:28 -0700
Subject: [PATCH] [clang][deps] Remove pgo profile flags from modules

These are not necessary when not performing codegen.
---
 clang/lib/Tooling/DependencyScanning/ModuleDepCollector.cpp   | 3 +++
 .../test/ClangScanDeps/Inputs/removed-args/cdb.json.template  | 2 +-
 clang/test/ClangScanDeps/removed-args.c   | 4 
 3 files changed, 8 insertions(+), 1 deletion(-)

diff --git a/clang/lib/Tooling/DependencyScanning/ModuleDepCollector.cpp 
b/clang/lib/Tooling/DependencyScanning/ModuleDepCollector.cpp
index eb5c50c35428fe..94ccbd3351b09d 100644
--- a/clang/lib/Tooling/DependencyScanning/ModuleDepCollector.cpp
+++ b/clang/lib/Tooling/DependencyScanning/ModuleDepCollector.cpp
@@ -175,6 +175,9 @@ makeCommonInvocationForModuleBuild(CompilerInvocation CI) {
 CI.getCodeGenOpts().CoverageCompilationDir.clear();
 CI.getCodeGenOpts().CoverageDataFile.clear();
 CI.getCodeGenOpts().CoverageNotesFile.clear();
+CI.getCodeGenOpts().ProfileInstrumentUsePath.clear();
+CI.getCodeGenOpts().SampleProfileFile.clear();
+CI.getCodeGenOpts().ProfileRemappingFile.clear();
   }
 
   // Map output paths that affect behaviour to "-" so their existence is in the
diff --git a/clang/test/ClangScanDeps/Inputs/removed-args/cdb.json.template 
b/clang/test/ClangScanDeps/Inputs/removed-args/cdb.json.template
index 7ae3c88aedd8d2..ca56799cd08eab 100644
--- a/clang/test/ClangScanDeps/Inputs/removed-args/cdb.json.template
+++ b/clang/test/ClangScanDeps/Inputs/removed-args/cdb.json.template
@@ -1,7 +1,7 @@
 [
   {
 "directory": "DIR",
-"command": "clang -fsyntax-only DIR/tu.c -fmodules -fimplicit-module-maps 
-fmodules-validate-once-per-build-session 
-fbuild-session-file=DIR/build-session -fmodules-prune-interval=123 
-fmodules-prune-after=123 -fmodules-cache-path=DIR/cache -include DIR/header.h 
-grecord-command-line -fdebug-compilation-dir=DIR/debug 
-fcoverage-compilation-dir=DIR/coverage -ftest-coverage -o DIR/tu.o 
-serialize-diagnostics DIR/tu.diag -MT tu -MD -MF DIR/tu.d",
+"command": "clang -fsyntax-only DIR/tu.c -fmodules -fimplicit-module-maps 
-fmodules-validate-once-per-build-session 
-fbuild-session-file=DIR/build-session -fmodules-prune-interval=123 
-fmodules-prune-after=123 -fmodules-cache-path=DIR/cache -include DIR/header.h 
-grecord-command-line -fdebug-compilation-dir=DIR/debug 
-fcoverage-compilation-dir=DIR/coverage -ftest-coverage 
-fprofile-instr-use=DIR/tu.profdata -o DIR/tu.o -serialize-diagnostics 
DIR/tu.diag -MT tu -MD -MF DIR/tu.d",
 "file": "DIR/tu.c"
   }
 ]
diff --git a/clang/test/ClangScanDeps/removed-args.c 
b/clang/test/ClangScanDeps/removed-args.c
index 9a4ef25838e465..f49e4ead82f7bf 100644
--- a/clang/test/ClangScanDeps/removed-args.c
+++ b/clang/test/ClangScanDeps/removed-args.c
@@ -9,6 +9,8 @@
 // RUN: rm -rf %t && mkdir %t
 // RUN: cp %S/Inputs/removed-args/* %t
 // RUN: touch %t/build-session
+// RUN: touch %t/tu.proftext
+// RUN: llvm-profdata merge %t/tu.proftext -o %t/tu.profdata
 
 // RUN: sed "s|DIR|%/t|g" %S/Inputs/removed-args/cdb.json.template > 
%t/cdb.json
 // RUN: clang-scan-deps -compilation-database %t/cdb.json -format 
experimental-full > %t/result.json
@@ -25,6 +27,7 @@
 // CHECK-NOT:  "-fcoverage-compilation-dir="
 // CHECK-NOT:  "-coverage-notes-file
 // CHECK-NOT:  "-coverage-data-file
+// CHECK-NOT:  "-fprofile-instrument-use-path
 // CHECK-NOT:  "-dwarf-debug-flags"
 // CHECK-NOT:  "-main-file-name"
 // CHECK-NOT:  "-include"
@@ -50,6 +53,7 @@
 // CHECK-NOT:  "-fcoverage-compilation-dir=
 // CHECK-NOT:  "-coverage-notes-file
 // CHECK-NOT:  "-coverage-data-file
+// CHECK-NOT:  "-fprofile-instrument-use-path
 // CHECK-NOT:  "-dwarf-debug-flags"
 // CHECK-NOT:  "-main-file-name"
 // CHECK-NOT:  "-include"

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits