llvm/test
Wei Mi 71d7c09ce8 [GVN] Recommit the patch "Add phi-translate support in scalarpre".
The recommit fixes three bugs: The first one is to use CurrentBlock instead of
PREInstr's Parent as param of performScalarPREInsertion because the Parent
of a clone instruction may be uninitialized. The second one is stop PRE when
CurrentBlock to its predecessor is a backedge and an operand of CurInst is
defined inside of CurrentBlock. The same value defined inside of loop in last
iteration can not be regarded as available. The third one is an out-of-bound
array access in a flipped if guard.

Right now scalarpre doesn't have phi-translate support, so it will miss some
simple pre opportunities. Like the following testcase, current scalarpre cannot
recognize the last "a * b" is fully redundent because a and b used by the last
"a * b" expr are both defined by phis.

long a[100], b[100], g1, g2, g3;
__attribute__((pure)) long goo();

void foo(long a, long b, long c, long d) {

  g1 = a * b;
  if (__builtin_expect(g2 > 3, 0)) {
    a = c;
    b = d;
    g2 = a * b;
  }
  g3 = a * b;      // fully redundant.

}

The patch adds phi-translate support in scalarpre. This is only a temporary
solution before the newpre based on newgvn is available.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@306313 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-26 18:16:10 +00:00
..
Analysis [AVX2] [TTI CostModel] Add cost of interleaved loads/stores for AVX2 2017-06-25 08:26:25 +00:00
Assembler
Bindings
Bitcode
BugPoint
CodeGen AMDGPU: Setup SP/FP in callee function prolog/epilog 2017-06-26 17:53:59 +00:00
DebugInfo [llvm-pdbutil] Add a mode to bytes for dumping split debug chunks. 2017-06-26 17:22:36 +00:00
Examples
ExecutionEngine
Feature
FileCheck
Instrumentation
Integer
JitListener
LibDriver
Linker
LTO
MC fix trivial typo in comment, NFC 2017-06-26 06:32:04 +00:00
Object
ObjectYAML [WebAssembly] Add support for weak symbols in the binary format 2017-06-20 04:04:59 +00:00
Other
SymbolRewriter
TableGen [globalisel][tablegen] Add support for COPY_TO_REGCLASS. 2017-06-20 12:36:34 +00:00
ThinLTO/X86
tools [llvm-readobj] Fix COFF RVA table dumping bug 2017-06-23 22:12:11 +00:00
Transforms [GVN] Recommit the patch "Add phi-translate support in scalarpre". 2017-06-26 18:16:10 +00:00
Unit
Verifier
YAMLParser
.clang-format
CMakeLists.txt
lit.cfg
lit.site.cfg.in
TestRunner.sh