[llvm] 952dfd7 - [X86] Correct the implicit defs/uses for the MWAITX pseudo instructions.

Craig Topper via llvm-commits llvm-commits at lists.llvm.org
Sun Oct 4 15:29:12 PDT 2020


Author: Craig Topper
Date: 2020-10-04T15:28:38-07:00
New Revision: 952dfd76c6696207cc290c4f6f15d5dea5cca795

URL: https://github.com/llvm/llvm-project/commit/952dfd76c6696207cc290c4f6f15d5dea5cca795
DIFF: https://github.com/llvm/llvm-project/commit/952dfd76c6696207cc290c4f6f15d5dea5cca795.diff

LOG: [X86] Correct the implicit defs/uses for the MWAITX pseudo instructions.

MWAITX doesn't touch EFLAGS so no pseudos should def EFLAGS.

The SAVE_EBX/RBX pseudos only needs to def the EBX register that
the expansion overwrites. The EAX and ECX registers are only read.

The pseudo emitted during isel that is used by the custom inserter
shouldn't have any implicit defs or uses since everything is in
vregs.

Added: 
    

Modified: 
    llvm/lib/Target/X86/X86InstrCompiler.td

Removed: 
    


################################################################################
diff  --git a/llvm/lib/Target/X86/X86InstrCompiler.td b/llvm/lib/Target/X86/X86InstrCompiler.td
index 32686659700d..0f78b7d35aa6 100644
--- a/llvm/lib/Target/X86/X86InstrCompiler.td
+++ b/llvm/lib/Target/X86/X86InstrCompiler.td
@@ -899,7 +899,7 @@ def LCMPXCHG16B_SAVE_RBX :
 // This pseudo must be used when the frame uses RBX as
 // the base pointer.
 // cf comment for LCMPXCHG8B_SAVE_EBX.
-let Defs = [ECX, EAX, EBX, EFLAGS], Uses = [ECX, EAX, EBX],
+let Defs = [EBX], Uses = [ECX, EAX, EBX],
     Predicates = [HasMWAITX], SchedRW = [WriteSystem],
     isCodeGenOnly = 1, isPseudo = 1, Constraints = "$ebx_save = $dst" in {
 def MWAITX_SAVE_EBX :
@@ -909,7 +909,7 @@ def MWAITX_SAVE_EBX :
       []>;
 }
 // Same as MWAITX_SAVE_EBX but for the case where RBX is the base pointer.
-let Defs = [ECX, EAX, EBX, EFLAGS], Uses = [ECX, EAX, EBX],
+let Defs = [EBX], Uses = [ECX, EAX, EBX],
     Predicates = [HasMWAITX], SchedRW = [WriteSystem],
     isCodeGenOnly = 1, isPseudo = 1, Constraints = "$rbx_save = $dst" in {
 def MWAITX_SAVE_RBX :
@@ -920,13 +920,11 @@ def MWAITX_SAVE_RBX :
 }
 
 // Pseudo mwaitx instruction to use for custom insertion.
-let Defs = [ECX, EAX, EBX, EFLAGS], Uses = [ECX, EAX, EBX],
-    Predicates = [HasMWAITX], SchedRW = [WriteSystem],
+let Predicates = [HasMWAITX], SchedRW = [WriteSystem],
     isCodeGenOnly = 1, isPseudo = 1,
     usesCustomInserter = 1 in {
 def MWAITX :
-    I<0, Pseudo, (outs),
-      (ins GR32:$ecx, GR32:$eax, GR32:$ebx),
+    I<0, Pseudo, (outs), (ins GR32:$ecx, GR32:$eax, GR32:$ebx),
       "mwaitx",
       [(int_x86_mwaitx GR32:$ecx, GR32:$eax, GR32:$ebx)]>;
 }


        


More information about the llvm-commits mailing list