[DAGCombiner] [CodeGenPrepare] More comprehensive GEP splitting

Authored by luismarques on Jun 17 2019, 3:54 AM.


[DAGCombiner] [CodeGenPrepare] More comprehensive GEP splitting

Some GEPs were not being split, presumably because that split would just be
undone by the DAGCombiner. Not performing those splits can prevent important
optimizations, such as preventing the element indices / member offsets from
being (partially) folded into load/store instruction immediates. This patch:

  • Makes the splits also occur in the cases where the base address and the GEP are in the same BB.
  • Ensures that the DAGCombiner doesn't reassociate them back again.

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

llvm-svn: 363544