<div style="line-height:1.7;color:#000000;font-size:14px;font-family:Arial"><div style="margin: 0;">Hi, </div><div style="margin: 0;">Thanks, I think the option in <span style="display: inline !important; float: none; background-color: rgb(255, 255, 255); color: rgb(0, 0, 0); font-family: arial; font-size: 14px; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; orphans: 2; overflow-wrap: break-word; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: pre-wrap; word-spacing: 0px;">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
</span></div><p style="margin: 0;"><b></b><i></i><u></u><sub></sub><sup></sup><strike></strike><br></p><p style="margin: 0;"><br></p><p style="margin: 0;"><br></p><p style="margin: 0;"><br></p><div style="position:relative;zoom:1"></div><div id="divNeteaseMailCard"></div><p style="margin: 0;"><br></p><pre><br>At 2020-03-26 22:02:41, "Michael Kruse" <cfe-dev@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@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@lists.llvm.org
>> https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev
</pre></div><br><br><span title="neteasefooter"><p> </p></span>