[LLVMdev] Implementing select_cc without cmov

Richard Osborne richard at xmos.com
Sun Mar 22 05:44:31 PDT 2009


someguy wrote:
> Hi All,
>
> I need to implement select_cc as a "cmp; mov rX,1; brcond cnd, END;
> mov rX,0; END:" sequence.
>
> Chris mentioned that the PPC code (as well as the x86 SSE code) does
> this, but I can't seem to find it.
>
> What I really need to kmow is how to insert the branch/label pair at
> instruction selection phase.
>
> Anyone have an example of this?
Add a pseudo instruction for the select with usesCustomDAGSchedInsteter 
= 1. Replace the pseudo instruction with the required control flow in 
the EmitInstrWithCustomInserter member of your ISelLowering class. There 
are examples of this in the MIPS or XCore backends.

-Richard





More information about the llvm-dev mailing list