[LLVMdev] Selection Condition Codes

Eli Friedman eli.friedman at gmail.com
Fri Sep 12 12:22:46 PDT 2008


On Fri, Sep 12, 2008 at 11:42 AM, Villmow, Micah <Micah.Villmow at amd.com> wrote:
> However, the
> comparison information is in the select_cc instruction and the result of
> the comparison is in the setcc instruction. What I am trying to figure
> out is using MachineInstruction/MachineBasicBlock, how I can access the
> previous/next instruction without having to use an iterator and parse
> over the whole block.
>
> Is this possible? I've put comments in the code below to help understand
> what I'm attempting to do.
>
>
> case INST::SELECT_CC:

I don't know too much about custom instruction inserters... so I don't
have any detailed comments on the code.  But how exactly are you
defining INST::SET_CC and INST::SELECT_CC?

If I'm understanding what you're trying to do correctly, the x86
backend deals with this using a custom lowering; see
X86TargetLowering::LowerSELECT in X86ISelLowering.cpp.

-Eli



More information about the llvm-dev mailing list