[cfe-dev] how does clang control whether the unroll-loop pass work or not by default?

林政宗 via cfe-dev cfe-dev at lists.llvm.org
Thu Mar 26 19:43:52 PDT 2020


Hi, 
Thanks, I think the option in PassManagerBuilder.cpp controls the loop-unroll pass in llvm. Is there a loop-unroll pass or loop-unroll function in clang that will unroll loops in frontend and the generated llvm IR by clang is the unrolled version? and if there is one, how does clang control it? Thanks in advance. Best regards, Jerry

















At 2020-03-26 22:02:41, "Michael Kruse" <cfe-dev at meinersbur.de> wrote:
>For the legacy pass manager (the default), the code can be found in
>lib/Transforms/IPO/PassManagerBuilder.cpp, function
>PassManagerBuilder::populateModulePassManager
>
>Michael
>
>Am Do., 26. März 2020 um 08:03 Uhr schrieb 林政宗 via cfe-dev
><cfe-dev at lists.llvm.org>:
>>
>> Hi, there.
>>
>> I want to figure out how the unroll-loop pass is controlled by clang. which option or struct in the source code tell the unroll-loop pass to work or not to work?
>> include/clang/Basic/CodeGenOptions.def
>> ----------------------------------------------------------------------------------------
>> CODEGENOPT(UnrollLoops       , 1, 1) ///< Control whether loops are unrolled.
>> -----------------------------------------------------------------------------------------
>> I tried to modify the above option. The second "1" is "0" initially. I modified the original "0" to "1". But clang would do the unroll-loop pass whether it is "0" or "1".
>> I wonder how clang instructs the unroll-loop pass to work or not to work?
>>
>> Thanks,
>> Jerry
>>
>>
>>
>>
>>
>> _______________________________________________
>> cfe-dev mailing list
>> cfe-dev at lists.llvm.org
>> https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20200327/9c0d1c23/attachment.html>


More information about the cfe-dev mailing list