This is an archive of the discontinued LLVM Phabricator instance.

[X86] Remove encoding information from the TAILJMP instructions that are lowered by MCInstLowering. Fix LowerPATCHABLE_TAIL_CALL to also convert them to regular JMP/JCC instructions
ClosedPublic

Authored by craig.topper on Aug 21 2019, 2:52 PM.

Details

Summary

There are 5 instructions here that are converted from TAILJMP opcodes to regular JMP/JCC opcodes during MCInstLowering. So normally there encoding information isn't used. The exception being when XRay wraps them in PATCHABLE_TAIL_CALL.

For the ones that weren't already handled in MCInstLowering, add handling for those and remove their encoding information.

This patch fixes PATCHABLE_TAIL_CALL to do the same opcode conversion as the regular lowering patch. Then removes the encoding information.

Diff Detail

Event Timeline

craig.topper created this revision.Aug 21 2019, 2:52 PM
Herald added a project: Restricted Project. · View Herald TranscriptAug 21 2019, 2:52 PM
Herald added a subscriber: hiraditya. · View Herald Transcript
craig.topper edited the summary of this revision. (Show Details)

Handle the memory forms in MCInstLower and remove their encoding information. Change how TAILJMPr64 and TAILJMPr64_REX are handled in MCInstLower so that we change their opcodes too.

skan added a subscriber: skan.Aug 21 2019, 7:26 PM

I don't see the XRay specific changes... is there something I specifically need to look at here? Looks like the patchable tail call stuff is untouched.

craig.topper marked an inline comment as done.Aug 25 2019, 8:05 PM
craig.topper added inline comments.
llvm/lib/Target/X86/X86MCInstLower.cpp
1385

This line is the part in xray code, @dberris

dberris accepted this revision.Aug 27 2019, 2:00 AM

LGTM from the XRay parts.

llvm/lib/Target/X86/X86MCInstLower.cpp
1385

Ah, right. Thanks!

This revision is now accepted and ready to land.Aug 27 2019, 2:00 AM
This revision was automatically updated to reflect the committed changes.