[LLVMdev] Implicit defs

Roman Levenstein romixlev at yahoo.com
Sat Oct 14 14:58:19 PDT 2006


Hi,

Is it possible to dynamically define implicit defs for some
instructions?
Concretely, I'd like to define a register for a return value of a call
in a dynamic way, instead of using current static approach looking
like:
 let Defs = [R0] in 
 def CALLimm :  I<...>;

The reason for this wish is that some of the calling conventions on my
target use different sets of physical registers for their return
values. Therefore I cannot describe it by one static set of regs, as
shown above.

By looking into LLVM code, I've found how to force some arguments of
calls to be placed on required registers and how to copy the result of
the call from certain (return) registers. But if I try to copy from a
return register that is not in the static Defs set of the CALL machine
instruction, then register allocator complains that the interval for a
return value of a CALL does not exist. Which means that the register
allocator does not understand that this register is implicitly defined
by the CALL insn.

One obvious solution is to define several machine instructions for a
CALL, each defining its own set of implicitly defined registers. But it
is not very elegent in my opinion. Are there any other ways to achieve
the same result? May be it can be solved simpler?

Thanks,
 -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