[llvm-dev] [GSoC 2021] Utilize LoopNest Pass

uint256_t via llvm-dev llvm-dev at lists.llvm.org
Sun Apr 4 18:00:21 PDT 2021


Hi, it's been a while.

I submitted a draft of project proposal to the website of GSoC.
Could you give me some advice about it?

(or should I share a draft on this ML?)

Best,
Toshiki Maekawa

On Tue, Mar 23, 2021, 2:35 PM uint256_t <konndennsa at gmail.com> wrote:

> I didn't realize LoopUnrollAndJam used to be implemented as LoopPass. I
> should have checked the commit log.
>
> Thanks,
> Toshiki Maekawa
>
> 2021年3月23日(火) 1:01 Whitney T Tsang <whitneyt at ca.ibm.com>:
>
>> LoopUnrollAndJam was changed from LoopPass to FunctionPass, which was a
>> good choice as LoopNestPass didn't exists at that time.
>> https://reviews.llvm.org/D72230
>>
>> You can see that `simplifyLoop` and `formLCSSARecursively` was adding in
>> that patch.
>> Those changes may not be needed anymore if we are using LoopNestPass, and
>> if the PassManager itself can make sure the loops are simplified and in
>> LCSSA form.
>>
>> Regards,
>> Whitney Tsang
>>
>> ----- Original message -----
>> From: uint256_t <konndennsa at gmail.com>
>> To: Whitney T Tsang <whitneyt at ca.ibm.com>
>> Cc: etiotto at ca.ibm.com, llvm-dev <llvm-dev at lists.llvm.org>
>> Subject: [EXTERNAL] Re: [llvm-dev] [GSoC 2021] Utilize LoopNest Pass
>> Date: Sat, Mar 20, 2021 10:40 AM
>>
>> Hi,
>>
>> I tried to utilize LoopNest pass for LoopUnrollAndJam pass, but found it
>> difficult.
>> LoopUnrollAndJam is currently implemented as FunctionPass, and using some
>> functions that may add new loops like simplifyLoop().
>>
>> We need to track such mutations by LPMUpdater, so need to make the
>> functions that may add loops use the updater.
>> This could lead to a big code change. What do you think about this change?
>>
>> Thanks,
>> Toshiki Maekawa
>>
>> 2021年3月17日(水) 0:47 uint256_t <konndennsa at gmail.com>:
>>
>> Thank you for your advice. I understand which passes are good for this
>> change.
>> I'll avoid transformation passes already used in a loop pipeline as much
>> as possible.
>>
>> Best,
>> Toshiki Maekawa
>>
>>
>> 2021年3月15日(月) 22:17 Whitney T Tsang <whitneyt at ca.ibm.com>:
>>
>> Passes implemented as a loop pass can still be good for this change.
>> I am referring to passes implemented as a loop pass and used as a loop
>> pass in a loop pipeline *may *not be a good candidate.
>> Take the LoopFullUnrollPass as an example, LoopFullUnrollPass is added in
>> LPM2 with other loop passes, e.g. LoopIdiomRecognizePass,
>> IndVarSimplifyPass, ...
>> Loops are processed from inner to outer loop, where each loop is
>> processed by all the passes in LPM2, before process its outer loops.
>> If we change LoopFullUnrollPass to a LoopNest pass, then there is no way
>> we can preserve the same order of processing loops.
>> It *may *still be good to change such passes, but there can be huge
>> performance impact, which we need to analyze and handle, and probably not
>> the best choice to look at first.
>>
>> ```
>> LoopPassManager
>> <https://urldefense.proofpoint.com/v2/url?u=https-3A__llvm.org_doxygen_classllvm-5F1-5F1PassManager-5F3-5F01Loop-5F00-5F01LoopAnalysisManager-5F00-5F01LoopStandardAnalysisResults-5F01-5F6-5F00-5F01LPMUpdater-5F01-5F6-5F01-5F4.html&d=DwMFaQ&c=jf_iaSHvJObTbx-siA1ZOg&r=p0DGcdtx8-l1bvwJTLSk1zBTXpb78Y1slqHKTsTpRTE&m=-1rK1PP7u3GOjDK9_MrikSqTedxsHUf50A8UOx2ZAow&s=VO1MvXw-cyt9Eux2SyzPWCnjAt7FTDEn-21TlLa6emY&e=>
>> LPM2(DebugLogging);
>>
>> LPM2.addPass(LoopIdiomRecognizePass
>> <https://urldefense.proofpoint.com/v2/url?u=https-3A__llvm.org_doxygen_classllvm-5F1-5F1LoopIdiomRecognizePass.html&d=DwMFaQ&c=jf_iaSHvJObTbx-siA1ZOg&r=p0DGcdtx8-l1bvwJTLSk1zBTXpb78Y1slqHKTsTpRTE&m=-1rK1PP7u3GOjDK9_MrikSqTedxsHUf50A8UOx2ZAow&s=zT88OFp3DjdtfeL61FZnvACBnEBuBn6Kev6csSS7I24&e=>
>> ());
>> LPM2.addPass(IndVarSimplifyPass
>> <https://urldefense.proofpoint.com/v2/url?u=https-3A__llvm.org_doxygen_classllvm-5F1-5F1IndVarSimplifyPass.html&d=DwMFaQ&c=jf_iaSHvJObTbx-siA1ZOg&r=p0DGcdtx8-l1bvwJTLSk1zBTXpb78Y1slqHKTsTpRTE&m=-1rK1PP7u3GOjDK9_MrikSqTedxsHUf50A8UOx2ZAow&s=5JiPKlMnVXnGB19EcyRykS-gIuojTq9YDMfbowRa6wE&e=>
>> ());
>>
>> for (auto &C
>> <https://urldefense.proofpoint.com/v2/url?u=https-3A__llvm.org_doxygen_README-5F-5FALTIVEC-5F8txt.html-23a9aacd9146afe44bf656cd664e2a88c8c&d=DwMFaQ&c=jf_iaSHvJObTbx-siA1ZOg&r=p0DGcdtx8-l1bvwJTLSk1zBTXpb78Y1slqHKTsTpRTE&m=-1rK1PP7u3GOjDK9_MrikSqTedxsHUf50A8UOx2ZAow&s=bADrxeYblE8QaL6xuXPkUIH4Z6BAoswihLzXx6H5zI0&e=>
>> : LateLoopOptimizationsEPCallbacks)
>> C
>> <https://urldefense.proofpoint.com/v2/url?u=https-3A__llvm.org_doxygen_README-5F-5FALTIVEC-5F8txt.html-23a9aacd9146afe44bf656cd664e2a88c8c&d=DwMFaQ&c=jf_iaSHvJObTbx-siA1ZOg&r=p0DGcdtx8-l1bvwJTLSk1zBTXpb78Y1slqHKTsTpRTE&m=-1rK1PP7u3GOjDK9_MrikSqTedxsHUf50A8UOx2ZAow&s=bADrxeYblE8QaL6xuXPkUIH4Z6BAoswihLzXx6H5zI0&e=>(LPM2,
>> Level
>> <https://urldefense.proofpoint.com/v2/url?u=https-3A__llvm.org_doxygen_namespacellvm-5F1-5F1PICLevel.html-23a66ddbf1bb21f90ddc44260d1ca677b6b&d=DwMFaQ&c=jf_iaSHvJObTbx-siA1ZOg&r=p0DGcdtx8-l1bvwJTLSk1zBTXpb78Y1slqHKTsTpRTE&m=-1rK1PP7u3GOjDK9_MrikSqTedxsHUf50A8UOx2ZAow&s=fDNQgJPblWk_XqJYM5QZz4ionfC0bPG1Kf26Bk09UGA&e=>
>> );
>>
>> LPM2.addPass(LoopDeletionPass
>> <https://urldefense.proofpoint.com/v2/url?u=https-3A__llvm.org_doxygen_classllvm-5F1-5F1LoopDeletionPass.html&d=DwMFaQ&c=jf_iaSHvJObTbx-siA1ZOg&r=p0DGcdtx8-l1bvwJTLSk1zBTXpb78Y1slqHKTsTpRTE&m=-1rK1PP7u3GOjDK9_MrikSqTedxsHUf50A8UOx2ZAow&s=NrdQXlgDr30LUEmEzu4iPGYz0mF-OZMGaHf-iF7YTUA&e=>
>> ());
>>
>> if (Phase
>> <https://urldefense.proofpoint.com/v2/url?u=https-3A__llvm.org_doxygen_AArch64FalkorHWPFFix-5F8cpp.html-23a780618ccf661aebc12f8d991d294c950&d=DwMFaQ&c=jf_iaSHvJObTbx-siA1ZOg&r=p0DGcdtx8-l1bvwJTLSk1zBTXpb78Y1slqHKTsTpRTE&m=-1rK1PP7u3GOjDK9_MrikSqTedxsHUf50A8UOx2ZAow&s=6GqmPHUAgZNcbeHiyCpbQEtvdpBxnuoFKWYjsSaBWHg&e=>
>> != ThinOrFullLTOPhase::ThinLTOPreLink
>> <https://urldefense.proofpoint.com/v2/url?u=https-3A__llvm.org_doxygen_namespacellvm.html-23a5d737fb4258bb27586a1bffd557fbb49ad94cc56b0a9155d607f2609b0f5c39d3&d=DwMFaQ&c=jf_iaSHvJObTbx-siA1ZOg&r=p0DGcdtx8-l1bvwJTLSk1zBTXpb78Y1slqHKTsTpRTE&m=-1rK1PP7u3GOjDK9_MrikSqTedxsHUf50A8UOx2ZAow&s=_vlP0s1ZTdT_RzLK7UEqbAIsCuvgazCbEHFthPEGqSs&e=>
>> || !PGOOpt ||
>> PGOOpt->Action != PGOOptions::SampleUse
>> <https://urldefense.proofpoint.com/v2/url?u=https-3A__llvm.org_doxygen_structllvm-5F1-5F1PGOOptions.html-23a13bd589bcabdfc073bac5711f76dd2b6a9cbf1cb1b0731fc75926a6930592968a&d=DwMFaQ&c=jf_iaSHvJObTbx-siA1ZOg&r=p0DGcdtx8-l1bvwJTLSk1zBTXpb78Y1slqHKTsTpRTE&m=-1rK1PP7u3GOjDK9_MrikSqTedxsHUf50A8UOx2ZAow&s=0joLN7ItQ-bBnPm_obAtCq8GlxpEOItz7mlKD1127I4&e=>
>> )
>> LPM2.addPass(LoopFullUnrollPass
>> <https://urldefense.proofpoint.com/v2/url?u=https-3A__llvm.org_doxygen_classllvm-5F1-5F1LoopFullUnrollPass.html&d=DwMFaQ&c=jf_iaSHvJObTbx-siA1ZOg&r=p0DGcdtx8-l1bvwJTLSk1zBTXpb78Y1slqHKTsTpRTE&m=-1rK1PP7u3GOjDK9_MrikSqTedxsHUf50A8UOx2ZAow&s=IJH5UWNHazAZopVGn0-zH608f0GuB_qjWnSLZI_6_n4&e=>
>> (Level
>> <https://urldefense.proofpoint.com/v2/url?u=https-3A__llvm.org_doxygen_namespacellvm-5F1-5F1PICLevel.html-23a66ddbf1bb21f90ddc44260d1ca677b6b&d=DwMFaQ&c=jf_iaSHvJObTbx-siA1ZOg&r=p0DGcdtx8-l1bvwJTLSk1zBTXpb78Y1slqHKTsTpRTE&m=-1rK1PP7u3GOjDK9_MrikSqTedxsHUf50A8UOx2ZAow&s=fDNQgJPblWk_XqJYM5QZz4ionfC0bPG1Kf26Bk09UGA&e=>
>> .getSpeedupLevel(),
>> /* OnlyWhenForced= */ !PTO.LoopUnrolling
>> <https://urldefense.proofpoint.com/v2/url?u=https-3A__llvm.org_doxygen_classllvm-5F1-5F1PipelineTuningOptions.html-23af5b2b612c2769e79040e34bc4be7a77f&d=DwMFaQ&c=jf_iaSHvJObTbx-siA1ZOg&r=p0DGcdtx8-l1bvwJTLSk1zBTXpb78Y1slqHKTsTpRTE&m=-1rK1PP7u3GOjDK9_MrikSqTedxsHUf50A8UOx2ZAow&s=5Dfb5UT0qna_Z5c4tHB7GiORlosgYjVzC_HlLWpteOE&e=>
>> ,
>> PTO.ForgetAllSCEVInLoopUnroll
>> <https://urldefense.proofpoint.com/v2/url?u=https-3A__llvm.org_doxygen_classllvm-5F1-5F1PipelineTuningOptions.html-23ac4261b710708d3ffd351693d268dbc2b&d=DwMFaQ&c=jf_iaSHvJObTbx-siA1ZOg&r=p0DGcdtx8-l1bvwJTLSk1zBTXpb78Y1slqHKTsTpRTE&m=-1rK1PP7u3GOjDK9_MrikSqTedxsHUf50A8UOx2ZAow&s=sbQZllB-TgD7_0NMlEtD5vY970XHLAUxr-QvO7a4AnU&e=>
>> ));
>>
>> for (auto &C
>> <https://urldefense.proofpoint.com/v2/url?u=https-3A__llvm.org_doxygen_README-5F-5FALTIVEC-5F8txt.html-23a9aacd9146afe44bf656cd664e2a88c8c&d=DwMFaQ&c=jf_iaSHvJObTbx-siA1ZOg&r=p0DGcdtx8-l1bvwJTLSk1zBTXpb78Y1slqHKTsTpRTE&m=-1rK1PP7u3GOjDK9_MrikSqTedxsHUf50A8UOx2ZAow&s=bADrxeYblE8QaL6xuXPkUIH4Z6BAoswihLzXx6H5zI0&e=>
>> : LoopOptimizerEndEPCallbacks)
>> (LPM2, Level
>> <https://urldefense.proofpoint.com/v2/url?u=https-3A__llvm.org_doxygen_namespacellvm-5F1-5F1PICLevel.html-23a66ddbf1bb21f90ddc44260d1ca677b6b&d=DwMFaQ&c=jf_iaSHvJObTbx-siA1ZOg&r=p0DGcdtx8-l1bvwJTLSk1zBTXpb78Y1slqHKTsTpRTE&m=-1rK1PP7u3GOjDK9_MrikSqTedxsHUf50A8UOx2ZAow&s=fDNQgJPblWk_XqJYM5QZz4ionfC0bPG1Kf26Bk09UGA&e=>
>> );
>>
>> FPM.addPass
>> <https://urldefense.proofpoint.com/v2/url?u=https-3A__llvm.org_doxygen_classllvm-5F1-5F1PassManager.html-23a314ff184ce4ace8801e1158ef909e22e&d=DwMFaQ&c=jf_iaSHvJObTbx-siA1ZOg&r=p0DGcdtx8-l1bvwJTLSk1zBTXpb78Y1slqHKTsTpRTE&m=-1rK1PP7u3GOjDK9_MrikSqTedxsHUf50A8UOx2ZAow&s=NjRAg5oFdVWwQJ99pDBjsUazROeK5TVodwW-3dKWkgE&e=>
>> (createFunctionToLoopPassAdaptor
>> <https://urldefense.proofpoint.com/v2/url?u=https-3A__llvm.org_doxygen_namespacellvm.html-23a5118c8cfac85abdec7366d89d023a1ef&d=DwMFaQ&c=jf_iaSHvJObTbx-siA1ZOg&r=p0DGcdtx8-l1bvwJTLSk1zBTXpb78Y1slqHKTsTpRTE&m=-1rK1PP7u3GOjDK9_MrikSqTedxsHUf50A8UOx2ZAow&s=Rty4O5qYeXivnVfrcKEnBtxIko71GPiTCHUxgMMk_xU&e=>
>> (
>> std::move
>> <https://urldefense.proofpoint.com/v2/url?u=https-3A__llvm.org_doxygen_lib-5F2Target-5F2ARM-5F2README-5F8txt.html-23ad3a99906764c35b2694ae90fa57744a5&d=DwMFaQ&c=jf_iaSHvJObTbx-siA1ZOg&r=p0DGcdtx8-l1bvwJTLSk1zBTXpb78Y1slqHKTsTpRTE&m=-1rK1PP7u3GOjDK9_MrikSqTedxsHUf50A8UOx2ZAow&s=yT7-RnOrw1YD9xJRj5Rpoy-BBQ8YQKdHk5n7y7FapSU&e=>(LPM2),
>> /*UseMemorySSA=*/false, /*UseBlockFrequencyInfo=*/false,
>> DebugLogging));
>> ```
>>
>> Regards,
>> Whitney Tsang
>>
>> [image: Inactive hide details for uint256_t ---2021/03/14 08:48:39
>> PM---Hello, I have a question about finding good passes for utilizin]uint256_t
>> ---2021/03/14 08:48:39 PM---Hello, I have a question about finding good
>> passes for utilizing LoopNest pass.
>>
>> From: uint256_t <konndennsa at gmail.com>
>> To: Whitney T Tsang <whitneyt at ca.ibm.com>
>> Cc: etiotto at ca.ibm.com, llvm-dev <llvm-dev at lists.llvm.org>
>> Date: 2021/03/14 08:48 PM
>> Subject: [EXTERNAL] Re: [llvm-dev] [GSoC 2021] Utilize LoopNest Pass
>> ------------------------------
>>
>>
>>
>> Hello,
>>
>> I have a question about finding good passes for utilizing LoopNest pass.
>>
>> > The LoopFullUnrollPass is not a good candidate for the change, as it is
>> a loop pass and it is being used as a loop pass.
>> Then you mean that passes which are  implemented as not a loop pass (=
>> function pass) and not already used as a loop pass are good for this
>> change?
>> I didn't get that. Could you tell me why it is?
>>
>> Thanks in advance,
>> Toshiki Maekawa
>>
>> On Fri, Mar 12, 2021, 1:20 AM uint256_t <*konndennsa at gmail.com*
>> <konndennsa at gmail.com>> wrote:
>>
>>    - Thank you for your advice. As you mentioned, LoopUnrollAndJam seems
>>    to be a good candidate.
>>    I'm going to find another analyse/transform pass suitable for loop
>>    nest pass.
>>
>>    Best,
>>    Toshiki Maekawa
>>
>>    2021年3月10日(水) 23:32 Whitney T Tsang <*whitneyt at ca.ibm.com*
>>    <whitneyt at ca.ibm.com>>:
>>    Sure, in this project, we plan to utilize the LoopNest pass in some
>>    existing passes.
>>    As an example, here is one of the patches to transform the loop
>>    interchange pass: *https://reviews.llvm.org/D97847*
>>    <https://urldefense.proofpoint.com/v2/url?u=https-3A__reviews.llvm.org_D97847&d=DwMFaQ&c=jf_iaSHvJObTbx-siA1ZOg&r=p0DGcdtx8-l1bvwJTLSk1zBTXpb78Y1slqHKTsTpRTE&m=jWroZycNsW6nd1M_1mY-ewIVdwzOlw5vCcjh1dbGSe4&s=EkAhMZOMb7Zi_Wl2c2bPJ96JVP-RJ4Pyr8TFI1w5e2g&e=>
>>    .
>>    On top of doing the code changes, we want to understand what are the
>>    pros and cons of the change.
>>    We can do that by collecting some data, e.g. compile time.
>>
>>    There are two loop unroller, LoopFullUnrollPass and LoopUnrollPass.
>>    The LoopFullUnrollPass is not a good candidate for the change, as it
>>    is a loop pass and it is being used as a loop pass.
>>    It is written to be traverse from inner to outer loop, with other
>>    loop transformations in between in the loop pipeline.
>>    The LoopUnrollPass could be a candidate, but the LoopUnrollAndJamPass
>>    can be an easier to understand candidate,
>>    as unroll and jam transformation naturally operate on more than one
>>    loop (LoopNest).
>>
>>    Regards,
>>    Whitney Tsang
>>
>>    [image: Inactive hide details for uint256_t ---2021/03/10 07:52:17
>>    AM---I'm glad to get in touch with you two. I'm planning to utilize]uint256_t
>>    ---2021/03/10 07:52:17 AM---I'm glad to get in touch with you two. I'm
>>    planning to utilize LoopNest pass for some passes like lo
>>
>>    From: uint256_t <*konndennsa at gmail.com* <konndennsa at gmail.com>>
>>    To:
>>    Cc: llvm-dev <*llvm-dev at lists.llvm.org* <llvm-dev at lists.llvm.org>>,
>>    *etiotto at ca.ibm.com* <etiotto at ca.ibm.com>, *whitneyt at ca.ibm.com*
>>    <whitneyt at ca.ibm.com>
>>    Date: 2021/03/10 07:52 AM
>>    Subject: [EXTERNAL] Re: [llvm-dev] [GSoC 2021] Utilize LoopNest Pass
>>    ------------------------------
>>
>>
>>    ZjQcmQRYFpfptBannerEnd
>>    I'm glad to get in touch with you two.
>>    I'm planning to utilize LoopNest pass for some passes like loop
>>    unrolling.
>>    Could you tell me more about this project if any?
>>
>>    2021年3月9日(火) 20:47 Whitney Tsang <*whitney.uwaterloo at gmail.com*
>>    <whitney.uwaterloo at gmail.com>>:
>>       -
>>          - + Whitney, Ettore
>>
>>          On Tue, Mar 9, 2021, 3:00 AM uint256_t via llvm-dev <
>>          *llvm-dev at lists.llvm.org* <llvm-dev at lists.llvm.org>> wrote:
>>          Hello,
>>
>>          I'm thinking of participating in GSoC at LLVM.
>>          I've already talked about ideas with some project mentors but a
>>          newly added project idea "Utilize LoopNest Pass" attracted me.
>>          I want to get in touch with its mentors (Whitney Tsang, Ettore
>>          Tiotto), whose email I couldn't find out.
>>
>>          Sincerely,
>>          Toshiki Maekawa
>>          _______________________________________________
>>          LLVM Developers mailing list
>>          *llvm-dev at lists.llvm.org* <llvm-dev at lists.llvm.org>
>>          *https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev*
>>          <https://urldefense.proofpoint.com/v2/url?u=https-3A__lists.llvm.org_cgi-2Dbin_mailman_listinfo_llvm-2Ddev&d=DwMFaQ&c=jf_iaSHvJObTbx-siA1ZOg&r=p0DGcdtx8-l1bvwJTLSk1zBTXpb78Y1slqHKTsTpRTE&m=xZta8ysMk2YLuaeN6hu48YbOcAibTj8EHetJ7EUKsC8&s=HbDn2cNobhWts-Cp8E5W7XgWSCD6ebFSWkwl_zDmusk&e=>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20210405/ce902fb3/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Image.1783ba913de308fca931.gif
Type: image/gif
Size: 105 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20210405/ce902fb3/attachment.gif>


More information about the llvm-dev mailing list