[PATCH] D127464: [BOLT] Mark fragments related to split jump table as non-simple
Amir Ayupov via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Fri Jun 10 15:49:45 PDT 2022
This revision was automatically updated to reflect the committed changes.
Closed by commit rG82095bd5ed50: [BOLT] Mark fragments related to split jump table as non-simple (authored by nhuhuan, committed by Amir).
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D127464/new/
https://reviews.llvm.org/D127464
Files:
bolt/lib/Core/BinaryContext.cpp
bolt/lib/Rewrite/RewriteInstance.cpp
bolt/test/X86/split-func-icf.s
Index: bolt/test/X86/split-func-icf.s
===================================================================
--- bolt/test/X86/split-func-icf.s
+++ bolt/test/X86/split-func-icf.s
@@ -8,15 +8,17 @@
# RUN: llvm-mc -filetype=obj -triple x86_64-unknown-unknown %s -o %t.o
# RUN: llvm-strip --strip-unneeded %t.o
# RUN: %clang %cflags %t.o -o %t.exe -Wl,-q
-# RUN: llvm-bolt %t.exe -o %t.out -lite=0 -v=1 2>&1 | FileCheck %s
+# RUN: llvm-bolt %t.exe -o %t.out -v=1 --print-only=main2.cold.1 --print-disasm 2>&1 | FileCheck %s
# CHECK-NOT: unclaimed PC-relative relocations left in data
# CHECK-DAG: BOLT-INFO: marking main2.cold.1(*2) as a fragment of main
# CHECK-DAG: BOLT-INFO: marking main2.cold.1(*2) as a fragment of main2
+# CHECK: Binary Function "main2.cold.1(*2)" after disassembly
+# CHECK: End of Function "main2.cold.1(*2)"
# CHECK-DAG: BOLT-WARNING: Ignoring main2
# CHECK-DAG: BOLT-WARNING: Ignoring main
# CHECK-DAG: BOLT-WARNING: Ignoring main2.cold.1(*2)
-# CHECK: BOLT-WARNING: ignored 3 functions due to cold fragments
+# CHECK: BOLT-WARNING: skipped 3 functions due to cold fragments
.text
.globl main
.type main, %function
Index: bolt/lib/Rewrite/RewriteInstance.cpp
===================================================================
--- bolt/lib/Rewrite/RewriteInstance.cpp
+++ bolt/lib/Rewrite/RewriteInstance.cpp
@@ -2925,7 +2925,8 @@
continue;
if (!Function.isSimple()) {
- assert((!BC->HasRelocations || Function.getSize() == 0) &&
+ assert((!BC->HasRelocations || Function.getSize() == 0 ||
+ Function.hasSplitJumpTable()) &&
"unexpected non-simple function in relocation mode");
continue;
}
Index: bolt/lib/Core/BinaryContext.cpp
===================================================================
--- bolt/lib/Core/BinaryContext.cpp
+++ bolt/lib/Core/BinaryContext.cpp
@@ -715,13 +715,15 @@
"internal error in traversing function fragments");
if (opts::Verbosity >= 1)
errs() << "BOLT-WARNING: Ignoring " << BF->getPrintName() << '\n';
- BF->setIgnored();
+ BF->setSimple(false);
+ BF->setHasSplitJumpTable(true);
+
std::for_each(BF->Fragments.begin(), BF->Fragments.end(), addToWorklist);
std::for_each(BF->ParentFragments.begin(), BF->ParentFragments.end(),
addToWorklist);
}
if (!FragmentsToSkip.empty())
- errs() << "BOLT-WARNING: ignored " << FragmentsToSkip.size() << " function"
+ errs() << "BOLT-WARNING: skipped " << FragmentsToSkip.size() << " function"
<< (FragmentsToSkip.size() == 1 ? "" : "s")
<< " due to cold fragments\n";
FragmentsToSkip.clear();
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D127464.436064.patch
Type: text/x-patch
Size: 2671 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220610/0289a15e/attachment.bin>
More information about the llvm-commits
mailing list