Revert "[ARM] GlobalISel: Remove dead instruction selection code"

This reverts commit r303247 because the tests are failing on some bots.
Sorry!

llvm-svn: 303249
This commit is contained in:
Diana Picus 2017-05-17 11:56:07 +00:00
parent 3d8f958ec4
commit 1b6ccaefd8

View File

@ -345,10 +345,25 @@ bool ARMInstructionSelector::select(MachineInstr &I) const {
I.setDesc(TII.get(COPY));
return selectCopy(I, TII, MRI, TRI, RBI);
}
case G_ADD:
case G_GEP:
I.setDesc(TII.get(ARM::ADDrr));
MIB.add(predOps(ARMCC::AL)).add(condCodeOp());
break;
case G_SUB:
I.setDesc(TII.get(ARM::SUBrr));
MIB.add(predOps(ARMCC::AL)).add(condCodeOp());
break;
case G_MUL:
if (TII.getSubtarget().hasV6Ops()) {
I.setDesc(TII.get(ARM::MUL));
} else {
assert(TII.getSubtarget().useMulOps() && "Unsupported target");
I.setDesc(TII.get(ARM::MULv5));
MIB->getOperand(0).setIsEarlyClobber(true);
}
MIB.add(predOps(ARMCC::AL)).add(condCodeOp());
break;
case G_FRAME_INDEX:
// Add 0 to the given frame index and hope it will eventually be folded into
// the user(s).