summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/GlobalISel/InstructionSelector.cpp
diff options
context:
space:
mode:
authorIgor Breger <igor.breger@intel.com>2017-02-22 12:25:09 +0000
committerIgor Breger <igor.breger@intel.com>2017-02-22 12:25:09 +0000
commitf7359d893af318deca46b85f2d6c0f0f533783c7 (patch)
tree08b92e8cbc965238c1b4465f9e74c722f0b3860e /llvm/lib/CodeGen/GlobalISel/InstructionSelector.cpp
parenta2fc1e0cc886df429cde9e6ac59ce3fad4419461 (diff)
downloadbcm5719-llvm-f7359d893af318deca46b85f2d6c0f0f533783c7.tar.gz
bcm5719-llvm-f7359d893af318deca46b85f2d6c0f0f533783c7.zip
[X86][GlobalISel] Initial implementation , select G_ADD gpr, gpr
Summary: Initial implementation for X86InstructionSelector. Handle selection COPY and G_ADD/G_SUB gpr, gpr . Reviewers: qcolombet, rovka, zvi, ab Reviewed By: rovka Subscribers: mgorny, dberris, kristof.beyls, llvm-commits Differential Revision: https://reviews.llvm.org/D29816 llvm-svn: 295824
Diffstat (limited to 'llvm/lib/CodeGen/GlobalISel/InstructionSelector.cpp')
-rw-r--r--llvm/lib/CodeGen/GlobalISel/InstructionSelector.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/llvm/lib/CodeGen/GlobalISel/InstructionSelector.cpp b/llvm/lib/CodeGen/GlobalISel/InstructionSelector.cpp
index 5c34da0dc55..1e1d0392483 100644
--- a/llvm/lib/CodeGen/GlobalISel/InstructionSelector.cpp
+++ b/llvm/lib/CodeGen/GlobalISel/InstructionSelector.cpp
@@ -55,6 +55,13 @@ bool InstructionSelector::constrainSelectedInstRegOperands(
// constrainOperandRegClass does that for us.
MO.setReg(constrainOperandRegClass(MF, TRI, MRI, TII, RBI, I, I.getDesc(),
Reg, OpI));
+
+ // Tie uses to defs as indicated in MCInstrDesc.
+ if (MO.isUse()) {
+ int DefIdx = I.getDesc().getOperandConstraint(OpI, MCOI::TIED_TO);
+ if (DefIdx != -1)
+ I.tieOperands(DefIdx, OpI);
+ }
}
return true;
}
OpenPOWER on IntegriCloud