Skip to content

Commit 952dfd7

Browse files
committed
[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.
1 parent 0db9723 commit 952dfd7

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

llvm/lib/Target/X86/X86InstrCompiler.td

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -899,7 +899,7 @@ def LCMPXCHG16B_SAVE_RBX :
899899
// This pseudo must be used when the frame uses RBX as
900900
// the base pointer.
901901
// cf comment for LCMPXCHG8B_SAVE_EBX.
902-
let Defs = [ECX, EAX, EBX, EFLAGS], Uses = [ECX, EAX, EBX],
902+
let Defs = [EBX], Uses = [ECX, EAX, EBX],
903903
Predicates = [HasMWAITX], SchedRW = [WriteSystem],
904904
isCodeGenOnly = 1, isPseudo = 1, Constraints = "$ebx_save = $dst" in {
905905
def MWAITX_SAVE_EBX :
@@ -909,7 +909,7 @@ def MWAITX_SAVE_EBX :
909909
[]>;
910910
}
911911
// Same as MWAITX_SAVE_EBX but for the case where RBX is the base pointer.
912-
let Defs = [ECX, EAX, EBX, EFLAGS], Uses = [ECX, EAX, EBX],
912+
let Defs = [EBX], Uses = [ECX, EAX, EBX],
913913
Predicates = [HasMWAITX], SchedRW = [WriteSystem],
914914
isCodeGenOnly = 1, isPseudo = 1, Constraints = "$rbx_save = $dst" in {
915915
def MWAITX_SAVE_RBX :
@@ -920,13 +920,11 @@ def MWAITX_SAVE_RBX :
920920
}
921921

922922
// Pseudo mwaitx instruction to use for custom insertion.
923-
let Defs = [ECX, EAX, EBX, EFLAGS], Uses = [ECX, EAX, EBX],
924-
Predicates = [HasMWAITX], SchedRW = [WriteSystem],
923+
let Predicates = [HasMWAITX], SchedRW = [WriteSystem],
925924
isCodeGenOnly = 1, isPseudo = 1,
926925
usesCustomInserter = 1 in {
927926
def MWAITX :
928-
I<0, Pseudo, (outs),
929-
(ins GR32:$ecx, GR32:$eax, GR32:$ebx),
927+
I<0, Pseudo, (outs), (ins GR32:$ecx, GR32:$eax, GR32:$ebx),
930928
"mwaitx",
931929
[(int_x86_mwaitx GR32:$ecx, GR32:$eax, GR32:$ebx)]>;
932930
}

0 commit comments

Comments
 (0)