[PATCH] D36504: [CodeGenPrepare][WIP] Convert uncond. branch to return into a return to help with shrink-wrapping

Krzysztof Parzyszek via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Nov 2 10:53:01 PDT 2017


kparzysz added a comment.

In https://reviews.llvm.org/D36504#914201, @sfertile wrote:

> Thanks for the feedback. Can you elaborate a bit more on why we wouldn't want to do this in CodeGenPrepare?


Generally speaking, CGP is kind of a hack.  We should work to take away from it, not to add to it.  From what I know, the main motivation for CGP was to address some deficiencies of the instruction selection via the selection DAG, so we should at least try to limit it to doing that.

Opportunistically adding simple transformations to where it's convenient, not to where they belong logically is a suboptimal long-term strategy, although it looks appealing in the short term.  Writing an optimization that can create shrink-wrapping opportunities on optimized code is certainly more involved, but will likely provide better results.


Repository:
  rL LLVM

https://reviews.llvm.org/D36504





More information about the llvm-commits mailing list