[llvm] [SHT_LLVM_BB_ADDR_MAP][AsmPrinter] Implements PGOAnalysisMap emitting in AsmPrinter with tests. (PR #75202)

Rahman Lavaee via llvm-commits llvm-commits at lists.llvm.org
Tue Dec 19 13:22:56 PST 2023


================
@@ -1932,8 +2000,15 @@ void AsmPrinter::emitFunctionBody() {
 
   // Emit section containing BB address offsets and their metadata, when
   // BB labels are requested for this function. Skip empty functions.
-  if (MF->hasBBLabels() && HasAnyRealCode)
+  bool HasBBLabels = MF->hasBBLabels();
+  if (HasBBLabels && HasAnyRealCode)
----------------
rlavaee wrote:

This is equivalent to:
```
if (HasAnyRealCode) {
  if (MF->hasBBLabels())
    emitBBAddrMapSection(*MF)
  else if (PgoAnalysisMapFeatures.getBits() != 0)
    \\ report warning
 }
```

https://github.com/llvm/llvm-project/pull/75202


More information about the llvm-commits mailing list