[PATCH] D115699: [llvm-profgen] Skip disassembling for PLT section

Lei Wang via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Dec 13 23:00:53 PST 2021


wlei updated this revision to Diff 394150.
wlei added a comment.

remove unrelated test case


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D115699/new/

https://reviews.llvm.org/D115699

Files:
  llvm/test/tools/llvm-profgen/inline-noprobe2.test
  llvm/tools/llvm-profgen/ProfiledBinary.cpp


Index: llvm/tools/llvm-profgen/ProfiledBinary.cpp
===================================================================
--- llvm/tools/llvm-profgen/ProfiledBinary.cpp
+++ llvm/tools/llvm-profgen/ProfiledBinary.cpp
@@ -545,14 +545,18 @@
     // Register the text section.
     TextSections.insert({SectionOffset, SectSize});
 
+    StringRef SectionName = unwrapOrError(Section.getName(), FileName);
+
     if (ShowDisassemblyOnly) {
-      StringRef SectionName = unwrapOrError(Section.getName(), FileName);
       outs() << "\nDisassembly of section " << SectionName;
       outs() << " [" << format("0x%" PRIx64, Section.getAddress()) << ", "
              << format("0x%" PRIx64, Section.getAddress() + SectSize)
              << "]:\n\n";
     }
 
+    if (SectionName == ".plt")
+      continue;
+
     // Get the section data.
     ArrayRef<uint8_t> Bytes =
         arrayRefFromStringRef(unwrapOrError(Section.getContents(), FileName));
Index: llvm/test/tools/llvm-profgen/inline-noprobe2.test
===================================================================
--- llvm/test/tools/llvm-profgen/inline-noprobe2.test
+++ llvm/test/tools/llvm-profgen/inline-noprobe2.test
@@ -8,13 +8,8 @@
 ; RUN: llvm-profgen --format=extbinary --perfscript=%S/Inputs/inline-noprobe2.perfscript --binary=%S/Inputs/inline-noprobe2.perfbin --output=%t --populate-profile-symbol-list=1
 ; RUN: llvm-profdata show -show-prof-sym-list -sample %t | FileCheck %s --check-prefix=CHECK-SYM-LIST
 
-; CHECK-ARTIFICIAL-BRANCH: 3
-; CHECK-ARTIFICIAL-BRANCH: 400540-400540:1
-; CHECK-ARTIFICIAL-BRANCH: 400870-400870:2
-; CHECK-ARTIFICIAL-BRANCH: 400875-4008bf:1
-; CHECK-ARTIFICIAL-BRANCH: 2
-; CHECK-ARTIFICIAL-BRANCH: 400870->400540:2
-; CHECK-ARTIFICIAL-BRANCH: 4008bf->400870:2
+; CHECK-ARTIFICIAL-BRANCH: 0
+; CHECK-ARTIFICIAL-BRANCH: 0
 
 ; CHECK-SYM-LIST: Dump profile symbol list
 ; CHECK-SYM-LIST: main
@@ -78,16 +73,16 @@
 ;CHECK:   1: 5
 ;CHECK:   2: 5
 ;CHECK:   3: 5
-;CHECK: main:820:0
+;CHECK: main:486:0
 ;CHECK:  0: 0
 ;CHECK:  3: 0
 ;CHECK:  4.1: 0
 ;CHECK:  4.3: 0
-;CHECK:  5.1: 10
-;CHECK:  5.3: 10
-;CHECK:  6: 10
-;CHECK:  6.1: 12
-;CHECK:  6.3: 10
+;CHECK:  5.1: 6
+;CHECK:  5.3: 6
+;CHECK:  6: 6
+;CHECK:  6.1: 6
+;CHECK:  6.3: 6
 ;CHECK:  7: 0
 ;CHECK:  8: 0 quick_sort:1
 ;CHECK:  9: 0


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D115699.394150.patch
Type: text/x-patch
Size: 2288 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20211214/d1ff12e7/attachment.bin>


More information about the llvm-commits mailing list