[LLVMdev] Questions about instruction selection and instruction definitions
Roman Levenstein
romixlev at yahoo.com
Thu Oct 5 01:04:04 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.
Thanks! The hint about a pseudo-op was really good. After I realized
how it works, I started the implementation of SELECT_CC using this
approach. Hopefully, I can finish it today.
Chris, may be you could provide some feedback about other questions
from the original mail? In particular about the register classes and
subclasses and about restrictions related to multiclasses? I'd be very
grateful.
-Roman
__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com
More information about the llvm-dev
mailing list