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

Nick Lewycky nicholas at mxc.ca
Wed Jul 30 01:45:52 PDT 2014


Reid Kleckner wrote:
> On Wed, Jul 30, 2014 at 12:46 AM, Nick Lewycky <nicholas at mxc.ca
> <mailto:nicholas at mxc.ca>> wrote:
>
>     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.
>
>
> Hang on, store to undef or store undef to the pointer?  I think you mean
> storing undef to / through the pointer, in which case, I don't think we
> use that for unreachable.

Oh. Right. The intrinsic should mean store of undef. The unreachable is 
store to undef (also of undef, but that matters less).



More information about the llvm-commits mailing list