1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-22 10:42:39 +01:00
llvm-mirror/include/llvm
Alexey Zhikhartsev 6516543c4b Add jump-threading optimization for deterministic finite automata
The current JumpThreading pass does not jump thread loops since it can
result in irreducible control flow that harms other optimizations. This
prevents switch statements inside a loop from being optimized to use
unconditional branches.

This code pattern occurs in the core_state_transition function of
Coremark. The state machine can be implemented manually with goto
statements resulting in a large runtime improvement, and this transform
makes the switch implementation match the goto version in performance.

This patch specifically targets switch statements inside a loop that
have the opportunity to be threaded. Once it identifies an opportunity,
it creates new paths that branch directly to the correct code block.
For example, the left CFG could be transformed to the right CFG:

```
          sw.bb                        sw.bb
        /   |   \                    /   |   \
   case1  case2  case3          case1  case2  case3
        \   |   /                /       |       \
        latch.bb             latch.2  latch.3  latch.1
         br sw.bb              /         |         \
                           sw.bb.2     sw.bb.3     sw.bb.1
                            br case2    br case3    br case1
```

Co-author: Justin Kreiner @jkreiner
Co-author: Ehsan Amiri @amehsan

Reviewed By: SjoerdMeijer

Differential Revision: https://reviews.llvm.org/D99205
2021-07-27 14:34:04 -04:00
..
ADT [CodeView] Saturate values bigger than supported by APInt. 2021-07-26 22:15:26 +02:00
Analysis [InstSimplify] Expose generic interface for replaced operand simplification 2021-07-27 00:56:12 -05:00
AsmParser [AsmParser] Remove MDRef (NFC) 2021-07-26 08:29:33 -07:00
BinaryFormat Reland: "[WebAssembly] Deduplicate imports of the same module name, field name, and type" 2021-07-22 14:16:05 -07:00
Bitcode [IR] Add elementtype attribute 2021-07-15 18:04:26 +02:00
Bitstream
CodeGen [SystemZ][z/OS] Initial code to generate assembly files on z/OS 2021-07-27 11:29:15 -04:00
Config
DebugInfo [Debug-Info][llvm-dwarfdump] Don't try to dump location 2021-07-27 07:28:59 +00:00
Demangle [demangler] Fix demangling of 'half' 2021-07-19 21:21:34 +01:00
DWARFLinker
DWP [DWP] Refactoring llvm-dwp in to a library part 2 2021-07-22 14:23:29 -07:00
ExecutionEngine [ORC] Require ExecutorProcessControl when constructing an ExecutionSession. 2021-07-27 16:53:49 +10:00
FileCheck
Frontend [OPENMP]Fix PR49787: Codegen for calling __tgt_target_teams_nowait_mapper has too few arguments. 2021-07-22 08:44:37 -07:00
FuzzMutate
InterfaceStub [ifs][elfabi] Merge llvm-ifs/elfabi tools 2021-07-19 11:23:19 -07:00
IR [WebAssembly] Codegen for extmul SIMD instructions 2021-07-27 08:41:30 -07:00
IRReader
LineEditor
Linker
LTO [LTO] Add SelectionKind to IRSymtab and use it in ld.lld/LLVMgold 2021-07-20 13:22:00 -07:00
MC [SystemZ][z/OS] Initial code to generate assembly files on z/OS 2021-07-27 11:29:15 -04:00
MCA
Object [LTO] Add SelectionKind to IRSymtab and use it in ld.lld/LLVMgold 2021-07-20 13:22:00 -07:00
ObjectYAML [yaml2obj][MachO] Rename PayloadString to Content 2021-07-26 09:04:51 -07:00
Option
Passes [NewPM] Print pre-transformation IR name in --print-after-all 2021-07-20 10:20:10 -07:00
ProfileData [profile] Add binary id into profiles 2021-07-23 00:19:12 +00:00
Remarks
Support [llvm][NFC] Fix typos in Errc.h description 2021-07-23 11:54:49 -07:00
TableGen
Target [GlobalISel] Add a constant folding combine. 2021-07-26 14:53:33 -07:00
Testing/Support
TextAPI
ToolDrivers
Transforms Add jump-threading optimization for deterministic finite automata 2021-07-27 14:34:04 -04:00
WindowsManifest
WindowsResource
XRay
CMakeLists.txt
InitializePasses.h Add jump-threading optimization for deterministic finite automata 2021-07-27 14:34:04 -04:00
LinkAllIR.h
LinkAllPasses.h Add jump-threading optimization for deterministic finite automata 2021-07-27 14:34:04 -04:00
module.extern.modulemap
module.install.modulemap
module.modulemap
module.modulemap.build
Pass.h
PassAnalysisSupport.h
PassInfo.h
PassRegistry.h
PassSupport.h