[PATCH] D38133: [CGP] Make optimizeMemoryInst introduce a select/phi if it improves things

Serguei Katkov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Sep 26 15:30:48 PDT 2017


skatkov added a comment.

In https://reviews.llvm.org/D38133#880243, @john.brawn wrote:

> OK, so looking at the comments here and looking at https://reviews.llvm.org/D36073 what looks like it would be the easiest way to progress things forwards is:
>
> - I split out the select handling into a separate patch.
> - I split out a patch which gathers the AddrModes and figures out how they differ, but then bails out when we get to sinking if we have more than one.
> - @skatkov modifies https://reviews.llvm.org/D36073 to build on top of this - from a brief look at FindCommonBase and the functions they call it looks like they could be modified to handle taking the AddrModes vector, so then we can handle the DifferentBase case similar to as in this patch but with AddrMode.BaseReg = FindCommonBase() instead of AddrMode.BaseReg = CreateSelectOrPhi().
> - I then write a patch on top of that which modifies FindCommonBase to handle the fields other than the base register.
>
>   Does this seem reasonable?


Yes, it seems reasonable to me.


Repository:
  rL LLVM

https://reviews.llvm.org/D38133





More information about the llvm-commits mailing list