diff options
| -rw-r--r-- | llvm/lib/Target/X86/X86InstructionSelector.cpp | 12 | ||||
| -rw-r--r-- | llvm/lib/Target/X86/X86InstructionSelector.h | 4 | ||||
| -rw-r--r-- | llvm/lib/Target/X86/X86TargetMachine.cpp | 2 | 
3 files changed, 7 insertions, 11 deletions
diff --git a/llvm/lib/Target/X86/X86InstructionSelector.cpp b/llvm/lib/Target/X86/X86InstructionSelector.cpp index 9b21ce41e05..cc9fae540c7 100644 --- a/llvm/lib/Target/X86/X86InstructionSelector.cpp +++ b/llvm/lib/Target/X86/X86InstructionSelector.cpp @@ -37,10 +37,9 @@ using namespace llvm;  #include "X86GenGlobalISel.inc" -X86InstructionSelector::X86InstructionSelector(const X86TargetMachine &TM, -                                               const X86Subtarget &STI, +X86InstructionSelector::X86InstructionSelector(const X86Subtarget &STI,                                                 const X86RegisterBankInfo &RBI) -    : InstructionSelector(), TM(TM), STI(STI), TII(*STI.getInstrInfo()), +    : InstructionSelector(), TII(*STI.getInstrInfo()),        TRI(*STI.getRegisterInfo()), RBI(RBI) {}  // FIXME: This should be target-independent, inferred from the types declared @@ -70,6 +69,7 @@ static bool selectCopy(MachineInstr &I, const TargetInstrInfo &TII,    const RegisterBank &RegBank = *RBI.getRegBank(DstReg, MRI, TRI);    const unsigned DstSize = MRI.getType(DstReg).getSizeInBits(); +  (void)DstSize;    unsigned SrcReg = I.getOperand(1).getReg();    const unsigned SrcSize = RBI.getSizeInBits(SrcReg, MRI, TRI);    (void)SrcSize; @@ -124,10 +124,8 @@ bool X86InstructionSelector::select(MachineInstr &I) const {      return true;    } -  if (I.getNumOperands() != I.getNumExplicitOperands()) { -    assert("Generic instruction has unexpected implicit operands\n"); -    return false; -  } +  assert(I.getNumOperands() == I.getNumExplicitOperands() && +         "Generic instruction has unexpected implicit operands\n");    return selectImpl(I);  } diff --git a/llvm/lib/Target/X86/X86InstructionSelector.h b/llvm/lib/Target/X86/X86InstructionSelector.h index 0a8ea3d5304..774fce1efb5 100644 --- a/llvm/lib/Target/X86/X86InstructionSelector.h +++ b/llvm/lib/Target/X86/X86InstructionSelector.h @@ -25,7 +25,7 @@ class X86TargetMachine;  class X86InstructionSelector : public InstructionSelector {  public: -  X86InstructionSelector(const X86TargetMachine &TM, const X86Subtarget &STI, +  X86InstructionSelector(const X86Subtarget &STI,                           const X86RegisterBankInfo &RBI);    bool select(MachineInstr &I) const override; @@ -35,8 +35,6 @@ private:    /// the patterns that don't require complex C++.    bool selectImpl(MachineInstr &I) const; -  const X86TargetMachine &TM; -  const X86Subtarget &STI;    const X86InstrInfo &TII;    const X86RegisterInfo &TRI;    const X86RegisterBankInfo &RBI; diff --git a/llvm/lib/Target/X86/X86TargetMachine.cpp b/llvm/lib/Target/X86/X86TargetMachine.cpp index 3f61cd8ccee..d2a3b269ea8 100644 --- a/llvm/lib/Target/X86/X86TargetMachine.cpp +++ b/llvm/lib/Target/X86/X86TargetMachine.cpp @@ -284,7 +284,7 @@ X86TargetMachine::getSubtargetImpl(const Function &F) const {      auto *RBI = new X86RegisterBankInfo(*I->getRegisterInfo());      GISel->RegBankInfo.reset(RBI); -    GISel->InstSelector.reset(new X86InstructionSelector(*this, *I, *RBI)); +    GISel->InstSelector.reset(new X86InstructionSelector(*I, *RBI));  #endif      I->setGISelAccessor(*GISel);  | 

