llvm-6502/lib/Transforms
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
..
Hello [Modules] Fix potential ODR violations by sinking the DEBUG_TYPE 2014-04-22 02:55:47 +00:00
InstCombine Add support for combining GEPs across PHI nodes 2014-05-16 23:47:24 +00:00
Instrumentation Delete getAliasedGlobal. 2014-05-16 22:37:03 +00:00
IPO Fix most of PR10367. 2014-05-16 19:35:39 +00:00
ObjCARC Add comdat key field to llvm.global_ctors and llvm.global_dtors 2014-05-16 20:39:27 +00:00
Scalar Revert "Implement global merge optimization for global variables." 2014-05-16 13:02:18 +00:00
Utils Add comdat key field to llvm.global_ctors and llvm.global_dtors 2014-05-16 20:39:27 +00:00
Vectorize SLPVectorizer: Instead of just performing CSE on dead blocks ignore them completely. 2014-05-11 10:28:58 +00:00
CMakeLists.txt Extracted ObjCARC.cpp into its own library libLLVMObjCARCOpts in preparation for refactoring the ARC Optimizer. 2013-01-28 01:35:51 +00:00
LLVMBuild.txt Extracted ObjCARC.cpp into its own library libLLVMObjCARCOpts in preparation for refactoring the ARC Optimizer. 2013-01-28 01:35:51 +00:00
Makefile Extracted ObjCARC.cpp into its own library libLLVMObjCARCOpts in preparation for refactoring the ARC Optimizer. 2013-01-28 01:35:51 +00:00