[llvm] r316797 - [X86] Remove fast-isel code for handling i8 shifts. This is handled by auto generated code.
Craig Topper via llvm-commits
llvm-commits at lists.llvm.org
Fri Oct 27 14:00:59 PDT 2017
Author: ctopper
Date: Fri Oct 27 14:00:59 2017
New Revision: 316797
URL: http://llvm.org/viewvc/llvm-project?rev=316797&view=rev
Log:
[X86] Remove fast-isel code for handling i8 shifts. This is handled by auto generated code.
Modified:
llvm/trunk/lib/Target/X86/X86FastISel.cpp
Modified: llvm/trunk/lib/Target/X86/X86FastISel.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86FastISel.cpp?rev=316797&r1=316796&r2=316797&view=diff
==============================================================================
--- llvm/trunk/lib/Target/X86/X86FastISel.cpp (original)
+++ llvm/trunk/lib/Target/X86/X86FastISel.cpp Fri Oct 27 14:00:59 2017
@@ -1785,16 +1785,9 @@ bool X86FastISel::X86SelectBranch(const
bool X86FastISel::X86SelectShift(const Instruction *I) {
unsigned CReg = 0, OpReg = 0;
const TargetRegisterClass *RC = nullptr;
- if (I->getType()->isIntegerTy(8)) {
- CReg = X86::CL;
- RC = &X86::GR8RegClass;
- switch (I->getOpcode()) {
- case Instruction::LShr: OpReg = X86::SHR8rCL; break;
- case Instruction::AShr: OpReg = X86::SAR8rCL; break;
- case Instruction::Shl: OpReg = X86::SHL8rCL; break;
- default: return false;
- }
- } else if (I->getType()->isIntegerTy(16)) {
+ assert(!I->getType()->isIntegerTy(8) &&
+ "i8 shifts should be handled by autogenerated table");
+ if (I->getType()->isIntegerTy(16)) {
CReg = X86::CX;
RC = &X86::GR16RegClass;
switch (I->getOpcode()) {
@@ -1839,10 +1832,10 @@ bool X86FastISel::X86SelectShift(const I
// The shift instruction uses X86::CL. If we defined a super-register
// of X86::CL, emit a subreg KILL to precisely describe what we're doing here.
- if (CReg != X86::CL)
- BuildMI(*FuncInfo.MBB, FuncInfo.InsertPt, DbgLoc,
- TII.get(TargetOpcode::KILL), X86::CL)
- .addReg(CReg, RegState::Kill);
+ assert(CReg != X86::CL && "CReg should be a super register of CL");
+ BuildMI(*FuncInfo.MBB, FuncInfo.InsertPt, DbgLoc,
+ TII.get(TargetOpcode::KILL), X86::CL)
+ .addReg(CReg, RegState::Kill);
unsigned ResultReg = createResultReg(RC);
BuildMI(*FuncInfo.MBB, FuncInfo.InsertPt, DbgLoc, TII.get(OpReg), ResultReg)
More information about the llvm-commits
mailing list