[PATCH] SimplifyCFG: Avoid miscompilations due to removed lifetime intrinsics

Nick Lewycky nicholas at mxc.ca
Wed Jul 30 00:46:22 PDT 2014


Rafael Ávila de Espíndola wrote:
> This is fine by me.
>
> I agree with Reid that we need to figure out what to do with  the lifetime intrinsics, but lets not miscompile code while we do that.

My proposal is that we should combine lifetime.start and lifetime.end 
into a single intrinsic that means "store undef to through this pointer" 
but doesn't get optimized away like store to undef does. The additional 
optz'n possible from having distinct start and end isn't worth it.

There's an obvious question of whether storing to undef should just work 
that way on its own. Anyone wanting to implement that should be aware 
that historically we've used store to undef as a way for passes which 
can't modify the CFG to indicate unreachable, so we'll need an answer 
for that.

Nick



More information about the llvm-commits mailing list