llvm-6502/lib/Transforms/InstCombine
Louis Gerbarg 2d1fa5f718 Add support for combining GEPs across PHI nodes
Currently LLVM will generally merge GEPs. This allows backends to use more
complex addressing modes. In some cases this is not happening because there
is PHI inbetween the two GEPs:

  GEP1--\
        |-->PHI1-->GEP3
  GEP2--/

This patch checks to see if GEP1 and GEP2 are similiar enough that they can be
cloned (GEP12) in GEP3's BB, allowing GEP->GEP merging (GEP123):

  GEP1--\                     --\                           --\
        |-->PHI1-->GEP3  ==>    |-->PHI2->GEP12->GEP3 == >    |-->PHI2->GEP123
  GEP2--/                     --/                           --/

This also breaks certain use chains that are preventing GEP->GEP merges that the
the existing instcombine would merge otherwise.

Tests included.

rdar://15547484

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@209049 91177308-0d34-0410-b5e6-96231b3b80d8
2014-05-16 23:47:24 +00:00
..
CMakeLists.txt
InstCombine.h Rename ComputeMaskedBits to computeKnownBits. "Masked" has been 2014-05-14 21:14:37 +00:00
InstCombineAddSub.cpp Rename ComputeMaskedBits to computeKnownBits. "Masked" has been 2014-05-14 21:14:37 +00:00
InstCombineAndOrXor.cpp Reorder shuffle and binary operation. 2014-05-11 08:46:12 +00:00
InstCombineCalls.cpp Rename ComputeMaskedBits to computeKnownBits. "Masked" has been 2014-05-14 21:14:37 +00:00
InstCombineCasts.cpp Rename ComputeMaskedBits to computeKnownBits. "Masked" has been 2014-05-14 21:14:37 +00:00
InstCombineCompares.cpp InstCombine: Optimize -x s< cst 2014-05-15 00:02:20 +00:00
InstCombineLoadStoreAlloca.cpp
InstCombineMulDivRem.cpp Optimize integral reciprocal (udiv 1, x and sdiv 1, x) to not use division. This fires exactly once in a clang bootstrap, but covers a few different results from http://www.cs.utah.edu/~regehr/souper/ 2014-05-14 03:03:05 +00:00
InstCombinePHI.cpp
InstCombineSelect.cpp Reverting r208848, reason: build failure: sanitizer-x86_64-linux-bootstrap/builds/3399 2014-05-15 08:22:55 +00:00
InstCombineShifts.cpp Reorder shuffle and binary operation. 2014-05-11 08:46:12 +00:00
InstCombineSimplifyDemanded.cpp Rename ComputeMaskedBits to computeKnownBits. "Masked" has been 2014-05-14 21:14:37 +00:00
InstCombineVectorOps.cpp Fix type of shuffle resulted from shuffle merge. 2014-05-13 06:07:21 +00:00
InstCombineWorklist.h
InstructionCombining.cpp Add support for combining GEPs across PHI nodes 2014-05-16 23:47:24 +00:00
LLVMBuild.txt
Makefile