[LLVMdev] What happened to XCHG_rr?

Fernando Magno Quintao Pereira fernando at CS.UCLA.EDU
Sun Jul 20 12:54:51 PDT 2008


I was using them to do SSA-elimination after register allocation. I can 
implement swaps using three XOR's, but then the code becomes a little 
bigger and slower. I think even for the sake of completeness, the X86 
back-end should offer the possibility of swapping two registers with one 
single instruction. Do you guys think there is any possibility that those 
instructions could come back to the main trunk of LLVM?

Just as a side note, swaps are very important for SSA-based register 
allocation. If you cannot swap two live ranges atomically, then the 
problem of finding the minimum coloring becomes NP-complete, whereas it is 
linear on the size of the interference graph otherwise.

best,

Fernando

> On Jul 20, 2008, at 11:50 AM, Fernando Magno Quintao Pereira wrote:
>> I am updating from LLVM 2.1 to current trunk. The names that I was
>> using
>> in LLVM 2.1 were: XCHG8rr, XCHG16rr, XCHG32rr and XCHG64rr.
>>
>> Ps.: Evan, thank you for answering the question about IMPLICIT_DEF's.
>
> I think they were removed just because noone was using them.  Also,
> the JIT encoding may have not been correct, I don't recall.
>
> -Chris
> _______________________________________________
> LLVM Developers mailing list
> LLVMdev at cs.uiuc.edu         http://llvm.cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
>



More information about the llvm-dev mailing list