Alexandru Dura
2011-Feb-11 11:13 UTC
[LLVMdev] preserving an implicit def between basic blocks
Hi, I have the following problem: 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. Thanks, Alex -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20110211/db6fd500/attachment.html>
Jakob Stoklund Olesen
2011-Feb-11 19:51 UTC
[LLVMdev] preserving an implicit def between basic blocks
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