This is an archive of the discontinued LLVM Phabricator instance.

X86: Use MOV32r0 pseudo instead of directly emitting xor
ClosedPublic

Authored by arsenm on Jun 29 2020, 6:28 AM.

Details

Summary

This was producing reg = xor undef reg, undef reg. This looks similar
to a use of a value to define itself, and I want to disallow undef
uses for SSA virtual registers. If this were to use implicit_def,
there's no guarantee the two operands end up using the same register
(I think no guarantee exists even if the two operands start out as the
same register, but this was violated when I switched this to use an
explicit implicit_def). The MOV32r0 pseudo evidently exists to handle
this case, so use it instead. This was more work than I expected for
the 64-bit case, but I didn't see any helper for materializing a
64-bit 0.

Diff Detail

Event Timeline

arsenm created this revision.Jun 29 2020, 6:28 AM
Herald added a project: Restricted Project. · View Herald TranscriptJun 29 2020, 6:28 AM
This revision is now accepted and ready to land.Jun 29 2020, 9:39 AM