[LLVMdev] preserving an implicit def between basic blocks

Jakob Stoklund Olesen stoklund at 2pi.dk
Fri Feb 11 11:51:53 PST 2011


On Feb 11, 2011, at 3:13 AM, Alexandru Dura wrote:

> In BB0 there is an instruction that defines a flag (implicit def) and in BB1 there is one that reads the flag (implicit use). When i run llc with -O3, the instruction in BB0 that defines the flag is removed. How can i prevent this? BB0 and BB1 are consecutive basic blocks.

The SSA form of machine instructions does not support physical registers live across basic blocks.

You can mark your flag register as reserved to prevent DeadMachineInstructionElim from removing the defining instructions.

/jakob





More information about the llvm-dev mailing list