llvm-project/llvm/test
Max Kazantsev 8fe62b7af1 [GVN] Introduce loop load PRE
This patch allows PRE of the following type of loads:

```
preheader:
  br label %loop

loop:
  br i1 ..., label %merge, label %clobber

clobber:
  call foo() // Clobbers %p
  br label %merge

merge:
  ...
  br i1 ..., label %loop, label %exit

```

Into
```
preheader:
  %x0 = load %p
  br label %loop

loop:
  %x.pre = phi(x0, x2)
  br i1 ..., label %merge, label %clobber

clobber:
  call foo() // Clobbers %p
  %x1 = load %p
  br label %merge

merge:
  x2 = phi(x.pre, x1)
  ...
  br i1 ..., label %loop, label %exit

```

So instead of loading from %p on every iteration, we load only when the actual clobber happens.
The typical pattern which it is trying to address is: hot loop, with all code inlined and
provably having no side effects, and some side-effecting calls on cold path.

The worst overhead from it is, if we always take clobber block, we make 1 more load
overall (in preheader). It only matters if loop has very few iteration. If clobber block is not taken
at least once, the transform is neutral or profitable.

There are several improvements prospect open up:
- We can sometimes be smarter in loop-exiting blocks via split of critical edges;
- If we have block frequency info, we can handle multiple clobbers. The only obstacle now is that
  we don't know if their sum is colder than the header.

Differential Revision: https://reviews.llvm.org/D99926
Reviewed By: reames
2021-04-22 12:50:38 +07:00
..
Analysis [AArch64] Add instruction costs for FP_TO_UINT and FP_TO_SINT with half types 2021-04-21 09:39:45 +01:00
Assembler [LLParser] Print mismatched types in error message 2021-04-21 13:10:37 -07:00
Bindings [OCaml][Test] Fix and enable debuginfo.ml test 2021-03-28 06:25:39 +05:30
Bitcode [clang][AArch64] Correctly align HFA arguments when passed on the stack 2021-04-15 22:58:14 +01:00
BugPoint
CodeGen [CodeGen] Do not split functions with attr "implicit-section-name". 2021-04-21 21:51:33 -07:00
DebugInfo [CodeView] Add CodeView support for PGO debug information 2021-04-21 15:29:19 -07:00
Demangle
Examples [Orc][examples] Add missing FileCheck for lit test and polish output 2021-04-07 11:12:20 +02:00
ExecutionEngine [JITLink] Add testcase that was accidentally left out of 19e402d2b3. 2021-04-17 11:55:55 -07:00
Feature [FunctionAttrs] Force old pm in test so it doens't behave differently depending on the configuration setting for this flag 2021-04-09 11:46:19 +02:00
FileCheck Fix PR46880: Fail CHECK-NOT with undefined variable 2021-04-20 14:42:46 +01:00
Instrumentation [IR][sanitizer] Set nounwind on module ctor/dtor, additionally set uwtable if -fasynchronous-unwind-tables 2021-04-21 15:58:20 -07:00
Integer Re-apply "[lli] Make -jit-kind=orc the default JIT engine" 2021-03-30 12:08:26 +02:00
JitListener
LTO Remove dead CHECK-ERR line. 2021-03-30 09:31:00 -07:00
Linker Restore lit feature object-emission. Omit DebugInfo/Generic on XCore. 2021-04-16 13:02:14 +01:00
MC [RISCV] Temporary in vmsge(u).vx pseudo instructions can't be V0. 2021-04-21 14:50:29 -07:00
MachineVerifier
Object [yaml2obj/obj2yaml/llvm-readobj] Support printing and parsing AVR-specific e_flags 2021-04-15 15:54:28 +02:00
ObjectYAML [lld] Fixed CodeView GuidAdapter::format to handle GUID bytes in the right order. 2021-04-09 05:29:14 +04:00
Other [OpenMP] Add OpenMPOpt as a Module pass 2021-04-20 12:28:58 -04:00
SafepointIRVerifier
Support [llvm-objdump] Switch command-line parsing from llvm::cl to OptTable 2021-04-14 20:12:24 -04:00
SymbolRewriter
TableGen [TableGen] Add support for the 'assert' statement in multiclasses 2021-04-19 09:01:42 -04:00
ThinLTO/X86 [NewPM] Cleanup IR printing instrumentation 2021-04-15 09:50:55 -07:00
Transforms [GVN] Introduce loop load PRE 2021-04-22 12:50:38 +07:00
Unit
Verifier [X86][AMX] Verify illegal types or instructions for x86_amx. 2021-04-20 16:14:22 +08:00
YAMLParser
tools [CSSPGO][llvm-profgen] Always report dangling probes for frames with real samples. 2021-04-21 18:07:58 -07:00
.clang-format
CMakeLists.txt [llvm-objdump] Add an llvm-otool tool 2021-04-20 08:24:58 -04:00
TestRunner.sh
lit.cfg.py [llvm-objdump] Add an llvm-otool tool 2021-04-20 08:24:58 -04:00
lit.site.cfg.py.in