summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Target/X86/X86InstructionSelector.cpp
diff options
context:
space:
mode:
authorCraig Topper <craig.topper@intel.com>2019-04-05 19:28:09 +0000
committerCraig Topper <craig.topper@intel.com>2019-04-05 19:28:09 +0000
commit80aa2290fb02386579e5d7b0a1d8ce3691fd88da (patch)
tree1978efce308a80e3eb9b48155418940531556fb2 /llvm/lib/Target/X86/X86InstructionSelector.cpp
parent7323c2bf850b61b85252e17e6f1f73037c328378 (diff)
downloadbcm5719-llvm-80aa2290fb02386579e5d7b0a1d8ce3691fd88da.tar.gz
bcm5719-llvm-80aa2290fb02386579e5d7b0a1d8ce3691fd88da.zip
[X86] Merge the different Jcc instructions for each condition code into single instructions that store the condition code as an operand.
Summary: This avoids needing an isel pattern for each condition code. And it removes translation switches for converting between Jcc instructions and condition codes. Now the printer, encoder and disassembler take care of converting the immediate. We use InstAliases to handle the assembly matching. But we print using the asm string in the instruction definition. The instruction itself is marked IsCodeGenOnly=1 to hide it from the assembly parser. Reviewers: spatel, lebedev.ri, courbet, gchatelet, RKSimon Reviewed By: RKSimon Subscribers: MatzeB, qcolombet, eraman, hiraditya, arphaman, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D60228 llvm-svn: 357802
Diffstat (limited to 'llvm/lib/Target/X86/X86InstructionSelector.cpp')
-rw-r--r--llvm/lib/Target/X86/X86InstructionSelector.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/llvm/lib/Target/X86/X86InstructionSelector.cpp b/llvm/lib/Target/X86/X86InstructionSelector.cpp
index c105b4e63d9..61de562f8a5 100644
--- a/llvm/lib/Target/X86/X86InstructionSelector.cpp
+++ b/llvm/lib/Target/X86/X86InstructionSelector.cpp
@@ -1418,8 +1418,8 @@ bool X86InstructionSelector::selectCondBranch(MachineInstr &I,
*BuildMI(*I.getParent(), I, I.getDebugLoc(), TII.get(X86::TEST8ri))
.addReg(CondReg)
.addImm(1);
- BuildMI(*I.getParent(), I, I.getDebugLoc(), TII.get(X86::JNE_1))
- .addMBB(DestMBB);
+ BuildMI(*I.getParent(), I, I.getDebugLoc(), TII.get(X86::JCC_1))
+ .addMBB(DestMBB).addImm(X86::COND_NE);
constrainSelectedInstRegOperands(TestInst, TII, TRI, RBI);
OpenPOWER on IntegriCloud