[BOLT] Mark fragments related to split jump table as non-simple
authorHuan Nguyen <nhuhuan@yahoo.com>
Fri, 10 Jun 2022 22:48:13 +0000 (15:48 -0700)
committerAmir Ayupov <aaupov@fb.com>
Fri, 10 Jun 2022 22:49:32 +0000 (15:49 -0700)
commit82095bd5ed504fe26553b337d15131db530e768b
treed09fddd6798fc828d1c992594503df01da50e78d
parente90b56e411867bca5d053b276a6319cfb3db62cb
[BOLT] Mark fragments related to split jump table as non-simple

Mark fragments related to split jump table as non-simple.

A function could be splitted into hot and cold fragments. A split jump table is
challenging for correctly reconstructing control flow graphs, so it was marked
as ignored. This update marks those fragments as non-simple, allowing them
to be printed and partial control flow graph construction.

Test Plan:
```
llvm-lit -a tools/bolt/test/X86/split-func-icf.s
```
This test has two functions (main, main2), each has a jump table target to the
same cold portion main2.cold.1(*2). We try to print out only this cold portion.
If it is ignored, it cannot be printed. If it is non-simple, it can be printed. We
verify that it can be printed.

Reviewed By: Amir

Differential Revision: https://reviews.llvm.org/D127464
bolt/lib/Core/BinaryContext.cpp
bolt/lib/Rewrite/RewriteInstance.cpp
bolt/test/X86/split-func-icf.s