llvm-project/llvm/test/Transforms/GVN
Sebastian Pop 55c3007b88 GVN-hoist: improve code generation for recursive GEPs
When loading or storing in a field of a struct like "a.b.c", GVN is able to
detect the equivalent expressions, and GVN-hoist would fail in the code
generation.  This is because the GEPs are not hoisted as scalar operations to
avoid moving the GEPs too far from their ld/st instruction when the ld/st is not
movable.  So we end up having to generate code for the GEP of a ld/st when we
move the ld/st.  In the case of a GEP referring to another GEP as in "a.b.c" we
need to code generate all the GEPs necessary to make all the operands available
at the new location for the ld/st.  With this patch we recursively walk through
the GEP operands checking whether all operands are available, and in the case of
a GEP operand, it recursively makes all its operands available. Code generation
happens from the inner GEPs out until reaching the GEP that appears as an
operand of the ld/st.

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

llvm-svn: 276841
2016-07-27 05:48:12 +00:00
..
PRE [GVN] Move other PRE tests to a subdirectory. 2016-07-17 23:55:20 +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
MemdepMiscompile.ll
assume-equal.ll Fix for two constant propagation problems in GVN with the assume intrinsic 2016-01-21 21:32:35 +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 [GVN] Fix handling of sub-byte types in big-endian mode 2016-04-07 15:45:02 +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
condprop.ll
crash-no-aa.ll
crash.ll
edge.ll
fence.ll Allow value forwarding past release fences in GVN 2016-03-25 22:40:35 +00:00
flags.ll [GVN] Respect fast-math-flags on fcmps 2016-04-22 06:37:51 +00:00
fold-const-expr.ll [GVN] Fold constant expression in GVN. 2016-07-14 22:02:25 +00:00
fpmath.ll
funclet.ll [IR] Reformulate LLVM's EH funclet IR 2015-12-12 05:38:55 +00:00
hoist-md.ll [GVNHoist] Merge metadata on hoisted instructions less conservatively 2016-07-25 02:21:25 +00:00
hoist-pr20242.ll code hoisting pass based on GVN 2016-07-15 13:45:20 +00:00
hoist-pr22005.ll code hoisting pass based on GVN 2016-07-15 13:45:20 +00:00
hoist-pr28606.ll GVH-hoist: only clone GEPs (PR28606) 2016-07-21 23:22:10 +00:00
hoist-recursive-geps.ll GVN-hoist: improve code generation for recursive GEPs 2016-07-27 05:48:12 +00:00
hoist.ll GVN-hoist: use a DFS numbering of instructions (PR28670) 2016-07-26 00:15:10 +00:00
invariant.group.ll
lifetime-simple.ll
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
noalias.ll
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
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 Revert "Change memcpy/memset/memmove to have dest and source alignments." 2015-11-19 05:56:52 +00:00
pr17852.ll
pr24397.ll
pr24426.ll
pr25440.ll Fix bug 25440: GVN assertion after coercing loads 2015-11-19 02:45:18 +00:00
pr28562.ll [IR] andIRFlags and copyIRFlags needs to handle GEP 2016-07-15 05:02:31 +00:00
pr28626.ll GVH-hoist: only clone GEPs (PR28606) 2016-07-21 23:22:10 +00:00
pre-compare.ll
pre-new-inst.ll
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
tbaa.ll
unreachable_block_infinite_loop.ll
volatile-nonvolatile.ll More detailed dependence test between volatile and non-volatile accesses 2016-02-22 23:07:43 +00:00