Skip to content
This repository was archived by the owner on Apr 23, 2020. It is now read-only.

Commit 35ac462

Browse files
committed
[X86] Remove fast-isel code for handling i8 shifts. This is handled by auto generated code.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@316797 91177308-0d34-0410-b5e6-96231b3b80d8
1 parent 8c851b5 commit 35ac462

File tree

1 file changed

+7
-14
lines changed

1 file changed

+7
-14
lines changed

lib/Target/X86/X86FastISel.cpp

Lines changed: 7 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1785,16 +1785,9 @@ bool X86FastISel::X86SelectBranch(const Instruction *I) {
17851785
bool X86FastISel::X86SelectShift(const Instruction *I) {
17861786
unsigned CReg = 0, OpReg = 0;
17871787
const TargetRegisterClass *RC = nullptr;
1788-
if (I->getType()->isIntegerTy(8)) {
1789-
CReg = X86::CL;
1790-
RC = &X86::GR8RegClass;
1791-
switch (I->getOpcode()) {
1792-
case Instruction::LShr: OpReg = X86::SHR8rCL; break;
1793-
case Instruction::AShr: OpReg = X86::SAR8rCL; break;
1794-
case Instruction::Shl: OpReg = X86::SHL8rCL; break;
1795-
default: return false;
1796-
}
1797-
} else if (I->getType()->isIntegerTy(16)) {
1788+
assert(!I->getType()->isIntegerTy(8) &&
1789+
"i8 shifts should be handled by autogenerated table");
1790+
if (I->getType()->isIntegerTy(16)) {
17981791
CReg = X86::CX;
17991792
RC = &X86::GR16RegClass;
18001793
switch (I->getOpcode()) {
@@ -1839,10 +1832,10 @@ bool X86FastISel::X86SelectShift(const Instruction *I) {
18391832

18401833
// The shift instruction uses X86::CL. If we defined a super-register
18411834
// of X86::CL, emit a subreg KILL to precisely describe what we're doing here.
1842-
if (CReg != X86::CL)
1843-
BuildMI(*FuncInfo.MBB, FuncInfo.InsertPt, DbgLoc,
1844-
TII.get(TargetOpcode::KILL), X86::CL)
1845-
.addReg(CReg, RegState::Kill);
1835+
assert(CReg != X86::CL && "CReg should be a super register of CL");
1836+
BuildMI(*FuncInfo.MBB, FuncInfo.InsertPt, DbgLoc,
1837+
TII.get(TargetOpcode::KILL), X86::CL)
1838+
.addReg(CReg, RegState::Kill);
18461839

18471840
unsigned ResultReg = createResultReg(RC);
18481841
BuildMI(*FuncInfo.MBB, FuncInfo.InsertPt, DbgLoc, TII.get(OpReg), ResultReg)

0 commit comments

Comments
 (0)