[PATCH] D52362: [CloneFunction] Simplify previously unsimplifiable instructions

Anna Thomas via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Sep 21 13:54:46 PDT 2018


anna added a comment.

In https://reviews.llvm.org/D52362#1242200, @hfinkel wrote:

>




> Is there any compile-time impact?

I haven't checked the compile time impact. Will do. However, this is just a linear addition of instructions and it's uses - we were already looking at phis and their uses.  Also, later passes (that iterate over the inlined instructions) will anyway iterate over all instructions. So, I think it should be either neutral or a win. Win when we were wastefully iterating over instructions through multiple passes until we reached the pass which could simplify these instructions.

> Should we just simplify all instructions at this later point instead of having two passes?

I'll take a look, but it seems a more invasive change. We first cloneBlocks, then iterate over all instructions in the callee and insert it in the caller in right order (now the instructions have a parent block), and then have two passes over the PHINodes. The second pass over the PHINode already looks over the uses and does recursive simplification. To this list, now that all instructions have basic block parents, we add them for recursive simplification.


Repository:
  rL LLVM

https://reviews.llvm.org/D52362





More information about the llvm-commits mailing list