[LLVMdev] Selection DAG and register classes

Chris Lattner sabre at nondot.org
Mon May 15 12:27:39 PDT 2006

On Mon, 15 May 2006, Vladimir Prus wrote:
> say I have two register classes GR and AR, and a move instruction that can
> move one register to another, no matter what the class is. What's the best
> way to describe the operands DAG?
> If I just write
>   (ops GR:$src, GR:$dst)
> this will cover 1/4 of all possible combinations, and writing 4 instructions
> variants is troublesome. Is there any syntax that write something:
>  pseudo-class R32 = GR | AR;
>  (opts R32:$src, R32:$dst);

Unfortunately, no not yet.  You have to write all permutations.  There are 
several target-description/register-allocation issues that are slowly 
being addressed, this is one of them.  In the short term, writing all 
permutations is the easiest thing to do.



More information about the llvm-dev mailing list