This is an archive of the discontinued LLVM Phabricator instance.

[X86] Use fresh MemOps when emitting VAARG64
ClosedPublic

Authored by luke on May 31 2019, 2:41 AM.

Details

Summary

Previously it copied over MachineMemOperands verbatim which caused MOV32rm to
have store flags set, and MOV32mr to have load flags set. This fixes some assertions
being thrown with EXPENSIVE_CHECKS on.

Event Timeline

luke created this revision.May 31 2019, 2:41 AM
Herald added a project: Restricted Project. · View Herald TranscriptMay 31 2019, 2:41 AM
luke marked an inline comment as done.May 31 2019, 2:44 AM
luke added inline comments.
llvm/lib/Target/X86/X86ISelLowering.cpp
28679–28688

I'm not happy with this: It discards any volatile/other flags and seems wrong. Is there a better way of copying over the MMO but turning off specific flags?

luke marked an inline comment as not done.May 31 2019, 2:57 AM
luke updated this revision to Diff 202886.Jun 4 2019, 2:39 AM

Remember other flags when cloning

luke marked 2 inline comments as done.Jun 4 2019, 2:45 AM
luke added inline comments.
llvm/lib/Target/X86/X86ISelLowering.cpp
28679–28688

Looks like X86InstrInfo also clones MMOs a couple of times this way, I don't feel so bad now.

luke added a reviewer: sunfish.Jun 7 2019, 1:47 AM
luke marked an inline comment as done.
RKSimon added inline comments.Jun 13 2019, 2:10 AM
llvm/lib/Target/X86/X86ISelLowering.cpp
28689–28690

Would it be worth adding a new getMachineMemOperand version that just updates the flags?

luke updated this revision to Diff 204470.Jun 13 2019, 3:31 AM
  • Add getMachineMemOperand overload for setting flags
luke marked an inline comment as done.Jun 13 2019, 3:31 AM
luke updated this revision to Diff 204472.EditedJun 13 2019, 3:33 AM
  • Fix indentation
luke updated this revision to Diff 204474.Jun 13 2019, 3:34 AM
  • Remove extraneous newline
RKSimon accepted this revision.Jun 13 2019, 3:50 AM

LGTM - please pre-commit the MachineFunction.h/MachineFunction.cpp/X86InstrInfo.cpp change and then this patch's X86ISelLowering.cpp change.

This revision is now accepted and ready to land.Jun 13 2019, 3:50 AM
luke added a comment.Jun 13 2019, 4:08 AM

@RKSimon I don't have commit access, would you be able to do this?

@RKSimon I don't have commit access, would you be able to do this?

sure no problem

luke closed this revision.Jun 13 2019, 6:44 AM