This is an archive of the discontinued LLVM Phabricator instance.

[BOLT] Use 32-bit MOV to zero 64-bit register in instrumentation code
ClosedPublic

Authored by Amir on Jun 3 2022, 11:39 PM.

Details

Summary

Instead of movabsq $0x0, %rax emit shorter equivalent movl $0x0, %eax.
Intel SDM, 3.4.1.1 General-Purpose Registers in 64-Bit Mode:

32-bit operands generate a 32-bit result, zero-extended to a 64-bit result in
the destination general-purpose register.

Diff Detail

Event Timeline

Amir created this revision.Jun 3 2022, 11:39 PM
Herald added a reviewer: maksfb. · View Herald Transcript
Herald added a project: Restricted Project. · View Herald Transcript
Amir updated this revision to Diff 434249.Jun 3 2022, 11:58 PM

clang-format

Amir published this revision for review.Jun 4 2022, 12:17 AM
Amir edited the summary of this revision. (Show Details)
Herald added a project: Restricted Project. · View Herald TranscriptJun 4 2022, 12:18 AM
rafauler accepted this revision.Jun 6 2022, 3:24 PM

LGTM, thanks!

This revision is now accepted and ready to land.Jun 6 2022, 3:24 PM