llvm-project/llvm/test
Florian Hahn 467b1f1cd2
[SimplifyCFG] Allow hoisting terminators only with HoistCommonInsts=false.
As a side-effect of the change to default HoistCommonInsts to false
early in the pipeline, we fail to convert conditional branch & phis to
selects early on, which prevents vectorization for loops that contain
conditional branches that effectively are selects (or if the loop gets
vectorized, it will get vectorized very inefficiently).

This patch updates SimplifyCFG to perform hoisting if the only
instruction in both BBs is an equal branch. In this case, the only
additional instructions are selects for phis, which should be cheap.

Even though we perform hoisting, the benefits of this kind of hoisting
should by far outweigh the negatives.

For example, the loop in the code below will not get vectorized on
AArch64 with the current default, but will with the patch. This is a
fundamental pattern we should definitely vectorize. Besides that, I
think the select variants should be easier to use for reasoning across
other passes as well.

https://clang.godbolt.org/z/sbjd8Wshx

```
double clamp(double v) {
  if (v < 0.0)
    return 0.0;
  if (v > 6.0)
    return 6.0;
  return v;
}

void loop(double* X, double *Y) {
  for (unsigned i = 0; i < 20000; i++) {
    X[i] = clamp(Y[i]);
  }
}
```

Reviewed By: lebedev.ri

Differential Revision: https://reviews.llvm.org/D100329
2021-04-13 10:33:35 +01:00
..
Analysis [AMDGPU][CostModel] Refine cost model for control-flow instructions. 2021-04-10 09:20:24 +03:00
Assembler Reapply "OpaquePtr: Turn inalloca into a type attribute" 2021-03-29 08:55:30 -04:00
Bindings [OCaml][Test] Fix and enable debuginfo.ml test 2021-03-28 06:25:39 +05:30
Bitcode Reapply "OpaquePtr: Turn inalloca into a type attribute" 2021-03-29 08:55:30 -04:00
BugPoint
CodeGen [GreedyRA ORE] Add debug location for function level report 2021-04-13 09:49:12 +07:00
DebugInfo Revert "Reapply "[DebugInfo] Use variadic debug values to salvage BinOps and GEP instrs with non-const operands"" 2021-04-12 20:10:17 -07:00
Demangle
Examples [Orc][examples] Add missing FileCheck for lit test and polish output 2021-04-07 11:12:20 +02:00
ExecutionEngine [lli] Leaving two EH frame tests with MCJIT only after PowerPC failure 2021-03-30 12:28:22 +02: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 [FileCheck] Fix -dump-input per-pattern diagnostic indexing 2021-03-27 10:36:21 -04:00
Instrumentation [SantizerCoverage] handle missing DBG MD when inserting libcalls 2021-04-12 15:55:58 -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 Reapply "OpaquePtr: Turn inalloca into a type attribute" 2021-03-29 08:55:30 -04:00
MC [M68k] Implement AsmParser 2021-04-13 09:25:34 +01:00
MachineVerifier [GlobalISel] Add G_ROTR and G_ROTL opcodes for rotates. 2021-03-25 17:23:30 -07:00
Object [TextAPI] Add support for arm64_32 2021-04-01 17:19:12 -07:00
ObjectYAML [lld] Fixed CodeView GuidAdapter::format to handle GUID bytes in the right order. 2021-04-09 05:29:14 +04:00
Other [Passes] Add relative lookup table converter pass 2021-04-13 01:29:41 +00:00
SafepointIRVerifier
Support
SymbolRewriter
TableGen [TableGen] Fix bug in recent change to ListInit::convertInitListSlice() 2021-04-12 09:44:39 -04:00
ThinLTO/X86 Don't use $ as suffix for symbol names in ThinLTOBitcodeWriter and other places 2021-03-29 13:03:52 +02:00
Transforms [SimplifyCFG] Allow hoisting terminators only with HoistCommonInsts=false. 2021-04-13 10:33:35 +01:00
Unit [lit] Sort test start times based on prior test timing data 2021-03-16 05:23:04 -04:00
Verifier [DebugInfo] Upgrade DISubragne::count to accept DIExpression also 2021-03-30 09:16:55 +05:30
YAMLParser
tools [CSSPGO] Fix dangling context strings and improve profile order consistency and error handling 2021-04-10 12:39:10 -07:00
.clang-format
CMakeLists.txt Conditionalize the JIT test dependency 2021-03-30 13:04:02 -07:00
TestRunner.sh
lit.cfg.py [Orc][examples] Add lit ToolSubst for LLJITWithRemoteDebugging example 2021-04-07 09:47:04 +02:00
lit.site.cfg.py.in