This is an archive of the discontinued LLVM Phabricator instance.

[PS4] Guarantee an instruction after a 'noreturn' call
ClosedPublic

Authored by probinson on Mar 23 2016, 2:21 PM.

Details

Summary

Enable the TargetMachine's TrapUnreachable flag for PS4.

We need the "return address" of a noreturn call to be within the
bounds of the calling function; TrapUnreachable turns 'unreachable'
into a 'ud2' instruction, which has that desired effect.

(I know Reid made several attempts to remove this, months ago.
But it's still there, and we need something, so we'd like to turn it on
for PS4 as well as Windows. We'd be equally happy with a (hypothetical)
NopUnreachable, or something more specific to 'noreturn', but this is a
cheap and easy solution that meets our needs.)

Diff Detail

Repository
rL LLVM

Event Timeline

probinson updated this revision to Diff 51472.Mar 23 2016, 2:21 PM
probinson retitled this revision from to [PS4] Guarantee an instruction after a 'noreturn' call.
probinson updated this object.
probinson added a reviewer: rnk.
probinson added a subscriber: llvm-commits.
rnk accepted this revision.Mar 23 2016, 3:09 PM
rnk edited edge metadata.

lgtm, any mechanism that we use to replace TrapUnreachable should be able to handle the PS4 case just as easily.

This revision is now accepted and ready to land.Mar 23 2016, 3:09 PM
This revision was automatically updated to reflect the committed changes.