search for: optimizeselectinst

Displaying 9 results from an estimated 9 matches for "optimizeselectinst".

2019 Sep 25
2
[cfe-dev] CFG simplification question, and preservation of branching in the original code
Changing the order of the checks in CodeGenPrepare::optimizeSelectInst() sounds good to me. But you may need to go further for optimum performance. For example, we may be canonicalizing math/logic IR patterns into 'select' such as in the recent: https://reviews.llvm.org/D67799 So if you want those to become ALU ops again rather than branches, then you need t...
2019 Sep 29
2
[cfe-dev] CFG simplification question, and preservation of branching in the original code
On Sun, Sep 29, 2019 at 3:35 PM Joan Lluch via llvm-dev <llvm-dev at lists.llvm.org> wrote: > > Hi Sanjay, > > Actually, the CodeGenPrepare::optimizeSelectInst is not doing the best it could do in some circumstances: The case of “OptSize" for targets not supporting Select was already mentioned to be detrimental. > > For targets that actually have selects, but branches are cheap and generally profitable, particularly for expensive operators, the...
2019 Sep 30
3
[cfe-dev] CFG simplification question, and preservation of branching in the original code
...clear now. > > John. > > > On 29 Sep 2019, at 15:57, Roman Lebedev <lebedev.ri at gmail.com> wrote: > > On Sun, Sep 29, 2019 at 3:35 PM Joan Lluch via llvm-dev > <llvm-dev at lists.llvm.org> wrote: > > > Hi Sanjay, > > Actually, the CodeGenPrepare::optimizeSelectInst is not doing the best it could do in some circumstances: The case of “OptSize" for targets not supporting Select was already mentioned to be detrimental. > > For targets that actually have selects, but branches are cheap and generally profitable, particularly for expensive operators, the...
2019 Sep 30
2
[cfe-dev] CFG simplification question, and preservation of branching in the original code
...clear now. > > John. > > > On 29 Sep 2019, at 15:57, Roman Lebedev <lebedev.ri at gmail.com> wrote: > > On Sun, Sep 29, 2019 at 3:35 PM Joan Lluch via llvm-dev > <llvm-dev at lists.llvm.org> wrote: > > > Hi Sanjay, > > Actually, the CodeGenPrepare::optimizeSelectInst is not doing the best it > could do in some circumstances: The case of “OptSize" for targets not > supporting Select was already mentioned to be detrimental. > > For targets that actually have selects, but branches are cheap and > generally profitable, particularly for expensive...
2019 Oct 01
3
[cfe-dev] CFG simplification question, and preservation of branching in the original code
...gt; wrote: >>> >>> On Sun, Sep 29, 2019 at 3:35 PM Joan Lluch via llvm-dev >>> <llvm-dev at lists.llvm.org <mailto:llvm-dev at lists.llvm.org>> wrote: >>> >>> >>> Hi Sanjay, >>> >>> Actually, the CodeGenPrepare::optimizeSelectInst is not doing the best it could do in some circumstances: The case of “OptSize" for targets not supporting Select was already mentioned to be detrimental. >>> >>> For targets that actually have selects, but branches are cheap and generally profitable, particularly for expensi...
2020 Jan 31
2
Disabling select instructions
I agree with John; also, if you decide to go this route, you can reuse the code from CodeGenPrepare::optimizeSelectInst: https://github.com/llvm/llvm-project/blob/master/llvm/lib/CodeGen/CodeGenPrepare.cpp#L6065 Alexey On Thu, Jan 30, 2020 at 9:00 PM John Regehr via llvm-dev < llvm-dev at lists.llvm.org> wrote: > Several different passes introduce select instructions, such as > InstCombine, SimplifyC...
2019 Aug 01
2
how to generate select-free LLVM IR?
I run "clang ... --emit-llvm ....". I get LLVM IR select instructions out. I don't want select instructions, but want explicit control flow. Is there a way to do this? I'm scared of disabling the SimplifyCFG pass since it appears to do much more than just rewrite to use select statements. -------------- next part -------------- An HTML attachment was scrubbed... URL:
2019 Oct 03
2
[cfe-dev] CFG simplification question, and preservation of branching in the original code
...;>>> On Sun, Sep 29, 2019 at 3:35 PM Joan Lluch via llvm-dev >>>> <llvm-dev at lists.llvm.org <mailto:llvm-dev at lists.llvm.org>> wrote: >>>> >>>> >>>> Hi Sanjay, >>>> >>>> Actually, the CodeGenPrepare::optimizeSelectInst is not doing the best it could do in some circumstances: The case of “OptSize" for targets not supporting Select was already mentioned to be detrimental. >>>> >>>> For targets that actually have selects, but branches are cheap and generally profitable, particularly for...
2020 Jan 30
2
Disabling select instructions
Hi, I would like to know if there's a way to avoid select instructions during the IR generation. What are the optimization passes that can result in a select instruction? i.e. I want to preserve branches in my code without disabling any other optimizations applicable. For example, void foo(int* x, int* y){ if(*x > 0){ *y = *x + 10; } else{ *y = *x + 20; } }