hanchenye-llvm-project/llvm/test/Transforms/GVN
Wei Mi 71f06420e4 [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.

llvm-svn: 306313
2017-06-26 18:16:10 +00:00
..
PRE [GVN] Recommit the patch "Add phi-translate support in scalarpre". 2017-06-26 18:16:10 +00:00
2007-07-25-DominatedLoop.ll
2007-07-25-InfiniteLoop.ll [GVN] Use FileCheck instead of grep for tests. 2016-07-17 23:21:26 +00:00
2007-07-25-Loop.ll
2007-07-25-NestedLoop.ll
2007-07-25-SinglePredecessor.ll
2007-07-26-InterlockingLoops.ll
2007-07-26-NonRedundant.ll
2007-07-26-PhiErasure.ll [GVN] Use FileCheck instead of grep for tests. 2016-07-17 23:21:26 +00:00
2007-07-30-PredIDom.ll
2007-07-31-NoDomInherit.ll [GVN] Use FileCheck instead of grep for tests. 2016-07-17 23:21:26 +00:00
2007-07-31-RedundantPhi.ll [GVN] Use FileCheck instead of grep for tests. 2016-07-17 23:21:26 +00:00
2008-02-12-UndefLoad.ll [GVN] Use FileCheck instead of grep for tests. 2016-07-17 23:21:26 +00:00
2008-02-13-NewPHI.ll
2008-07-02-Unreachable.ll [GVN] Use FileCheck instead of grep for tests. 2016-07-17 23:21:26 +00:00
2008-12-09-SelfRemove.ll [GVN] Use FileCheck instead of grep for tests. 2016-07-17 23:21:26 +00:00
2008-12-12-RLE-Crash.ll
2008-12-14-rle-reanalyze.ll
2008-12-15-CacheVisited.ll
2009-01-21-SortInvalidation.ll
2009-01-22-SortInvalidation.ll
2009-03-10-PREOnVoid.ll
2009-07-13-MemDepSortFail.ll
2009-11-12-MemDepMallocBitCast.ll
2010-03-31-RedundantPHIs.ll
2010-05-08-OneBit.ll
2010-11-13-Simplify.ll
2011-04-27-phioperands.ll
2011-07-07-MatchIntrinsicExtract.ll
2011-09-07-TypeIdFor.ll
2012-05-22-PreCrash.ll
2016-08-30-MaskedScatterGather.ll Support arbitrary address space pointers in masked gather/scatter intrinsics. 2017-05-03 12:28:54 +00:00
MemdepMiscompile.ll
assume-equal.ll [Devirtualization] MemDep returns non-local !invariant.group dependencies 2017-01-12 11:33:58 +00:00
basic-undef-test.ll
basic.ll [GVN] Use FileCheck instead of grep for tests. 2016-07-17 23:21:26 +00:00
big-endian.ll Do not widen load for different variable in GVN. 2016-09-09 18:42:35 +00:00
bitcast-of-call.ll [GVN] Use FileCheck instead of grep for tests. 2016-07-17 23:21:26 +00:00
br-identical.ll
calloc-load-removal.ll
calls-nonlocal.ll [GVN] Use FileCheck instead of grep for tests. 2016-07-17 23:21:26 +00:00
calls-readonly.ll [GVN] Use FileCheck instead of grep for tests. 2016-07-17 23:21:26 +00:00
commute.ll
cond_br.ll
cond_br2.ll Add address space mangling to lifetime intrinsics 2017-04-10 20:18:21 +00:00
condprop.ll
crash-no-aa.ll
crash.ll
dbg-redundant-load.ll When GVN removes a redundant load, it should not modify the debug location of the dominating load. 2016-12-07 12:31:36 +00:00
debugloc.ll Do not propagate DebugLoc across basic blocks 2017-01-31 20:57:13 +00:00
edge.ll
fence.ll [AliasAnalysis] Fences do not modify constant memory location 2017-01-20 00:21:33 +00:00
flags.ll
fold-const-expr.ll Fix some DOS-style line endings that I suspect snuck in from one of the 2016-12-23 02:02:26 +00:00
fpmath.ll
funclet.ll
invariant.group.ll Handle invariant.group.barrier in BasicAA 2017-04-24 19:37:17 +00:00
invariant.start.ll [AliasAnalysis] Treat invariant.start as read-memory 2016-08-09 17:18:05 +00:00
lifetime-simple.ll Add address space mangling to lifetime intrinsics 2017-04-10 20:18:21 +00:00
load-constant-mem.ll [GVN] Use FileCheck instead of grep for tests. 2016-07-17 23:21:26 +00:00
load-from-unreachable-predecessor.ll
malloc-load-removal.ll
no_speculative_loads_with_asan.ll Do not widen load for different variable in GVN. 2016-09-09 18:42:35 +00:00
noalias.ll
non-integral-pointers.ll [GVN] Don't coerce non-integral pointers to integers or vice versa 2017-04-19 18:21:09 +00:00
non-local-offset.ll
nonescaping-malloc.ll [GVN] Use FileCheck instead of grep for tests. 2016-07-17 23:21:26 +00:00
null-aliases-nothing.ll
opt-remarks.ll [GVN, OptDiag] Print the interesting instructions involved in missed load-elimination 2016-12-01 17:34:50 +00:00
phi-translate-partial-alias.ll
pr10820.ll
pr12979.ll
pr14166.ll [InstSimplify] Cast folding can be made more generic 2016-07-26 17:58:05 +00:00
pr17732.ll
pr17852.ll
pr24397.ll
pr24426.ll
pr25440.ll Do not widen load for different variable in GVN. 2016-09-09 18:42:35 +00:00
pr28562.ll [IR] andIRFlags and copyIRFlags needs to handle GEP 2016-07-15 05:02:31 +00:00
pr32314.ll [BasicAA] Add test case that goes with r305481. 2017-06-15 17:27:56 +00:00
pre-compare.ll
pre-new-inst.ll
propagate-ir-flags.ll Fixed the lost FastMathFlags in GVN(Global Value Numbering). 2016-11-22 20:52:53 +00:00
range.ll
readattrs.ll
rle-must-alias.ll [GVN] Use FileCheck instead of grep for tests. 2016-07-17 23:21:26 +00:00
rle-no-phi-translate.ll
rle-nonlocal.ll
stale-loop-info.ll [GVN] When merging blocks update LoopInfo if it's available 2016-12-01 03:56:43 +00:00
tbaa.ll [Verifier] Add verification for TBAA metadata 2016-12-11 20:07:15 +00:00
unreachable_block_infinite_loop.ll
volatile-nonvolatile.ll