diff options
author | Craig Topper <craig.topper@intel.com> | 2017-09-26 21:35:09 +0000 |
---|---|---|
committer | Craig Topper <craig.topper@intel.com> | 2017-09-26 21:35:09 +0000 |
commit | 7f0eeb428b0792bd11facd020028e9ed49078e85 (patch) | |
tree | b2bbfa301fe0910d79de309894e064eb04632281 /llvm/lib/Target/X86 | |
parent | ab3c0075b8f8cb9475ca8eb0e5b2af1c0575ef10 (diff) | |
download | bcm5719-llvm-7f0eeb428b0792bd11facd020028e9ed49078e85.tar.gz bcm5719-llvm-7f0eeb428b0792bd11facd020028e9ed49078e85.zip |
Recommit r314151 "[X86] Make all the NOREX CodeGenOnly instructions into postRA pseudos like the NOREX version of TEST.""
The late MOV8rr_NOREX that caused the crash has been removed.
llvm-svn: 314249
Diffstat (limited to 'llvm/lib/Target/X86')
-rw-r--r-- | llvm/lib/Target/X86/X86InstrExtension.td | 22 | ||||
-rw-r--r-- | llvm/lib/Target/X86/X86InstrInfo.cpp | 21 | ||||
-rw-r--r-- | llvm/lib/Target/X86/X86InstrInfo.td | 17 | ||||
-rw-r--r-- | llvm/lib/Target/X86/X86MCInstLower.cpp | 4 |
4 files changed, 37 insertions, 27 deletions
diff --git a/llvm/lib/Target/X86/X86InstrExtension.td b/llvm/lib/Target/X86/X86InstrExtension.td index af43d9f5332..83fbea2dd1c 100644 --- a/llvm/lib/Target/X86/X86InstrExtension.td +++ b/llvm/lib/Target/X86/X86InstrExtension.td @@ -94,26 +94,22 @@ def MOVZX32rm16: I<0xB7, MRMSrcMem, (outs GR32:$dst), (ins i16mem:$src), // These are the same as the regular MOVZX32rr8 and MOVZX32rm8 // except that they use GR32_NOREX for the output operand register class // instead of GR32. This allows them to operate on h registers on x86-64. -let hasSideEffects = 0, isCodeGenOnly = 1 in { -def MOVZX32_NOREXrr8 : I<0xB6, MRMSrcReg, +let hasSideEffects = 0, isPseudo = 1 in { +def MOVZX32_NOREXrr8 : I<0, Pseudo, (outs GR32_NOREX:$dst), (ins GR8_NOREX:$src), - "movz{bl|x}\t{$src, $dst|$dst, $src} # NOREX", - [], IIC_MOVZX>, TB, OpSize32, Sched<[WriteALU]>; + "", [], IIC_MOVZX>, Sched<[WriteALU]>; let mayLoad = 1 in -def MOVZX32_NOREXrm8 : I<0xB6, MRMSrcMem, +def MOVZX32_NOREXrm8 : I<0, Pseudo, (outs GR32_NOREX:$dst), (ins i8mem_NOREX:$src), - "movz{bl|x}\t{$src, $dst|$dst, $src} # NOREX", - [], IIC_MOVZX>, TB, OpSize32, Sched<[WriteALULd]>; + "", [], IIC_MOVZX>, Sched<[WriteALULd]>; -def MOVSX32_NOREXrr8 : I<0xBE, MRMSrcReg, +def MOVSX32_NOREXrr8 : I<0, Pseudo, (outs GR32_NOREX:$dst), (ins GR8_NOREX:$src), - "movs{bl|x}\t{$src, $dst|$dst, $src} # NOREX", - [], IIC_MOVSX>, TB, OpSize32, Sched<[WriteALU]>; + "", [], IIC_MOVSX>, Sched<[WriteALU]>; let mayLoad = 1 in -def MOVSX32_NOREXrm8 : I<0xBE, MRMSrcMem, +def MOVSX32_NOREXrm8 : I<0, Pseudo, (outs GR32_NOREX:$dst), (ins i8mem_NOREX:$src), - "movs{bl|x}\t{$src, $dst|$dst, $src} # NOREX", - [], IIC_MOVSX>, TB, OpSize32, Sched<[WriteALULd]>; + "", [], IIC_MOVSX>, Sched<[WriteALULd]>; } // MOVSX64rr8 always has a REX prefix and it has an 8-bit register diff --git a/llvm/lib/Target/X86/X86InstrInfo.cpp b/llvm/lib/Target/X86/X86InstrInfo.cpp index 04cde5e4c63..bbdba05bee6 100644 --- a/llvm/lib/Target/X86/X86InstrInfo.cpp +++ b/llvm/lib/Target/X86/X86InstrInfo.cpp @@ -7886,6 +7886,27 @@ bool X86InstrInfo::expandPostRAPseudo(MachineInstr &MI) const { case X86::VMOVUPSZ256mr_NOVLX: return expandNOVLXStore(MIB, &getRegisterInfo(), get(X86::VMOVUPSYmr), get(X86::VEXTRACTF64x4Zmr), X86::sub_ymm); + case X86::MOV8rr_NOREX: + MI.setDesc(get(X86::MOV8rr)); + return true; + case X86::MOV8rm_NOREX: + MI.setDesc(get(X86::MOV8rm)); + return true; + case X86::MOV8mr_NOREX: + MI.setDesc(get(X86::MOV8mr)); + return true; + case X86::MOVZX32_NOREXrr8: + MI.setDesc(get(X86::MOVZX32rr8)); + return true; + case X86::MOVZX32_NOREXrm8: + MI.setDesc(get(X86::MOVZX32rm8)); + return true; + case X86::MOVSX32_NOREXrr8: + MI.setDesc(get(X86::MOVSX32rr8)); + return true; + case X86::MOVSX32_NOREXrm8: + MI.setDesc(get(X86::MOVSX32rm8)); + return true; case X86::TEST8ri_NOREX: MI.setDesc(get(X86::TEST8ri)); return true; diff --git a/llvm/lib/Target/X86/X86InstrInfo.td b/llvm/lib/Target/X86/X86InstrInfo.td index 4800ac99bed..d42a6e31af4 100644 --- a/llvm/lib/Target/X86/X86InstrInfo.td +++ b/llvm/lib/Target/X86/X86InstrInfo.td @@ -1618,23 +1618,20 @@ def MOV64mr : RI<0x89, MRMDestMem, (outs), (ins i64mem:$dst, GR64:$src), // Versions of MOV8rr, MOV8mr, and MOV8rm that use i8mem_NOREX and GR8_NOREX so // that they can be used for copying and storing h registers, which can't be // encoded when a REX prefix is present. -let isCodeGenOnly = 1 in { +let isPseudo = 1 in { let hasSideEffects = 0 in -def MOV8rr_NOREX : I<0x88, MRMDestReg, +def MOV8rr_NOREX : I<0, Pseudo, (outs GR8_NOREX:$dst), (ins GR8_NOREX:$src), - "mov{b}\t{$src, $dst|$dst, $src} # NOREX", [], IIC_MOV>, - Sched<[WriteMove]>; + "", [], IIC_MOV>, Sched<[WriteMove]>; let mayStore = 1, hasSideEffects = 0 in -def MOV8mr_NOREX : I<0x88, MRMDestMem, +def MOV8mr_NOREX : I<0, Pseudo, (outs), (ins i8mem_NOREX:$dst, GR8_NOREX:$src), - "mov{b}\t{$src, $dst|$dst, $src} # NOREX", [], - IIC_MOV_MEM>, Sched<[WriteStore]>; + "", [], IIC_MOV_MEM>, Sched<[WriteStore]>; let mayLoad = 1, hasSideEffects = 0, canFoldAsLoad = 1, isReMaterializable = 1 in -def MOV8rm_NOREX : I<0x8A, MRMSrcMem, +def MOV8rm_NOREX : I<0, Pseudo, (outs GR8_NOREX:$dst), (ins i8mem_NOREX:$src), - "mov{b}\t{$src, $dst|$dst, $src} # NOREX", [], - IIC_MOV_MEM>, Sched<[WriteLoad]>; + "", [], IIC_MOV_MEM>, Sched<[WriteLoad]>; } diff --git a/llvm/lib/Target/X86/X86MCInstLower.cpp b/llvm/lib/Target/X86/X86MCInstLower.cpp index 36d81128acf..7a770d6cbc5 100644 --- a/llvm/lib/Target/X86/X86MCInstLower.cpp +++ b/llvm/lib/Target/X86/X86MCInstLower.cpp @@ -604,9 +604,7 @@ ReSimplify: // Note, we are currently not handling the following instructions: // MOV64ao8, MOV64o8a // XCHG16ar, XCHG32ar, XCHG64ar - case X86::MOV8mr_NOREX: case X86::MOV8mr: - case X86::MOV8rm_NOREX: case X86::MOV8rm: case X86::MOV16mr: case X86::MOV16rm: @@ -615,9 +613,7 @@ ReSimplify: unsigned NewOpc; switch (OutMI.getOpcode()) { default: llvm_unreachable("Invalid opcode"); - case X86::MOV8mr_NOREX: case X86::MOV8mr: NewOpc = X86::MOV8o32a; break; - case X86::MOV8rm_NOREX: case X86::MOV8rm: NewOpc = X86::MOV8ao32; break; case X86::MOV16mr: NewOpc = X86::MOV16o32a; break; case X86::MOV16rm: NewOpc = X86::MOV16ao32; break; |