Question on "phi-node-folding-threshold"

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

Question on "phi-node-folding-threshold"

Kristof Beyls via cfe-dev
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
[hidden email]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev
Reply | Threaded
Open this post in threaded view
|

Re: Question on "phi-node-folding-threshold"

Kristof Beyls via cfe-dev
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 <[hidden email]> 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
[hidden email]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev

_______________________________________________
cfe-dev mailing list
[hidden email]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev
Reply | Threaded
Open this post in threaded view
|

Re: Question on "phi-node-folding-threshold"

Kristof Beyls via cfe-dev
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 <[hidden email]> 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 <[hidden email]> 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
[hidden email]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev


_______________________________________________
cfe-dev mailing list
[hidden email]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev
Reply | Threaded
Open this post in threaded view
|

Re: Question on "phi-node-folding-threshold"

Kristof Beyls via cfe-dev
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 <[hidden email]> 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 <[hidden email]> 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 <[hidden email]> 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
[hidden email]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev


_______________________________________________
cfe-dev mailing list
[hidden email]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev
Reply | Threaded
Open this post in threaded view
|

Re: Question on "phi-node-folding-threshold"

Kristof Beyls via cfe-dev
Hi Craig,

Thank you, this was useful.

John

On 19 Sep 2019, at 07:38, Craig Topper <[hidden email]> 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 <[hidden email]> 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 <[hidden email]> 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 <[hidden email]> 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
[hidden email]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev



_______________________________________________
cfe-dev mailing list
[hidden email]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev