[LLVMdev] Motivation for 'select' instruction

Vladimir Prus ghost at cs.msu.su
Thu Apr 22 09:36:00 PDT 2004


Chris Lattner wrote:

> > No, not exactly. I need to find the path with the maximum execution time
> > (in assembler for specific processor). Do to so, I must also find paths
> > which cannot be executed no matter what input is (like one of the paths
> > in the C example). I'm trying to do that using LLVM intermediate
> > representation.
>
> In that case, the above is a simple straight-line sequence of code, which
> has exactly one path through it.  I don't think you should need to break
> it up into multiple paths.  If the control flow has been flattened like
> this, does it matter if some combination of predicates is impossible?

Yes, because the target processor does not have any equivivalent of the 
'select' statement. Generally speaking, I have to search for paths in 
assembler for that processor and, devise a way to map them back into LLVM and 
run analysis then, but that's more work (and research). For a start, lowering 
selects will do.

- Volodya




More information about the llvm-dev mailing list