[PATCH] D30474: [InstCombine] Always Fold GEP chains where the first index is zero

Matthew Simpson via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Feb 28 15:22:46 PST 2017


mssimpso added a comment.

In https://reviews.llvm.org/D30474#689051, @efriedma wrote:

> "y = gep(x, i); z =gep(x, i, j)" is three mul and three add operations.


Are you including the cost of computing y after the transformation here? y can be eliminated now (assuming z was its only user). Would you be more comfortable if there was a single user check?


https://reviews.llvm.org/D30474





More information about the llvm-commits mailing list