Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[X86] Fix instr desc of CFCMOV's 'mr' variants #88970

Merged

Conversation

darkbuck
Copy link
Contributor

  • With the memory operand as the destination, 'mr' variants of CFCMOV
    works like STORE and their memory operands should be input operands
    instead of output ones.

Created using spr 1.3.4
@llvmbot
Copy link
Collaborator

llvmbot commented Apr 16, 2024

@llvm/pr-subscribers-backend-x86

Author: None (darkbuck)

Changes
  • With the memory operand as the destination, 'mr' variants of CFCMOV
    works like STORE and their memory operands should be input operands
    instead of output ones.

Full diff: https://github.com/llvm/llvm-project/pull/88970.diff

1 Files Affected:

  • (modified) llvm/lib/Target/X86/X86InstrCMovSetCC.td (+2-2)
diff --git a/llvm/lib/Target/X86/X86InstrCMovSetCC.td b/llvm/lib/Target/X86/X86InstrCMovSetCC.td
index 27a0c889a4da3e..e27aa4115990e9 100644
--- a/llvm/lib/Target/X86/X86InstrCMovSetCC.td
+++ b/llvm/lib/Target/X86/X86InstrCMovSetCC.td
@@ -58,8 +58,8 @@ let SchedRW = [WriteCMOV.Folded, WriteCMOV.ReadAfterFold] in {
 }
 let SchedRW = [WriteCMOV, ReadDefault, ReadDefault, ReadDefault, ReadDefault, ReadDefault],
     Predicates = [HasCMOV, HasCF, In64BitMode], mayStore = 1 in
-  def mr : ITy<0x40, MRMDestMemCC, t, (outs t.MemOperand:$dst),
-                (ins t.RegClass:$src1, ccode:$cond),
+  def mr : ITy<0x40, MRMDestMemCC, t, (outs),
+                (ins t.MemOperand:$dst, t.RegClass:$src1, ccode:$cond),
                 "cfcmov${cond}", unaryop_ndd_args, []>, UseEFLAGS, NF;
 }
 

Created using spr 1.3.4
@darkbuck darkbuck changed the title [X86] Fix 'mr' variants of CFCMOV instr desc [X86] Fix instr desc of CFCMOV's 'mr' variants Apr 16, 2024
@darkbuck darkbuck requested a review from XinWang10 April 16, 2024 19:34
@darkbuck
Copy link
Contributor Author

This fix is separated from the original one so that the original change to TableGen is clean.

@darkbuck darkbuck requested a review from arsenm April 16, 2024 19:41
Created using spr 1.3.4
@darkbuck darkbuck merged commit 50a3717 into main Apr 16, 2024
3 of 4 checks passed
@darkbuck darkbuck deleted the users/darkbuck/spr/x86-fix-mr-variants-of-cfcmov-instr-desc branch April 16, 2024 23:10
Copy link
Contributor

@KanRobert KanRobert left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants