<div dir="ltr">Performance looks more or less flat for me.<div><br></div><div>Michael</div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Dec 13, 2016 at 8:15 AM, Hal Finkel via llvm-dev <span dir="ltr"><<a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">----- Original Message -----<br>
> From: "Arnold Schwaighofer via llvm-dev" <<a href="mailto:llvm-dev@lists.llvm.org">llvm-dev@lists.llvm.org</a>><br>
> To: "Matthew Simpson" <<a href="mailto:mssimpso@codeaurora.org">mssimpso@codeaurora.org</a>><br>
> Cc: "llvm-dev" <<a href="mailto:llvm-dev@lists.llvm.org">llvm-dev@lists.llvm.org</a>><br>
> Sent: Tuesday, December 13, 2016 9:17:08 AM<br>
> Subject: Re: [llvm-dev] Enabling scalarized conditional stores in the loop vectorizer<br>
><br>
> I added this feature for libquantum<br>
> (<a href="http://llvm.org/viewvc/llvm-project?view=revision&revision=200270" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-<wbr>project?view=revision&<wbr>revision=200270</a>)<br>
> waiting for an update to the cost model modeling the scalarization<br>
> of stores which you recently added.<br>
><br>
> Assuming no serious regressions this SGTM.<br>
<br>
</span>Great!<br>
<br>
-Hal<br>
<div class="HOEnZb"><div class="h5"><br>
><br>
><br>
> > On Dec 13, 2016, at 5:41 AM, Matthew Simpson<br>
> > <<a href="mailto:mssimpso@codeaurora.org">mssimpso@codeaurora.org</a>> wrote:<br>
> ><br>
> > Hi Michael,<br>
> ><br>
> > Thanks for testing this on your benchmarks and target. I think the<br>
> > results will help guide the direction we go. I tested the feature<br>
> > with spec2k/2k6 on AArch64/Kryo and saw minor performance swings,<br>
> > aside from a large (30%) improvement in spec2k6/libquantum. The<br>
> > primary loop in that benchmark has a conditional store, so I<br>
> > expected it to benefit.<br>
> ><br>
> > Regarding the cost model, I think the vectorizer's modeling of the<br>
> > conditional stores is good. We could potentially improve it by<br>
> > using profile information if available. But I'm not sure of the<br>
> > quality of the individual TTI implementations other than AArch64.<br>
> > I assume they are adequate.<br>
> ><br>
> > Since the conditional stores remain scalar in the vector loop,<br>
> > their cost is essentially the same as it is in the scalar loop<br>
> > (aside from scalarization overhead, which we account for). So when<br>
> > we compare the cost of the scalar and vector loops when deciding<br>
> > to vectorize, we're basically comparing the cost of everything<br>
> > else.<br>
> ><br>
> > -- Matt<br>
> ><br>
> > On Mon, Dec 12, 2016 at 7:03 PM, Michael Kuperstein via llvm-dev<br>
> > <<a href="mailto:llvm-dev@lists.llvm.org">llvm-dev@lists.llvm.org</a>> wrote:<br>
> > Conceptually speaking, I think we really ought to enable this.<br>
> ><br>
> > Practically, I'm going to test it on our benchmarks (on x86), and<br>
> > see if we have any regressions - this seems like a fairly major<br>
> > change.<br>
> > Re targets - let's see where we stand w.r.t regressions first. What<br>
> > kind of performance testing have you already run on this? Do you<br>
> > know of specific targets where the cost model is known to be good<br>
> > enough, so it's clearly beneficial?<br>
> ><br>
> > (+Arnold, who probably knows why this is disabled by default. :-) )<br>
> ><br>
> > Thanks,<br>
> > Michael<br>
> ><br>
> > On Mon, Dec 12, 2016 at 2:52 PM, Matthew Simpson<br>
> > <<a href="mailto:mssimpso@codeaurora.org">mssimpso@codeaurora.org</a>> wrote:<br>
> > Hi,<br>
> ><br>
> > I'd like to enable the scalarized conditional stores feature in the<br>
> > loop vectorizer (-enable-cond-stores-vec=true)<wbr>. The feature allows<br>
> > us to vectorize loops containing conditional stores that must be<br>
> > scalarized and predicated in the vectorized loop.<br>
> ><br>
> > Note that this flag does not affect the decision to generate masked<br>
> > vector stores. That is a separate feature and is guarded by a TTI<br>
> > hook. Currently, we give up on loops containing conditional stores<br>
> > that must be scalarized (i.e., conditional stores that can't be<br>
> > represented with masked vector stores). If the feature is enabled,<br>
> > we attempt to vectorize those loops if profitable, while<br>
> > scalarizing and predicating the conditional stores.<br>
> ><br>
> > I think these stores are fairly well modeled in the cost model at<br>
> > this point using the static estimates. They're modeled similar to<br>
> > the way we model other non-store conditional instructions that<br>
> > must be scalarized and predicated (e.g., instructions that may<br>
> > divide by zero); however, only the conditional stores are<br>
> > currently disabled by default.<br>
> ><br>
> > I'd appreciate any opinions on how/if we can enable this feature.<br>
> > For example, can we enable it for all targets or would a<br>
> > target-by-target opt-in mechanism using a TTI hook be preferable?<br>
> > If you'd like to test the feature on your target, please report<br>
> > any significant regressions and improvements you find.<br>
> ><br>
> > Thanks!<br>
> ><br>
> > -- Matt<br>
> ><br>
> ><br>
> > ______________________________<wbr>_________________<br>
> > LLVM Developers mailing list<br>
> > <a href="mailto:llvm-dev@lists.llvm.org">llvm-dev@lists.llvm.org</a><br>
> > <a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/<wbr>mailman/listinfo/llvm-dev</a><br>
> ><br>
> ><br>
><br>
> ______________________________<wbr>_________________<br>
> LLVM Developers mailing list<br>
> <a href="mailto:llvm-dev@lists.llvm.org">llvm-dev@lists.llvm.org</a><br>
> <a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/<wbr>mailman/listinfo/llvm-dev</a><br>
><br>
<br>
</div></div><span class="HOEnZb"><font color="#888888">--<br>
Hal Finkel<br>
Lead, Compiler Technology and Programming Languages<br>
Leadership Computing Facility<br>
Argonne National Laboratory<br>
</font></span><div class="HOEnZb"><div class="h5">______________________________<wbr>_________________<br>
LLVM Developers mailing list<br>
<a href="mailto:llvm-dev@lists.llvm.org">llvm-dev@lists.llvm.org</a><br>
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/<wbr>mailman/listinfo/llvm-dev</a><br>
</div></div></blockquote></div><br></div></div>