[LLVMdev] Questions about instruction selection and instruction definitions

Chris Lattner sabre at nondot.org
Wed Oct 4 20:55:05 PDT 2006


On Wed, 4 Oct 2006, Roman Levenstein wrote:
>> You can add the line
>> setOperationAction(ISD::SELECT, MVT::i32, Expand);
>> to the constructor of you TargetLowering class. See the current
>> backend for an example.
>
> I actually tried it first. But then if, I remember correctly, SELECT
> nodes were expanded into something using SELECT_CC, which is also not
> supported on my target. Basically, only conditional branches are
> supported. Therefore I thought about using the LowerSelect pass. But
> I'll try again this evening. May be I was doing something wrong.
>
> What should be the result of expanding SELECT?  Some sort of
> IF-THEN-ELSE flow?

Check out how the sparc or powerpc backends handle this.  They lower to a 
select_cc pseudo-op that expands to an if/then/else control flow.

-Chris

-- 
http://nondot.org/sabre/
http://llvm.org/



More information about the llvm-dev mailing list