[llvm-commits] PATCH: Followup to r152556: Use more powerful instsimplify when actually performing the inline of a function

Chris Lattner sabre at nondot.org
Mon Mar 19 21:10:11 PDT 2012


On Mar 19, 2012, at 7:41 PM, Chandler Carruth wrote:
> Here is an attempt to fix this by using the more powerful instruction simplification routine *inside* the inliner. This hooks directly into its existing value-map-based override system to minimize the cloning, propagate both constants and simplified values directly when inlining, etc. It should also more aggressively prune the set of basic blocks cloned during inlining. The gross part is that I had to extend the interfaces into SimplifyInstruction, but I think the result is a reasonable compromise and exposes more information to the simplification pass. Also, I had to enhance it to survive cases where the instructions in question are not part of well formed basic blocks or functions.

- The instsimplify generalizations look fine to me, please commit them as a separate patch though.
- I like the patch to Inliner.cpp :-)
- The rest of the patch looks good, one typeo: "entriy".

As an effort to save some compile time, you could skip calling SimplifyInstOperands if none of the operands in FoldMappedInstruction were remapped.  If the code going into the inliner is already simplified (I think it should be due to instcombine running early?) then the non-remapped case shouldn't be simplifiable anyway.

-Chris

> 
> So far, it survives the regression tests (including those for the original patch I submitted) and a bootstrap but I still need to write up and add regression tests for 1, 2, and 3 above (if I can). The resulting binary is marginally smaller (<1%) and I see no significant performance changes in my initial testing. I still need to test the optimizers performance to make sure we don't inflate the inliner's cost significantly, but it looks promising thus far.
> 
> Comments? Is this the right approach?
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits





More information about the llvm-commits mailing list