[llvm] r209049 - Add support for combining GEPs across PHI nodes

Tobias Grosser tobias at grosser.es
Sat May 17 04:38:59 PDT 2014


On 17/05/2014 01:47, Louis Gerbarg wrote:
> Author: louis
> Date: Fri May 16 18:47:24 2014
> New Revision: 209049
>
> URL: http://llvm.org/viewvc/llvm-project?rev=209049&view=rev
> Log:
> 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

After this commit, I see plenty of execution time failures 
(miscompiles?) on my LNT (clang -O3) servers:

http://lab.llvm.org:8011/builders/polly-perf-O3/builds/3322

Cheers,
Tobias



More information about the llvm-commits mailing list