[cfe-dev] Question on "phi-node-folding-threshold"

Joan Lluch via cfe-dev cfe-dev at lists.llvm.org
Fri Sep 20 04:57:21 PDT 2019


Hi Craig,

Thank you, this was useful.

John

> On 19 Sep 2019, at 07:38, Craig Topper <craig.topper at gmail.com> wrote:
> 
> You can probably force it from Clang::RenderTargetOptions. Various targets force some -mllvm options from there.
> 
> ~Craig
> 
> 
> On Wed, Sep 18, 2019 at 10:05 PM Joan Lluch <joan.lluch at icloud.com <mailto:joan.lluch at icloud.com>> wrote:
> Hi Craig,
> 
> This worked. Thank you very much.
> 
> Is there a way to specify this by default for a particular target?. I implemented a LLVM backend and added all the required code so that Clang recognises it as a target, but I’m unsure about how to deal with this particularly. Ideally, Clang should use ‘phi-node-folding-threshold=1’ automatically when my target is specified. Any suggestions are appreciated. 
> 
> Thanks again.
> 
> John
> 
> 
>> On 18 Sep 2019, at 08:34, Craig Topper <craig.topper at gmail.com <mailto:craig.topper at gmail.com>> wrote:
>> 
>> You can set it on the command line by doing "clang -mllvm -phi-node-folding-threshold=1”  The -mllvm tells clang to pass the next argument through to the command line system used by IR passes.
>> 
>> ~Craig
>> 
>> 
>> On Tue, Sep 17, 2019 at 11:05 PM Joan Lluch via cfe-dev <cfe-dev at lists.llvm.org <mailto:cfe-dev at lists.llvm.org>> wrote:
>> Hi All,
>> 
>> For a custom backend I’m developing, where jumps are not particularly expensive, I want to reduce the phi-node-folding-threshold attribute value from the default 2 to just 1, as it produces better code in my case.
>> 
>> I first tried to set the attribute as a clang command line option, but it does not seem to be available. ( I tried “clang  -phi-node-folding-threshold=1” but this returns an “unknown argument” error)  
>> 
>> However, it works as intended if I replace the default value by hard coding in it in SimplifyCFG.cpp and recompiling clang
>> 
>>  My question is, Is there a way to set that attribute to a different value for a specific target?. Or at least to set it on the command line?
>> 
>> Thanks in advance
>> 
>> John
>> _______________________________________________
>> cfe-dev mailing list
>> cfe-dev at lists.llvm.org <mailto:cfe-dev at lists.llvm.org>
>> https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev <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/20190920/e73acd4f/attachment.html>


More information about the cfe-dev mailing list