llvm-project/llvm/test
Jun Bum Lim 2ecb7ba4c6 [CodeGen] Add a new pass for PostRA sink
Summary:
This pass sinks COPY instructions into a successor block, if the COPY is not
used in the current block and the COPY is live-in to a single successor
(i.e., doesn't require the COPY to be duplicated).  This avoids executing the
the copy on paths where their results aren't needed.  This also exposes
additional opportunites for dead copy elimination and shrink wrapping.

These copies were either not handled by or are inserted after the MachineSink
pass. As an example of the former case, the MachineSink pass cannot sink
COPY instructions with allocatable source registers; for AArch64 these type
of copy instructions are frequently used to move function parameters (PhyReg)
into virtual registers in the entry block..

For the machine IR below, this pass will sink %w19 in the entry into its
successor (%bb.1) because %w19 is only live-in in %bb.1.

```
   %bb.0:
      %wzr = SUBSWri %w1, 1
      %w19 = COPY %w0
      Bcc 11, %bb.2
    %bb.1:
      Live Ins: %w19
      BL @fun
      %w0 = ADDWrr %w0, %w19
      RET %w0
    %bb.2:
      %w0 = COPY %wzr
      RET %w0
```
As we sink %w19 (CSR in AArch64) into %bb.1, the shrink-wrapping pass will be
able to see %bb.0 as a candidate.

With this change I observed 12% more shrink-wrapping candidate and 13% more dead copies deleted  in spec2000/2006/2017 on AArch64.

Reviewers: qcolombet, MatzeB, thegameg, mcrosier, gberry, hfinkel, john.brawn, twoh, RKSimon, sebpop, kparzysz

Reviewed By: sebpop

Subscribers: evandro, sebpop, sfertile, aemerson, mgorny, javed.absar, kristof.beyls, llvm-commits

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

llvm-svn: 328237
2018-03-22 20:06:47 +00:00
..
Analysis [MustExecute] Shwo the effect of using full loop info variant 2018-03-20 23:00:54 +00:00
Assembler Make the LLParser accept call instructions of variables in the program AS 2018-02-27 11:15:11 +00:00
Bindings [LLVM-C] Redo unnamed_address attribute bindings 2018-03-14 06:45:51 +00:00
Bitcode Refactor check for dllimport in the Verifier. 2018-03-06 17:19:23 +00:00
BugPoint
CodeGen [CodeGen] Add a new pass for PostRA sink 2018-03-22 20:06:47 +00:00
DebugInfo [CodeGen] Add a new pass for PostRA sink 2018-03-22 20:06:47 +00:00
Examples
ExecutionEngine [RuntimeDyld][MachO] Fix assertion in encodeAddend, add missing directive to 2018-03-01 01:44:33 +00:00
Feature Remove the LoopInstSimplify pass (-loop-instsimplify) 2018-03-12 20:49:42 +00:00
FileCheck
Instrumentation [asan] Fix a false positive ODR violation due to LTO ConstantMerge pass [llvm part, take 3] 2018-03-08 21:02:18 +00:00
Integer
JitListener
LTO Object: Fix handling of @@@ in .symver directive 2018-03-20 00:45:03 +00:00
Linker [DebugInfo] Add remaining files to r325970 2018-02-23 23:13:18 +00:00
MC [DWARF] Fix mixing assembler -g with DWARF .file directives. 2018-03-22 15:48:01 +00:00
Object [WebAssembly] Reorder reloc sections to come between symtab and name 2018-03-05 12:59:03 +00:00
ObjectYAML [WebAssembly] Disallow weak undefined globals in the object format 2018-03-09 16:30:44 +00:00
Other [test] Try to unbreak hexagon bots after r328160. 2018-03-21 22:57:33 +00:00
SafepointIRVerifier
SymbolRewriter
TableGen TableGen: Streamline how defs are instantiated 2018-03-21 17:12:53 +00:00
ThinLTO/X86 [ThinLTO] Clear dllimport when setting dso_local. 2018-03-13 15:24:51 +00:00
Transforms [SimplifyCFG] Create attribute for fuzzing-specific optimizations. 2018-03-22 17:07:51 +00:00
Unit
Verifier [DebugInfo] Add verifier for DICompositeType vector 2018-03-08 19:31:37 +00:00
YAMLParser
tools [X86][Btver2] Conversion, MaskedLoad/MaskedStore and NTStores all are scheduled through the JFPU1 pipe 2018-03-22 18:29:16 +00:00
.clang-format
CMakeLists.txt [dsymutil] Rename llvm-dsymutil -> dsymutil 2018-03-18 11:38:41 +00:00
TestRunner.sh
lit.cfg.py [dsymutil] Rename llvm-dsymutil -> dsymutil 2018-03-18 11:38:41 +00:00
lit.site.cfg.py.in