This is an archive of the discontinued LLVM Phabricator instance.

[X86] make sure POP has implicit def/use of stack pointer when materializing 8-bit immediates for minsize
ClosedPublic

Authored by ychen on Mar 29 2020, 9:22 PM.

Details

Summary

Otherwise PostRA list scheduler may reorder instruction, such as

schedule this
'''
pushq $0x8
pop %rbx
lea 0x2a0(%rsp),%r15
'''
to
'''
pushq $0x8
lea 0x2a0(%rsp),%r15
pop %rbx
'''
by mistake. The patch is to prevent this to happen by making sure POP has
implicit use of SP.

Diff Detail

Event Timeline

ychen created this revision.Mar 29 2020, 9:22 PM
Herald added a project: Restricted Project. · View Herald TranscriptMar 29 2020, 9:22 PM
This revision is now accepted and ready to land.Mar 29 2020, 11:32 PM