@@ -1785,16 +1785,9 @@ bool X86FastISel::X86SelectBranch(const Instruction *I) {
1785
1785
bool X86FastISel::X86SelectShift (const Instruction *I) {
1786
1786
unsigned CReg = 0 , OpReg = 0 ;
1787
1787
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 )) {
1798
1791
CReg = X86::CX;
1799
1792
RC = &X86::GR16RegClass;
1800
1793
switch (I->getOpcode ()) {
@@ -1839,10 +1832,10 @@ bool X86FastISel::X86SelectShift(const Instruction *I) {
1839
1832
1840
1833
// The shift instruction uses X86::CL. If we defined a super-register
1841
1834
// 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);
1846
1839
1847
1840
unsigned ResultReg = createResultReg (RC);
1848
1841
BuildMI (*FuncInfo.MBB , FuncInfo.InsertPt , DbgLoc, TII.get (OpReg), ResultReg)
0 commit comments