This is an archive of the discontinued LLVM Phabricator instance.

[X86] Use 64-bit version of source register in LowerPATCHABLE_EVENT_CALL and LowerPATCHABLE_TYPED_EVENT_CALL
ClosedPublic

Authored by craig.topper on Oct 23 2019, 11:42 PM.

Details

Summary

The PATCHABLE_EVENT_CALL uses i32 in the intrinsic. This
results in the register allocator picking a 32-bit register. We
need to use the 64-bit register when forming the MOV64rr
instructions. Otherwise we print illegal assembly in the text
output.

I think prior to this it was impossible for SrcReg to be equal
to DstReg so the NOP code was not reachable.

While there use Register instead of unsigned.

Also add a FIXME for what looks like a bug.

Diff Detail

Event Timeline

craig.topper created this revision.Oct 23 2019, 11:42 PM
Herald added a project: Restricted Project. · View Herald TranscriptOct 23 2019, 11:42 PM
Herald added a subscriber: hiraditya. · View Herald Transcript
dberris accepted this revision.Oct 27 2019, 3:07 PM

LGTM -- thanks!

Do you have any suggestions on how to achieve what the FIXME'ed areas are attempting to do?

This revision is now accepted and ready to land.Oct 27 2019, 3:07 PM

LGTM -- thanks!

Do you have any suggestions on how to achieve what the FIXME'ed areas are attempting to do?

Could we have an X86 specific pseudo that implicitly uses the registers we want here then emit the necessary copies from virtual regs to those physical registers during instruction selection. Then the register allocator will do all the work? But would make the sled size different.

This revision was automatically updated to reflect the committed changes.