[llvm-dev] Enabling Loop Distribution Pass as default in the pipeline of new pass manager
Kyrylo Tkachov via llvm-dev
llvm-dev at lists.llvm.org
Thu Jun 17 09:08:10 PDT 2021
I'd be in favour of enabling loop distribution by default as long as it doesn't hurt compile-time when it's not needed.
FWIW GCC enables this by default to get the speedup on hmmer. I don't know enough about the LLVM implementation to compare with GCC's, but GCC's loop distribution pass aims to help vectorisation and help detect manual memset, memcpy implementations (I think LLVM does that detection in another pass).
You can read the high-level GCC design in the source: https://gcc.gnu.org/git/?p=gcc.git;a=blob;f=gcc/tree-loop-distribution.c;h=65aa1df4abae2c6acf40299f710bc62ee6bacc07;hb=HEAD#l39
Thanks,
Kyrill
From: llvm-dev <llvm-dev-bounces at lists.llvm.org> On Behalf Of Sjoerd Meijer via llvm-dev
Sent: 17 June 2021 16:07
To: llvm-dev at lists.llvm.org; Jingu Kang <Jingu.Kang at arm.com>
Subject: Re: [llvm-dev] Enabling Loop Distribution Pass as default in the pipeline of new pass manager
My 2 cents:
It's not really convincing if a pass trigger on only benchmark case. But on the other hand, if it is a really cheap pass to run (compile-times) and benefits a case, then why not? Perhaps you need to quantify this to make it more convincing. Additional benefit of enabling it by default is that it gets more exposure and testing, which I think is a good thing.
Lastly, is there anything we can learn from GCC here? E.g., do they have this enabled, and perhaps support more/other cases?
________________________________
From: llvm-dev <llvm-dev-bounces at lists.llvm.org<mailto:llvm-dev-bounces at lists.llvm.org>> on behalf of Jingu Kang via llvm-dev <llvm-dev at lists.llvm.org<mailto:llvm-dev at lists.llvm.org>>
Sent: 17 June 2021 13:51
To: llvm-dev at lists.llvm.org<mailto:llvm-dev at lists.llvm.org> <llvm-dev at lists.llvm.org<mailto:llvm-dev at lists.llvm.org>>
Subject: [llvm-dev] Enabling Loop Distribution Pass as default in the pipeline of new pass manager
Hi All,
My colleague Sanne has found performance improvement with '-enable-loop-distribute' option from hmmer on SPEC2006.
On the hmmer, there is a loop with dependence. The Loop Distribute pass splits the loop into three sperate loops. One loop has still dependence, another is vectorizable, the other is vectorizable after running LoopBoundSplit pass which needs to be updated a bit. On AArch64, we have seen 40% improvement with enabling Loop Distribute pass and 80% improvement with enabling Loop Distribute pass and LoopBoundSplit from hmmer on SPEC2006.
>From llvm-test-suite and spec benchmarks, I have not seen any performance degradation with enabling the Loop Distribute pass because almost all tests are not handled by Loop Distribute pass with mainly below messages. I think the messages are reasonable.
Skipping; memory operations are safe for vectorization
Skipping; no unsafe dependences to isolate
Skipping; multiple exit blocks
For compile time, there is no big change because the almost all tests are not handled by the pass due to mainly above three reasons which comes from cached analysis information.
At this moment, we can enable the pass with metadata or command line option. If possible, can we enable the Loop Distribute pass as default in the pipeline of new pass manager please?
Thanks
JinGu Kang
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20210617/5ae95398/attachment-0001.html>
More information about the llvm-dev
mailing list