>> 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. Fernando
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.
> Why do you want to do this? Empty MBBs are valid, and it's probably > better to have your code handle them.Currently, that is the solution. I have a special treatment for empty basic blocks. I think the code would be more homogeneous if there were no empty basic blocks.> > There is a NOP "instruction" on x86, equivalent to XCHG EAX, EAX.The problem with xchk EAX, EAX is that is uses registers, and it would add a small burden on the register allocator. Fernando
Hello, Fernando.> The problem with xchk EAX, EAX is that is uses registers, and it would > add a small burden on the register allocator.There is "just" NOP instruction on x86. Its opcode is 0x90. -- With best regards, Anton Korobeynikov. Faculty of Mathematics & Mechanics, Saint Petersburg State University.