1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-22 12:33:33 +02:00
llvm-mirror/include/llvm
Haicheng Wu cc71215e80 [CGP] Split large data structres to sink more GEPs
Accessing the members of a large data structures needs a lot of GEPs which
usually have large offsets due to the size of the underlying data structure. If
the offsets are too large to fit into the r+i addressing mode, these GEPs cannot
be sunk to their users' blocks and many extra registers are needed then to carry
the values of these GEPs.

This patch tries to split a large data struct starting from %base like the
following.

Before:
BB0:
  %base     =

BB1:
  %gep0     = gep %base, off0
  %gep1     = gep %base, off1
  %gep2     = gep %base, off2

BB2:
  %load1    = load %gep0
  %load2    = load %gep1
  %load3    = load %gep2

After:
BB0:
  %base     =
  %new_base = gep %base, off0

BB1:
  %new_gep0 = %new_base
  %new_gep1 = gep %new_base, off1 - off0
  %new_gep2 = gep %new_base, off2 - off0

BB2:
  %load1    = load i32, i32* %new_gep0
  %load2    = load i32, i32* %new_gep1
  %load3    = load i32, i32* %new_gep2

In the above example, the struct is split into two parts. The first part still
starts from %base and the second part starts from %new_base. After the
splitting, %new_gep1 and %new_gep2 have smaller offsets and then can be sunk to
BB2 and folded into their users.

The algorithm to split data structure is simple and very similar to the work of
merging SExts. First, it collects GEPs that have large offsets when iterating
the blocks. Second, it splits the underlying data structures and updates the
collected GEPs to use smaller offsets.

Differential Revision: https://reviews.llvm.org/D42759

llvm-svn: 332015
2018-05-10 18:27:36 +00:00
..
ADT Remove @brief commands from doxygen comments, too. 2018-05-01 16:10:38 +00:00
Analysis [DebugInfo] Add DILabel metadata and intrinsic llvm.dbg.label. 2018-05-09 02:40:45 +00:00
AsmParser Remove \brief commands from doxygen comments. 2018-05-01 15:54:18 +00:00
BinaryFormat AMDGPU/NFC: Use enum values for first/last machs instead of numbers 2018-05-01 16:34:29 +00:00
Bitcode [DebugInfo] Add DILabel metadata and intrinsic llvm.dbg.label. 2018-05-09 02:40:45 +00:00
CodeGen [CGP] Split large data structres to sink more GEPs 2018-05-10 18:27:36 +00:00
Config Don't redefine a bunch of defines from llvm-config.h in config.h. 2018-05-10 14:45:05 +00:00
DebugInfo [DWARF] Rework debug line parsing to use llvm::Error and callbacks 2018-05-10 10:51:33 +00:00
Demangle Remove \brief commands from doxygen comments. 2018-05-01 15:54:18 +00:00
ExecutionEngine Remove @brief commands from doxygen comments, too. 2018-05-01 16:10:38 +00:00
FuzzMutate [llvm-opt-fuzzer] Avoid adding incorrect inputs to the fuzzer corpus 2018-02-05 11:05:47 +00:00
IR [X86] ptwrite intrinsic 2018-05-10 07:26:05 +00:00
IRReader LLParser: add an argument for overriding data layout and do not check alloca addr space 2018-01-30 22:32:39 +00:00
LineEditor
Linker Remove \brief commands from doxygen comments. 2018-05-01 15:54:18 +00:00
LTO [LTO] Add stats-file option to LTO/Config.h. 2018-04-20 10:18:36 +00:00
MC Fix comment. NFC 2018-05-07 05:21:20 +00:00
Object [COFF] Improve correctness of def parsing for GNU features 2018-05-09 09:21:53 +00:00
ObjectYAML Remove \brief commands from doxygen comments. 2018-05-01 15:54:18 +00:00
Option [Option] Remove an unnecessary conversion function. 2018-05-05 06:05:31 +00:00
Passes Remove \brief commands from doxygen comments. 2018-05-01 15:54:18 +00:00
ProfileData [Coverage] Take filenames into account when loading function records. 2018-05-08 19:26:51 +00:00
Support [DebugInfo] Convert intrinsic llvm.dbg.label to MachineInstr. 2018-05-09 02:41:08 +00:00
TableGen Remove \brief commands from doxygen comments. 2018-05-01 15:54:18 +00:00
Target [DebugInfo] Convert intrinsic llvm.dbg.label to MachineInstr. 2018-05-09 02:41:08 +00:00
Testing/Support [Testing/Support] Make Failed() matcher work with abstract error types 2018-04-10 14:11:53 +00:00
ToolDrivers
Transforms [InstCombine] snprintf optimizations 2018-05-09 16:09:31 +00:00
WindowsManifest Fix bug 34608 by moving private header out of public header. 2017-09-14 23:01:13 +00:00
WindowsResource [llvm-readobj] Teach readobj to dump .res files (WindowsResource). 2017-09-20 18:33:35 +00:00
XRay XRayRecord.h: Add missing #include 2017-11-21 00:23:19 +00:00
CMakeLists.txt
InitializePasses.h [LoopGuardWidening] Split out a loop pass version of GuardWidening 2018-04-27 17:29:10 +00:00
LinkAllIR.h Sink some IntrinsicInst.h and Intrinsics.h out of llvm/include 2017-09-07 23:27:44 +00:00
LinkAllPasses.h [LoopGuardWidening] Split out a loop pass version of GuardWidening 2018-04-27 17:29:10 +00:00
module.modulemap Rename *CommandFlags.def to *CommandFlags.inc 2018-04-11 18:49:37 +00:00
module.modulemap.build [Modules] Add module for Config/llvm-config.h 2017-10-24 06:18:52 +00:00
Pass.h Remove @brief commands from doxygen comments, too. 2018-05-01 16:10:38 +00:00
PassAnalysisSupport.h [NFC] fix trivial typos in comments 2018-01-23 05:49:30 +00:00
PassInfo.h [Pass] Fix some Clang-tidy modernize and Include What You Use warnings; other minor fixes (NFC). 2017-09-06 23:05:38 +00:00
PassRegistry.h [Pass] Fix some Clang-tidy modernize and Include What You Use warnings; other minor fixes (NFC). 2017-09-06 23:05:38 +00:00
PassSupport.h [Pass] Fix some Clang-tidy modernize and Include What You Use warnings; other minor fixes (NFC). 2017-09-06 23:05:38 +00:00