llvm-6502/lib/Transforms
Louis Gerbarg a5423f2598 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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@209755 91177308-0d34-0410-b5e6-96231b3b80d8
2014-05-28 17:38:31 +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-28 17:38:31 +00:00
Instrumentation [asancov] Don't emit extra runtime calls when compiling without coverage. 2014-05-28 09:26:46 +00:00
IPO Add an extension point for peephole optimizers. 2014-05-25 10:27:02 +00:00
ObjCARC Add comdat key field to llvm.global_ctors and llvm.global_dtors 2014-05-16 20:39:27 +00:00
Scalar Distribute sext/zext to the operands of and/or/xor 2014-05-27 18:00:00 +00:00
Utils Add support for missed and analysis optimization remarks. 2014-05-22 14:19:46 +00:00
Vectorize Add support for missed and analysis optimization remarks. 2014-05-22 14:19:46 +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