This is an archive of the discontinued LLVM Phabricator instance.

[X86] Remove TB_NO_REVERSE for 2 memory folding entries
ClosedPublic

Authored by skan on Mar 22 2022, 2:28 AM.

Details

Summary
X86::MMX_MOVD64from64rr -> X86::MMX_MOVQ64mr
X86::MMX_MOVD64grr -> X86::MMX_MOVD64mr

These two entries were added in llvm-svn: 372770.
I think these two should be reversable.

Diff Detail

Event Timeline

skan created this revision.Mar 22 2022, 2:28 AM
Herald added a project: Restricted Project. · View Herald TranscriptMar 22 2022, 2:28 AM
skan requested review of this revision.Mar 22 2022, 2:28 AM
Herald added a project: Restricted Project. · View Herald TranscriptMar 22 2022, 2:28 AM
skan added a comment.Mar 22 2022, 2:31 AM

These two entries were added by https://reviews.llvm.org/rGa7f27f357df8b199285b0d1882ea7eb47d39cd07

I am trying to reduce the gaps between tables in X86GenFoldTables.inc and X86InstrFoldTables.cpp, and this is one of the difference.

I would argue that the MMX_MOVD64from64rr entry should fold to MMX_MOVQ64mr since it is one by shorter to encode. And that wouldn't be reversible since MMX_MOVD64from64rr is 64-bit mode instruction and MMX_MOVQ64mr isn't.

For the other one I'm not sure what scenario it would make sense to unfold it. It would introduce an intermediate GPR register that didn't otherwise exist. But since store unfolding is never used, I guess It doesn't really matter.

I would argue that the MMX_MOVD64from64rr entry should fold to MMX_MOVQ64mr since it is one by shorter to encode. And that wouldn't be reversible since MMX_MOVD64from64rr is 64-bit mode instruction and MMX_MOVQ64mr isn't.

Fixed in D122241

skan edited the summary of this revision. (Show Details)Mar 30 2022, 7:38 PM
skan edited the summary of this revision. (Show Details)Mar 31 2022, 11:29 PM
pengfei accepted this revision.Apr 5 2022, 10:02 PM

LGTM.

This revision is now accepted and ready to land.Apr 5 2022, 10:02 PM
RKSimon accepted this revision.Apr 6 2022, 12:10 AM

LGTM

This revision was landed with ongoing or failed builds.Apr 6 2022, 2:21 AM
This revision was automatically updated to reflect the committed changes.