[llvm-dev] Loop Distribution pass

Renato Golin via llvm-dev llvm-dev at lists.llvm.org
Thu Sep 13 01:47:55 PDT 2018


On Thu, 13 Sep 2018 at 09:22, Jonas Paulsson
<paulsson at linux.vnet.ibm.com> wrote:
> I found with the help of the optimization remarks a loop that could not
> be vectorized, but if loop distribution was enabled this may happen,
> which it in fact did with a very significant benchmark improvement (~25%).

Hi Jonas,

That's not surprising, given that LD only tries to enable
vectorisation. Performance improvements of course depends on the
target and the quality of LLVM's lowering and further vectorisation.


> I tried (on SystemZ) to enable this pass, and found that it only
> affected a handful of files on SPEC. This means I could enable this
> without worrying about any regressions on SystemZ at least currently.

IIUC, it's all about compile time. Loop distribution analysis is not
terribly complex, but does have a cost (see [1]).

I don't think it will have many regressions because it's *very*
conservative (see [2]), perhaps too much. Shouldn't be too much of a
problem for SystemZ, but I'd wait for others closer to the LD pass to
chime in, before taking any decision. :)


> I wonder if there is something more to know about this. It seems that no
> other target has enabled this due to general mixed results, or? Is this
> triggering much more on other targets, and if so, why?

I think it's mostly about the success rate, given it's too
conservative. But in the past 2 years, improvements in (and around)
the LV have been slowed down a bit due to the move to VPlan.

Actually, I imagine LD would be a great candidate to be a
VPlan-to-VPlan pass, so that it can be combined with others in the
cost analysis, given that it's mostly meant to enable loop
vectorisation.

Adding some VPlan folks in CC.

-- 
cheers,
--renato

[1] http://lists.llvm.org/pipermail/llvm-dev/2017-January/109188.html
[2] http://lists.llvm.org/pipermail/llvm-dev/2016-October/105766.html


More information about the llvm-dev mailing list