[LLVMdev] NO-OP

Dale Johannesen dalej at apple.com
Fri Jul 13 11:33:46 PDT 2007


On Jul 13, 2007, at 10:53 AM, Fernando Magno Quintao Pereira wrote:

>
>>> I've built a pass to split critical edges of machine functions,  
>>> and I have
>>> to insert new basic blocks. Some of them will have MBB->begin() ==
>>> MBB->end().
>>
>> Ah, machine basic blocks are different.  They *are* allowed to be  
>> empty.
>>
>
> I would like to build an "insertNoOp" and add it to MRegisterInfo.  
> I would
> have one for each target. For the x86 I am moving the stack pointer to
> itself. Is there a better "no-op"? A better one would be one that  
> does not
> use any register, so it will add absolutely no burden on the register
> allocator.

Why do you want to do this?  Empty MBBs are valid, and it's probably
better to have your code handle them.

There is a NOP "instruction" on x86, equivalent to XCHG EAX, EAX.




More information about the llvm-dev mailing list