>> I am in need of a no-op instruction: an instruction that does not do >> anything, and has no operands. Does LLVM predefine such an instruction? I >> want to transform the program so that there is no empty basic block. > > You can never have an empty basic block. All BBs must have a TerminatorInst. >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(). Fernando
On Fri, 13 Jul 2007, Fernando Magno Quintao Pereira wrote:>> You can never have an empty basic block. All BBs must have a TerminatorInst. >> > > 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. -Chris -- http://nondot.org/sabre/ http://llvm.org/
>> 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