This is an archive of the discontinued LLVM Phabricator instance.

[X86] Fix MayLoad/HasSideEffect flag for (V)MOVLPSrm instructions.
ClosedPublic

Authored by andreadb on Jul 11 2018, 6:42 AM.

Details

Summary

Before revision 336728, the "mayLoad" flag for instruction (V)MOVLPSrm was inferred directly from the "default" pattern associated with the instruction definition.

r336728 removed special node X86Movlps, and all the patterns associated to it. Now instruction (V)MOVLPSrm doesn't have a pattern associated to it, and the 'mayLoad/hasSideEffects' flags are left unset.

When the instruction info is emitted by tablegen, method CodeGenDAGPatterns::InferInstructionFlags(), sees that (V)MOVLPSrm doesn't have a pattern associated to it, and flags are undefined. So, it conservatively sets the "hasSideEffects" flag for it.

As a consequence, we were losing the 'mayLoad' flag, and we were gaining a 'hasSideEffect' flag in its place.
This patch fixes the issue (originally reported by Michael). The mca tests show the differences in the instruction info flags.
Instructions affected by this problem are: MOVLPSrm/VMOVLPSrm/VMOVLPSZ128rm.

Please let me know if okay to commit

Thanks,
Andrea

Diff Detail

Event Timeline

andreadb created this revision.Jul 11 2018, 6:42 AM
This revision is now accepted and ready to land.Jul 11 2018, 8:16 AM
This revision was automatically updated to reflect the committed changes.