[clang] [lld] [llvm] Adding Matching and Inference Functionality to Propeller (PR #139008)

2025-05-23 Thread Rahman Lavaee via cfe-commits


@@ -1688,6 +1688,11 @@ def fprofile_sample_accurate : Flag<["-"], 
"fprofile-sample-accurate">,
as cold. Otherwise, treat callsites without profile samples as 
if
we have no profile}]>,
MarshallingInfoFlag>;
+def fpropeller_profile_use_EQ : Joined<["-"], "fpropeller-profile-use=">,
+Group, Visibility<[ClangOption, CC1Option, CLOption]>, 
+MetaVarName<"">,

rlavaee wrote:

We don't need the new flag. The CFG edge profile is already being written to 
the basic-block-sections profile 
(https://github.com/google/llvm-propeller/blob/main/propeller/testdata/sample_verbose_cc_directives.golden.txt),
 as a comment which is [currently 
ignored](https://llvm.org/doxygen/BasicBlockSectionsProfileReader_8h_source.html#l00079)
 by the compiler. We can introduce the CFG profile under a [new 
specifier](https://llvm.org/doxygen/BasicBlockSectionsProfileReader_8cpp_source.html#l00155)

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


[clang] [lld] [llvm] Adding Matching and Inference Functionality to Propeller (PR #139008)

2025-05-23 Thread Sriraman Tallam via cfe-commits


@@ -1688,6 +1688,11 @@ def fprofile_sample_accurate : Flag<["-"], 
"fprofile-sample-accurate">,
as cold. Otherwise, treat callsites without profile samples as 
if
we have no profile}]>,
MarshallingInfoFlag>;
+def fpropeller_profile_use_EQ : Joined<["-"], "fpropeller-profile-use=">,
+Group, Visibility<[ClangOption, CC1Option, CLOption]>, 
+MetaVarName<"">,

tmsri wrote:

So, we want :

1.  Another option to expose raw propeller profiles, MBB hashes and counts to 
the compiler.  
2.  It would be mutually exclusive to -fbasic-block-sections=list options

I want to have a discussion on how much of a maintenance burden this would 
cause.  This is because Propeller will now do code layout in two different 
ways.  With stale profiles, the compiler will do it.   By default, the offline 
tool would do it.  For future optimizations, we need to figure out how to 
support two paths.  @rlavaee @shenhanc78 

Can we expose raw profiles using -fbasic-blocks-sections=list= itself?  Do we 
need a new option?   I like the stale profile matching ideas but I am not sure 
adding a new flag and a new file is the way to go forward.




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


[clang] [lld] [llvm] Adding Matching and Inference Functionality to Propeller (PR #139008)

2025-05-20 Thread James Henderson via cfe-commits

jh7370 wrote:

> > Thanks for the patch. I think this PR should be split up a bit, so that 
> > it's easier to review distinct sections. In particular the areas related to 
> > yaml2obj/obj2yaml, llvm-readobj and llvm-objdump could probably be their 
> > own PR, where we can focus on reviewing how tools read the data.
> 
> Thanks for your advice. We will split the PR into smaller ones. However, 
> modifying the bb_address_map section requires synchronously updating 
> yaml2obj/obj2yaml, llvm-readobj, and llvm-objdump to ensure that the test 
> cases pass. We may not be able to submit separate PRs for yaml2obj/obj2yaml, 
> llvm-readobj, and llvm-objdump.

I meant 1+ PRs that cover those tools. Typically there should be no need for 
both llvm-objdump and llvm-readobj additions in the same PR, so you make 2. 
Similarly ob2yaml (not to be confused with yaml2obj support isn't needed to be 
able to test llvm-readobj/llvm-objdump can read the code, so typically that 
would be its own PR too. That ultimately means you could have three PRs just to 
cover these tools: 1) llvm-readobj + yaml2obj, 2) llvm-objdump, 3) obj2yaml.

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


[clang] [lld] [llvm] Adding Matching and Inference Functionality to Propeller (PR #139008)

2025-05-20 Thread via cfe-commits

github-actions[bot] wrote:




:warning: C/C++ code formatter, clang-format found issues in your code. 
:warning:



You can test this locally with the following command:


``bash
git-clang-format --diff HEAD~1 HEAD --extensions cpp,h -- 
llvm/include/llvm/CodeGen/FuncHotBBHashesProfileReader.h 
llvm/include/llvm/CodeGen/HotMachineBasicBlockInfoGenerator.h 
llvm/include/llvm/CodeGen/MachineBlockHashInfo.h 
llvm/lib/CodeGen/FuncHotBBHashesProfileReader.cpp 
llvm/lib/CodeGen/HotMachineBasicBlockInfoGenerator.cpp 
llvm/lib/CodeGen/MachineBlockHashInfo.cpp 
clang/include/clang/Basic/CodeGenOptions.h clang/lib/CodeGen/BackendUtil.cpp 
clang/lib/Driver/ToolChains/Clang.cpp lld/ELF/Config.h lld/ELF/Driver.cpp 
lld/ELF/LTO.cpp llvm/include/llvm/CodeGen/Passes.h 
llvm/include/llvm/InitializePasses.h llvm/include/llvm/LTO/Config.h 
llvm/include/llvm/Object/ELFTypes.h llvm/include/llvm/ObjectYAML/ELFYAML.h 
llvm/include/llvm/Support/PGOOptions.h 
llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp 
llvm/lib/CodeGen/BasicBlockSections.cpp llvm/lib/CodeGen/CodeGen.cpp 
llvm/lib/CodeGen/TargetPassConfig.cpp llvm/lib/LTO/LTOBackend.cpp 
llvm/lib/Object/ELF.cpp llvm/lib/ObjectYAML/ELFEmitter.cpp 
llvm/lib/ObjectYAML/ELFYAML.cpp llvm/lib/Support/PGOOptions.cpp 
llvm/tools/llvm-readobj/ELFDumper.cpp llvm/tools/obj2yaml/elf2yaml.cpp 
llvm/tools/opt/NewPMDriver.cpp llvm/unittests/Object/ELFObjectFileTest.cpp
``





View the diff from clang-format here.


``diff
diff --git a/clang/lib/CodeGen/BackendUtil.cpp 
b/clang/lib/CodeGen/BackendUtil.cpp
index 4f5f5f677..401c16141 100644
--- a/clang/lib/CodeGen/BackendUtil.cpp
+++ b/clang/lib/CodeGen/BackendUtil.cpp
@@ -836,56 +836,52 @@ void EmitAssemblyHelper::RunOptimizationPipeline(
 
   if (CodeGenOpts.hasProfileIRInstr())
 // -fprofile-generate.
-PGOOpt = PGOOptions(getProfileGenName(CodeGenOpts), "", "",
-CodeGenOpts.MemoryProfileUsePath, 
-CodeGenOpts.PropellerProfileFile, nullptr,
-PGOOptions::IRInstr, PGOOptions::NoCSAction,
-ClPGOColdFuncAttr, CodeGenOpts.DebugInfoForProfiling,
-/*PseudoProbeForProfiling=*/false,
-CodeGenOpts.AtomicProfileUpdate);
+PGOOpt = PGOOptions(
+getProfileGenName(CodeGenOpts), "", "",
+CodeGenOpts.MemoryProfileUsePath, CodeGenOpts.PropellerProfileFile,
+nullptr, PGOOptions::IRInstr, PGOOptions::NoCSAction, 
ClPGOColdFuncAttr,
+CodeGenOpts.DebugInfoForProfiling,
+/*PseudoProbeForProfiling=*/false, CodeGenOpts.AtomicProfileUpdate);
   else if (CodeGenOpts.hasProfileIRUse()) {
 // -fprofile-use.
 auto CSAction = CodeGenOpts.hasProfileCSIRUse() ? PGOOptions::CSIRUse
 : PGOOptions::NoCSAction;
-PGOOpt = PGOOptions(CodeGenOpts.ProfileInstrumentUsePath, "",
-CodeGenOpts.ProfileRemappingFile,
-CodeGenOpts.MemoryProfileUsePath, 
-CodeGenOpts.PropellerProfileFile, VFS,
-PGOOptions::IRUse, CSAction, ClPGOColdFuncAttr,
-CodeGenOpts.DebugInfoForProfiling);
+PGOOpt = PGOOptions(
+CodeGenOpts.ProfileInstrumentUsePath, "",
+CodeGenOpts.ProfileRemappingFile, CodeGenOpts.MemoryProfileUsePath,
+CodeGenOpts.PropellerProfileFile, VFS, PGOOptions::IRUse, CSAction,
+ClPGOColdFuncAttr, CodeGenOpts.DebugInfoForProfiling);
   } else if (!CodeGenOpts.SampleProfileFile.empty())
 // -fprofile-sample-use
 PGOOpt = PGOOptions(
 CodeGenOpts.SampleProfileFile, "", CodeGenOpts.ProfileRemappingFile,
-CodeGenOpts.MemoryProfileUsePath, 
-CodeGenOpts.PropellerProfileFile, VFS, PGOOptions::SampleUse,
-PGOOptions::NoCSAction, ClPGOColdFuncAttr,
+CodeGenOpts.MemoryProfileUsePath, CodeGenOpts.PropellerProfileFile, 
VFS,
+PGOOptions::SampleUse, PGOOptions::NoCSAction, ClPGOColdFuncAttr,
 CodeGenOpts.DebugInfoForProfiling, 
CodeGenOpts.PseudoProbeForProfiling);
   else if (!CodeGenOpts.MemoryProfileUsePath.empty())
 // -fmemory-profile-use (without any of the above options)
-PGOOpt = PGOOptions("", "", "", CodeGenOpts.MemoryProfileUsePath, 
+PGOOpt = PGOOptions("", "", "", CodeGenOpts.MemoryProfileUsePath,
 CodeGenOpts.PropellerProfileFile, VFS,
 PGOOptions::NoAction, PGOOptions::NoCSAction,
 ClPGOColdFuncAttr, CodeGenOpts.DebugInfoForProfiling);
   else if (!CodeGenOpts.PropellerProfileFile.empty())
 // -fpropeller-profile-use (without any of the above options)
-PGOOpt = PGOOptions("", "", "", "", 
-CodeGenOpts.PropellerProfileFile, VFS,
+PGOOpt = PGOOptions("", "", "", "", CodeGenOpts.PropellerProfileFile, VFS,
 PGOOptions::NoAction, PGOOptions::NoCSAction,
- 

[clang] [lld] [llvm] Adding Matching and Inference Functionality to Propeller (PR #139008)

2025-05-20 Thread via cfe-commits

github-actions[bot] wrote:

⚠️ We detected that you are using a GitHub private e-mail address to contribute 
to the repo. Please turn off [Keep my email addresses 
private](https://github.com/settings/emails) setting in your account. See 
[LLVM 
Discourse](https://discourse.llvm.org/t/hidden-emails-on-github-should-we-do-something-about-it)
 for more information.

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


[clang] [lld] [llvm] Adding Matching and Inference Functionality to Propeller (PR #139008)

2025-05-20 Thread via cfe-commits

wdx727 wrote:

> Thanks for the patch. I think this PR should be split up a bit, so that it's 
> easier to review distinct sections. In particular the areas related to 
> yaml2obj/obj2yaml, llvm-readobj and llvm-objdump could probably be their own 
> PR, where we can focus on reviewing how tools read the data.

Thanks for your advice. We will split the PR into smaller ones. However, 
modifying the bb_address_map section requires synchronously updating 
yaml2obj/obj2yaml, llvm-readobj, and llvm-objdump to ensure that the test cases 
pass. We may not be able to submit separate PRs for yaml2obj/obj2yaml, 
llvm-readobj, and llvm-objdump.

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


[clang] [lld] [llvm] Adding Matching and Inference Functionality to Propeller (PR #139008)

2025-05-07 Thread James Henderson via cfe-commits

https://github.com/jh7370 commented:

Thanks for the patch. I think this PR should be split up a bit, so that it's 
easier to review distinct sections. In particular the areas related to 
yaml2obj/obj2yaml, llvm-readobj and llvm-objdump could probably be their own 
PR, where we can focus on reviewing how tools read the data.

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


[clang] [lld] [llvm] Adding Matching and Inference Functionality to Propeller (PR #139008)

2025-05-07 Thread via cfe-commits

llvmbot wrote:



@llvm/pr-subscribers-llvm-binary-utilities
@llvm/pr-subscribers-objectyaml

@llvm/pr-subscribers-backend-aarch64

Author: None (wdx727)


Changes

We would like to add the matching and inference functionality to Propeller to 
address the issue that Propeller has zero tolerance for changes in source code 
and compilation parameters. The complete RFC can be found at the following URL: 
https://discourse.llvm.org/t/rfc-adding-matching-and-inference-functionality-to-propeller/86238/1.

---

Patch is 110.85 KiB, truncated to 20.00 KiB below, full version: 
https://github.com/llvm/llvm-project/pull/139008.diff


53 Files Affected:

- (modified) clang/include/clang/Basic/CodeGenOptions.h (+3) 
- (modified) clang/include/clang/Driver/Options.td (+5) 
- (modified) clang/lib/CodeGen/BackendUtil.cpp (+21-7) 
- (modified) clang/lib/Driver/ToolChains/Clang.cpp (+12) 
- (modified) lld/ELF/Config.h (+1) 
- (modified) lld/ELF/Driver.cpp (+77) 
- (modified) lld/ELF/LTO.cpp (+1) 
- (modified) lld/ELF/Options.td (+3) 
- (added) llvm/include/llvm/CodeGen/FuncHotBBHashesProfileReader.h (+64) 
- (added) llvm/include/llvm/CodeGen/HotMachineBasicBlockInfoGenerator.h (+51) 
- (added) llvm/include/llvm/CodeGen/MachineBlockHashInfo.h (+108) 
- (modified) llvm/include/llvm/CodeGen/Passes.h (+4) 
- (modified) llvm/include/llvm/InitializePasses.h (+3) 
- (modified) llvm/include/llvm/LTO/Config.h (+3) 
- (modified) llvm/include/llvm/Object/ELFTypes.h (+3-2) 
- (modified) llvm/include/llvm/ObjectYAML/ELFYAML.h (+1) 
- (modified) llvm/include/llvm/Support/PGOOptions.h (+2) 
- (modified) llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp (+6) 
- (modified) llvm/lib/CodeGen/BasicBlockSections.cpp (+43-4) 
- (modified) llvm/lib/CodeGen/CMakeLists.txt (+3) 
- (modified) llvm/lib/CodeGen/CodeGen.cpp (+3) 
- (added) llvm/lib/CodeGen/FuncHotBBHashesProfileReader.cpp (+123) 
- (added) llvm/lib/CodeGen/HotMachineBasicBlockInfoGenerator.cpp (+202) 
- (added) llvm/lib/CodeGen/MachineBlockHashInfo.cpp (+104) 
- (modified) llvm/lib/CodeGen/TargetPassConfig.cpp (+12-1) 
- (modified) llvm/lib/LTO/LTOBackend.cpp (+15-9) 
- (modified) llvm/lib/Object/ELF.cpp (+2-1) 
- (modified) llvm/lib/ObjectYAML/ELFEmitter.cpp (+1) 
- (modified) llvm/lib/ObjectYAML/ELFYAML.cpp (+1) 
- (modified) llvm/lib/Support/PGOOptions.cpp (+6-4) 
- (modified) llvm/test/CodeGen/AArch64/O0-pipeline.ll (+1) 
- (modified) llvm/test/CodeGen/AArch64/O3-pipeline.ll (+1) 
- (modified) llvm/test/CodeGen/AArch64/arm64-opt-remarks-lazy-bfi.ll (+2) 
- (modified) llvm/test/CodeGen/X86/O0-pipeline.ll (+1) 
- (modified) llvm/test/CodeGen/X86/basic-block-address-map-pgo-features.ll (+6) 
- (modified) 
llvm/test/CodeGen/X86/basic-block-address-map-with-basic-block-sections.ll 
(+4-1) 
- (modified) llvm/test/CodeGen/X86/basic-block-address-map-with-mfs.ll (+3) 
- (modified) llvm/test/CodeGen/X86/basic-block-address-map.ll (+7-1) 
- (modified) llvm/test/CodeGen/X86/opt-pipeline.ll (+1) 
- (modified) 
llvm/test/tools/llvm-objdump/X86/elf-bbaddrmap-disassemble-symbolize-operands.yaml
 (+18) 
- (modified) 
llvm/test/tools/llvm-objdump/X86/elf-bbaddrmap-symbolize-relocatable.yaml 
(+7-3) 
- (modified) llvm/test/tools/llvm-objdump/X86/elf-pgoanalysismap.yaml (+9) 
- (modified) llvm/test/tools/llvm-readobj/ELF/bb-addr-map-pgo-analysis-map.test 
(+13-3) 
- (modified) llvm/test/tools/llvm-readobj/ELF/bb-addr-map-relocatable.test 
(+10-1) 
- (modified) llvm/test/tools/llvm-readobj/ELF/bb-addr-map.test (+12-2) 
- (modified) llvm/test/tools/obj2yaml/ELF/bb-addr-map-pgo-analysis-map.yaml 
(+10) 
- (modified) llvm/test/tools/obj2yaml/ELF/bb-addr-map.yaml (+10) 
- (modified) llvm/test/tools/yaml2obj/ELF/bb-addr-map-pgo-analysis-map.yaml 
(+6-3) 
- (modified) llvm/test/tools/yaml2obj/ELF/bb-addr-map.yaml (+6-3) 
- (modified) llvm/tools/llvm-readobj/ELFDumper.cpp (+1) 
- (modified) llvm/tools/obj2yaml/elf2yaml.cpp (+2-1) 
- (modified) llvm/tools/opt/NewPMDriver.cpp (+15-8) 
- (modified) llvm/unittests/Object/ELFObjectFileTest.cpp (+58-29) 


``diff
diff --git a/clang/include/clang/Basic/CodeGenOptions.h 
b/clang/include/clang/Basic/CodeGenOptions.h
index e3fa6a55e7608..46ea2ba3a4c56 100644
--- a/clang/include/clang/Basic/CodeGenOptions.h
+++ b/clang/include/clang/Basic/CodeGenOptions.h
@@ -288,6 +288,9 @@ class CodeGenOptions : public CodeGenOptionsBase {
   /// Name of the profile file to use with -fprofile-sample-use.
   std::string SampleProfileFile;
 
+  /// Name of the profile file to use with -fpropeller-profile-use.
+  std::string PropellerProfileFile;
+
   /// Name of the profile file to use as output for with -fmemory-profile.
   std::string MemoryProfileOutput;
 
diff --git a/clang/include/clang/Driver/Options.td 
b/clang/include/clang/Driver/Options.td
index 351e1ad4e1b03..add5ecc506fa1 100644
--- a/clang/include/clang/Driver/Options.td
+++ b/clang/include/clang/Driver/Options.td
@@ -1688,6 +1688,11 @@ def fprofile_sample_accurate : Flag<["-"], 
"fprofile-sample-accurate">,
   

[clang] [lld] [llvm] Adding Matching and Inference Functionality to Propeller (PR #139008)

2025-05-07 Thread via cfe-commits

llvmbot wrote:




@llvm/pr-subscribers-clang-codegen

Author: None (wdx727)


Changes

We would like to add the matching and inference functionality to Propeller to 
address the issue that Propeller has zero tolerance for changes in source code 
and compilation parameters. The complete RFC can be found at the following URL: 
https://discourse.llvm.org/t/rfc-adding-matching-and-inference-functionality-to-propeller/86238/1.

---

Patch is 110.85 KiB, truncated to 20.00 KiB below, full version: 
https://github.com/llvm/llvm-project/pull/139008.diff


53 Files Affected:

- (modified) clang/include/clang/Basic/CodeGenOptions.h (+3) 
- (modified) clang/include/clang/Driver/Options.td (+5) 
- (modified) clang/lib/CodeGen/BackendUtil.cpp (+21-7) 
- (modified) clang/lib/Driver/ToolChains/Clang.cpp (+12) 
- (modified) lld/ELF/Config.h (+1) 
- (modified) lld/ELF/Driver.cpp (+77) 
- (modified) lld/ELF/LTO.cpp (+1) 
- (modified) lld/ELF/Options.td (+3) 
- (added) llvm/include/llvm/CodeGen/FuncHotBBHashesProfileReader.h (+64) 
- (added) llvm/include/llvm/CodeGen/HotMachineBasicBlockInfoGenerator.h (+51) 
- (added) llvm/include/llvm/CodeGen/MachineBlockHashInfo.h (+108) 
- (modified) llvm/include/llvm/CodeGen/Passes.h (+4) 
- (modified) llvm/include/llvm/InitializePasses.h (+3) 
- (modified) llvm/include/llvm/LTO/Config.h (+3) 
- (modified) llvm/include/llvm/Object/ELFTypes.h (+3-2) 
- (modified) llvm/include/llvm/ObjectYAML/ELFYAML.h (+1) 
- (modified) llvm/include/llvm/Support/PGOOptions.h (+2) 
- (modified) llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp (+6) 
- (modified) llvm/lib/CodeGen/BasicBlockSections.cpp (+43-4) 
- (modified) llvm/lib/CodeGen/CMakeLists.txt (+3) 
- (modified) llvm/lib/CodeGen/CodeGen.cpp (+3) 
- (added) llvm/lib/CodeGen/FuncHotBBHashesProfileReader.cpp (+123) 
- (added) llvm/lib/CodeGen/HotMachineBasicBlockInfoGenerator.cpp (+202) 
- (added) llvm/lib/CodeGen/MachineBlockHashInfo.cpp (+104) 
- (modified) llvm/lib/CodeGen/TargetPassConfig.cpp (+12-1) 
- (modified) llvm/lib/LTO/LTOBackend.cpp (+15-9) 
- (modified) llvm/lib/Object/ELF.cpp (+2-1) 
- (modified) llvm/lib/ObjectYAML/ELFEmitter.cpp (+1) 
- (modified) llvm/lib/ObjectYAML/ELFYAML.cpp (+1) 
- (modified) llvm/lib/Support/PGOOptions.cpp (+6-4) 
- (modified) llvm/test/CodeGen/AArch64/O0-pipeline.ll (+1) 
- (modified) llvm/test/CodeGen/AArch64/O3-pipeline.ll (+1) 
- (modified) llvm/test/CodeGen/AArch64/arm64-opt-remarks-lazy-bfi.ll (+2) 
- (modified) llvm/test/CodeGen/X86/O0-pipeline.ll (+1) 
- (modified) llvm/test/CodeGen/X86/basic-block-address-map-pgo-features.ll (+6) 
- (modified) 
llvm/test/CodeGen/X86/basic-block-address-map-with-basic-block-sections.ll 
(+4-1) 
- (modified) llvm/test/CodeGen/X86/basic-block-address-map-with-mfs.ll (+3) 
- (modified) llvm/test/CodeGen/X86/basic-block-address-map.ll (+7-1) 
- (modified) llvm/test/CodeGen/X86/opt-pipeline.ll (+1) 
- (modified) 
llvm/test/tools/llvm-objdump/X86/elf-bbaddrmap-disassemble-symbolize-operands.yaml
 (+18) 
- (modified) 
llvm/test/tools/llvm-objdump/X86/elf-bbaddrmap-symbolize-relocatable.yaml 
(+7-3) 
- (modified) llvm/test/tools/llvm-objdump/X86/elf-pgoanalysismap.yaml (+9) 
- (modified) llvm/test/tools/llvm-readobj/ELF/bb-addr-map-pgo-analysis-map.test 
(+13-3) 
- (modified) llvm/test/tools/llvm-readobj/ELF/bb-addr-map-relocatable.test 
(+10-1) 
- (modified) llvm/test/tools/llvm-readobj/ELF/bb-addr-map.test (+12-2) 
- (modified) llvm/test/tools/obj2yaml/ELF/bb-addr-map-pgo-analysis-map.yaml 
(+10) 
- (modified) llvm/test/tools/obj2yaml/ELF/bb-addr-map.yaml (+10) 
- (modified) llvm/test/tools/yaml2obj/ELF/bb-addr-map-pgo-analysis-map.yaml 
(+6-3) 
- (modified) llvm/test/tools/yaml2obj/ELF/bb-addr-map.yaml (+6-3) 
- (modified) llvm/tools/llvm-readobj/ELFDumper.cpp (+1) 
- (modified) llvm/tools/obj2yaml/elf2yaml.cpp (+2-1) 
- (modified) llvm/tools/opt/NewPMDriver.cpp (+15-8) 
- (modified) llvm/unittests/Object/ELFObjectFileTest.cpp (+58-29) 


``diff
diff --git a/clang/include/clang/Basic/CodeGenOptions.h 
b/clang/include/clang/Basic/CodeGenOptions.h
index e3fa6a55e7608..46ea2ba3a4c56 100644
--- a/clang/include/clang/Basic/CodeGenOptions.h
+++ b/clang/include/clang/Basic/CodeGenOptions.h
@@ -288,6 +288,9 @@ class CodeGenOptions : public CodeGenOptionsBase {
   /// Name of the profile file to use with -fprofile-sample-use.
   std::string SampleProfileFile;
 
+  /// Name of the profile file to use with -fpropeller-profile-use.
+  std::string PropellerProfileFile;
+
   /// Name of the profile file to use as output for with -fmemory-profile.
   std::string MemoryProfileOutput;
 
diff --git a/clang/include/clang/Driver/Options.td 
b/clang/include/clang/Driver/Options.td
index 351e1ad4e1b03..add5ecc506fa1 100644
--- a/clang/include/clang/Driver/Options.td
+++ b/clang/include/clang/Driver/Options.td
@@ -1688,6 +1688,11 @@ def fprofile_sample_accurate : Flag<["-"], 
"fprofile-sample-accurate">,
as cold. Otherwise, treat callsites without profile samples as 
if
 

[clang] [lld] [llvm] Adding Matching and Inference Functionality to Propeller (PR #139008)

2025-05-07 Thread via cfe-commits

llvmbot wrote:




@llvm/pr-subscribers-lld-elf

Author: None (wdx727)


Changes

We would like to add the matching and inference functionality to Propeller to 
address the issue that Propeller has zero tolerance for changes in source code 
and compilation parameters. The complete RFC can be found at the following URL: 
https://discourse.llvm.org/t/rfc-adding-matching-and-inference-functionality-to-propeller/86238/1.

---

Patch is 110.85 KiB, truncated to 20.00 KiB below, full version: 
https://github.com/llvm/llvm-project/pull/139008.diff


53 Files Affected:

- (modified) clang/include/clang/Basic/CodeGenOptions.h (+3) 
- (modified) clang/include/clang/Driver/Options.td (+5) 
- (modified) clang/lib/CodeGen/BackendUtil.cpp (+21-7) 
- (modified) clang/lib/Driver/ToolChains/Clang.cpp (+12) 
- (modified) lld/ELF/Config.h (+1) 
- (modified) lld/ELF/Driver.cpp (+77) 
- (modified) lld/ELF/LTO.cpp (+1) 
- (modified) lld/ELF/Options.td (+3) 
- (added) llvm/include/llvm/CodeGen/FuncHotBBHashesProfileReader.h (+64) 
- (added) llvm/include/llvm/CodeGen/HotMachineBasicBlockInfoGenerator.h (+51) 
- (added) llvm/include/llvm/CodeGen/MachineBlockHashInfo.h (+108) 
- (modified) llvm/include/llvm/CodeGen/Passes.h (+4) 
- (modified) llvm/include/llvm/InitializePasses.h (+3) 
- (modified) llvm/include/llvm/LTO/Config.h (+3) 
- (modified) llvm/include/llvm/Object/ELFTypes.h (+3-2) 
- (modified) llvm/include/llvm/ObjectYAML/ELFYAML.h (+1) 
- (modified) llvm/include/llvm/Support/PGOOptions.h (+2) 
- (modified) llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp (+6) 
- (modified) llvm/lib/CodeGen/BasicBlockSections.cpp (+43-4) 
- (modified) llvm/lib/CodeGen/CMakeLists.txt (+3) 
- (modified) llvm/lib/CodeGen/CodeGen.cpp (+3) 
- (added) llvm/lib/CodeGen/FuncHotBBHashesProfileReader.cpp (+123) 
- (added) llvm/lib/CodeGen/HotMachineBasicBlockInfoGenerator.cpp (+202) 
- (added) llvm/lib/CodeGen/MachineBlockHashInfo.cpp (+104) 
- (modified) llvm/lib/CodeGen/TargetPassConfig.cpp (+12-1) 
- (modified) llvm/lib/LTO/LTOBackend.cpp (+15-9) 
- (modified) llvm/lib/Object/ELF.cpp (+2-1) 
- (modified) llvm/lib/ObjectYAML/ELFEmitter.cpp (+1) 
- (modified) llvm/lib/ObjectYAML/ELFYAML.cpp (+1) 
- (modified) llvm/lib/Support/PGOOptions.cpp (+6-4) 
- (modified) llvm/test/CodeGen/AArch64/O0-pipeline.ll (+1) 
- (modified) llvm/test/CodeGen/AArch64/O3-pipeline.ll (+1) 
- (modified) llvm/test/CodeGen/AArch64/arm64-opt-remarks-lazy-bfi.ll (+2) 
- (modified) llvm/test/CodeGen/X86/O0-pipeline.ll (+1) 
- (modified) llvm/test/CodeGen/X86/basic-block-address-map-pgo-features.ll (+6) 
- (modified) 
llvm/test/CodeGen/X86/basic-block-address-map-with-basic-block-sections.ll 
(+4-1) 
- (modified) llvm/test/CodeGen/X86/basic-block-address-map-with-mfs.ll (+3) 
- (modified) llvm/test/CodeGen/X86/basic-block-address-map.ll (+7-1) 
- (modified) llvm/test/CodeGen/X86/opt-pipeline.ll (+1) 
- (modified) 
llvm/test/tools/llvm-objdump/X86/elf-bbaddrmap-disassemble-symbolize-operands.yaml
 (+18) 
- (modified) 
llvm/test/tools/llvm-objdump/X86/elf-bbaddrmap-symbolize-relocatable.yaml 
(+7-3) 
- (modified) llvm/test/tools/llvm-objdump/X86/elf-pgoanalysismap.yaml (+9) 
- (modified) llvm/test/tools/llvm-readobj/ELF/bb-addr-map-pgo-analysis-map.test 
(+13-3) 
- (modified) llvm/test/tools/llvm-readobj/ELF/bb-addr-map-relocatable.test 
(+10-1) 
- (modified) llvm/test/tools/llvm-readobj/ELF/bb-addr-map.test (+12-2) 
- (modified) llvm/test/tools/obj2yaml/ELF/bb-addr-map-pgo-analysis-map.yaml 
(+10) 
- (modified) llvm/test/tools/obj2yaml/ELF/bb-addr-map.yaml (+10) 
- (modified) llvm/test/tools/yaml2obj/ELF/bb-addr-map-pgo-analysis-map.yaml 
(+6-3) 
- (modified) llvm/test/tools/yaml2obj/ELF/bb-addr-map.yaml (+6-3) 
- (modified) llvm/tools/llvm-readobj/ELFDumper.cpp (+1) 
- (modified) llvm/tools/obj2yaml/elf2yaml.cpp (+2-1) 
- (modified) llvm/tools/opt/NewPMDriver.cpp (+15-8) 
- (modified) llvm/unittests/Object/ELFObjectFileTest.cpp (+58-29) 


``diff
diff --git a/clang/include/clang/Basic/CodeGenOptions.h 
b/clang/include/clang/Basic/CodeGenOptions.h
index e3fa6a55e7608..46ea2ba3a4c56 100644
--- a/clang/include/clang/Basic/CodeGenOptions.h
+++ b/clang/include/clang/Basic/CodeGenOptions.h
@@ -288,6 +288,9 @@ class CodeGenOptions : public CodeGenOptionsBase {
   /// Name of the profile file to use with -fprofile-sample-use.
   std::string SampleProfileFile;
 
+  /// Name of the profile file to use with -fpropeller-profile-use.
+  std::string PropellerProfileFile;
+
   /// Name of the profile file to use as output for with -fmemory-profile.
   std::string MemoryProfileOutput;
 
diff --git a/clang/include/clang/Driver/Options.td 
b/clang/include/clang/Driver/Options.td
index 351e1ad4e1b03..add5ecc506fa1 100644
--- a/clang/include/clang/Driver/Options.td
+++ b/clang/include/clang/Driver/Options.td
@@ -1688,6 +1688,11 @@ def fprofile_sample_accurate : Flag<["-"], 
"fprofile-sample-accurate">,
as cold. Otherwise, treat callsites without profile samples as 
if
   

[clang] [lld] [llvm] Adding Matching and Inference Functionality to Propeller (PR #139008)

2025-05-07 Thread via cfe-commits

llvmbot wrote:




@llvm/pr-subscribers-backend-x86

Author: None (wdx727)


Changes

We would like to add the matching and inference functionality to Propeller to 
address the issue that Propeller has zero tolerance for changes in source code 
and compilation parameters. The complete RFC can be found at the following URL: 
https://discourse.llvm.org/t/rfc-adding-matching-and-inference-functionality-to-propeller/86238/1.

---

Patch is 110.85 KiB, truncated to 20.00 KiB below, full version: 
https://github.com/llvm/llvm-project/pull/139008.diff


53 Files Affected:

- (modified) clang/include/clang/Basic/CodeGenOptions.h (+3) 
- (modified) clang/include/clang/Driver/Options.td (+5) 
- (modified) clang/lib/CodeGen/BackendUtil.cpp (+21-7) 
- (modified) clang/lib/Driver/ToolChains/Clang.cpp (+12) 
- (modified) lld/ELF/Config.h (+1) 
- (modified) lld/ELF/Driver.cpp (+77) 
- (modified) lld/ELF/LTO.cpp (+1) 
- (modified) lld/ELF/Options.td (+3) 
- (added) llvm/include/llvm/CodeGen/FuncHotBBHashesProfileReader.h (+64) 
- (added) llvm/include/llvm/CodeGen/HotMachineBasicBlockInfoGenerator.h (+51) 
- (added) llvm/include/llvm/CodeGen/MachineBlockHashInfo.h (+108) 
- (modified) llvm/include/llvm/CodeGen/Passes.h (+4) 
- (modified) llvm/include/llvm/InitializePasses.h (+3) 
- (modified) llvm/include/llvm/LTO/Config.h (+3) 
- (modified) llvm/include/llvm/Object/ELFTypes.h (+3-2) 
- (modified) llvm/include/llvm/ObjectYAML/ELFYAML.h (+1) 
- (modified) llvm/include/llvm/Support/PGOOptions.h (+2) 
- (modified) llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp (+6) 
- (modified) llvm/lib/CodeGen/BasicBlockSections.cpp (+43-4) 
- (modified) llvm/lib/CodeGen/CMakeLists.txt (+3) 
- (modified) llvm/lib/CodeGen/CodeGen.cpp (+3) 
- (added) llvm/lib/CodeGen/FuncHotBBHashesProfileReader.cpp (+123) 
- (added) llvm/lib/CodeGen/HotMachineBasicBlockInfoGenerator.cpp (+202) 
- (added) llvm/lib/CodeGen/MachineBlockHashInfo.cpp (+104) 
- (modified) llvm/lib/CodeGen/TargetPassConfig.cpp (+12-1) 
- (modified) llvm/lib/LTO/LTOBackend.cpp (+15-9) 
- (modified) llvm/lib/Object/ELF.cpp (+2-1) 
- (modified) llvm/lib/ObjectYAML/ELFEmitter.cpp (+1) 
- (modified) llvm/lib/ObjectYAML/ELFYAML.cpp (+1) 
- (modified) llvm/lib/Support/PGOOptions.cpp (+6-4) 
- (modified) llvm/test/CodeGen/AArch64/O0-pipeline.ll (+1) 
- (modified) llvm/test/CodeGen/AArch64/O3-pipeline.ll (+1) 
- (modified) llvm/test/CodeGen/AArch64/arm64-opt-remarks-lazy-bfi.ll (+2) 
- (modified) llvm/test/CodeGen/X86/O0-pipeline.ll (+1) 
- (modified) llvm/test/CodeGen/X86/basic-block-address-map-pgo-features.ll (+6) 
- (modified) 
llvm/test/CodeGen/X86/basic-block-address-map-with-basic-block-sections.ll 
(+4-1) 
- (modified) llvm/test/CodeGen/X86/basic-block-address-map-with-mfs.ll (+3) 
- (modified) llvm/test/CodeGen/X86/basic-block-address-map.ll (+7-1) 
- (modified) llvm/test/CodeGen/X86/opt-pipeline.ll (+1) 
- (modified) 
llvm/test/tools/llvm-objdump/X86/elf-bbaddrmap-disassemble-symbolize-operands.yaml
 (+18) 
- (modified) 
llvm/test/tools/llvm-objdump/X86/elf-bbaddrmap-symbolize-relocatable.yaml 
(+7-3) 
- (modified) llvm/test/tools/llvm-objdump/X86/elf-pgoanalysismap.yaml (+9) 
- (modified) llvm/test/tools/llvm-readobj/ELF/bb-addr-map-pgo-analysis-map.test 
(+13-3) 
- (modified) llvm/test/tools/llvm-readobj/ELF/bb-addr-map-relocatable.test 
(+10-1) 
- (modified) llvm/test/tools/llvm-readobj/ELF/bb-addr-map.test (+12-2) 
- (modified) llvm/test/tools/obj2yaml/ELF/bb-addr-map-pgo-analysis-map.yaml 
(+10) 
- (modified) llvm/test/tools/obj2yaml/ELF/bb-addr-map.yaml (+10) 
- (modified) llvm/test/tools/yaml2obj/ELF/bb-addr-map-pgo-analysis-map.yaml 
(+6-3) 
- (modified) llvm/test/tools/yaml2obj/ELF/bb-addr-map.yaml (+6-3) 
- (modified) llvm/tools/llvm-readobj/ELFDumper.cpp (+1) 
- (modified) llvm/tools/obj2yaml/elf2yaml.cpp (+2-1) 
- (modified) llvm/tools/opt/NewPMDriver.cpp (+15-8) 
- (modified) llvm/unittests/Object/ELFObjectFileTest.cpp (+58-29) 


``diff
diff --git a/clang/include/clang/Basic/CodeGenOptions.h 
b/clang/include/clang/Basic/CodeGenOptions.h
index e3fa6a55e7608..46ea2ba3a4c56 100644
--- a/clang/include/clang/Basic/CodeGenOptions.h
+++ b/clang/include/clang/Basic/CodeGenOptions.h
@@ -288,6 +288,9 @@ class CodeGenOptions : public CodeGenOptionsBase {
   /// Name of the profile file to use with -fprofile-sample-use.
   std::string SampleProfileFile;
 
+  /// Name of the profile file to use with -fpropeller-profile-use.
+  std::string PropellerProfileFile;
+
   /// Name of the profile file to use as output for with -fmemory-profile.
   std::string MemoryProfileOutput;
 
diff --git a/clang/include/clang/Driver/Options.td 
b/clang/include/clang/Driver/Options.td
index 351e1ad4e1b03..add5ecc506fa1 100644
--- a/clang/include/clang/Driver/Options.td
+++ b/clang/include/clang/Driver/Options.td
@@ -1688,6 +1688,11 @@ def fprofile_sample_accurate : Flag<["-"], 
"fprofile-sample-accurate">,
as cold. Otherwise, treat callsites without profile samples as 
if
   

[clang] [lld] [llvm] Adding Matching and Inference Functionality to Propeller (PR #139008)

2025-05-07 Thread via cfe-commits

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 is probably because you do not have write 
permissions for the repository. In which case you can instead tag reviewers by 
name in a comment by using `@` followed by their GitHub username.

If you have received no comments on your PR for a week, you can request a 
review by "ping"ing the PR by adding a comment “Ping”. The common courtesy 
"ping" rate is once a week. Please remember that you are asking for valuable 
time from other developers.

If you have further questions, they may be answered by the [LLVM GitHub User 
Guide](https://llvm.org/docs/GitHub.html).

You can also ask questions in a comment on this PR, on the [LLVM 
Discord](https://discord.com/invite/xS7Z362) or on the 
[forums](https://discourse.llvm.org/).

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