llvm-project/bolt/Passes
Bill Nell 4806b13835 [BOLT] Add jump table support to ICP
Summary:
Add jump table support to ICP.  The optimization is basically the same
as ICP for tail calls.  The big difference is that the profiling data
comes from the jump table and the targets are local symbols rather than
global.

I've removed an instruction from ICP for tail calls.  The code used to
have a conditional jump to a block with a direct jump to the target, i.e.

  B1: cmp foo,(%rax)
      jne B3
  B2: jmp foo
  B3: ...

this code is now:

  B1: cmp foo,(%rax)
      je  foo
  B2: ...

The other changes in this diff:
- Move ICP + new jump table support to separate file in Passes.
- Improve the CFG validation to handle jump tables.
- Fix the double jump peephole so that the successor of the modified
  block is updated properly.  Also make sure that any existing branches
  in the block are modified to properly reflect the new CFG.
- Add an invocation of the double jump peephole to SCTC.  This allows
  us to remove a call to peepholes/UCE occurring after fixBranches() in
  the pass manager.
- Miscellaneous cleanups to BOLT output.

(cherry picked from FBD4727757)
2017-03-08 19:58:33 -08:00
..
BinaryPasses.cpp [BOLT] Add jump table support to ICP 2017-03-08 19:58:33 -08:00
BinaryPasses.h [BOLT] Add jump table support to ICP 2017-03-08 19:58:33 -08:00
CMakeLists.txt [BOLT] Add jump table support to ICP 2017-03-08 19:58:33 -08:00
FrameOptimizer.cpp [BOLT] Move BOLT passes under Passes subdirectory (NFC). 2017-02-16 14:57:57 -08:00
FrameOptimizer.h [BOLT] Move BOLT passes under Passes subdirectory (NFC). 2017-02-16 14:57:57 -08:00
HFSort.cpp [BOLT] Detect and handle __builtin_unreachable(). 2017-03-03 11:35:41 -08:00
HFSort.h [BOLT] Detect and handle __builtin_unreachable(). 2017-03-03 11:35:41 -08:00
HFSortPlus.cpp [BOLT] Detect and handle __builtin_unreachable(). 2017-03-03 11:35:41 -08:00
IndirectCallPromotion.cpp [BOLT] Add jump table support to ICP 2017-03-08 19:58:33 -08:00
IndirectCallPromotion.h [BOLT] Add jump table support to ICP 2017-03-08 19:58:33 -08:00
Inliner.cpp [BOLT] Add jump table support to ICP 2017-03-08 19:58:33 -08:00
Inliner.h [BOLT] Move BOLT passes under Passes subdirectory (NFC). 2017-02-16 14:57:57 -08:00
ReorderAlgorithm.cpp [BOLT] Organize options in categories for pretty printing (near NFC). 2017-03-28 14:40:20 -07:00
ReorderAlgorithm.h [BOLT] Move BOLT passes under Passes subdirectory (NFC). 2017-02-16 14:57:57 -08:00