forked from OSchip/llvm-project
Remove a bunch of unnecessary typecasts to 'const TargetRegisterClass *'
llvm-svn: 222509
This commit is contained in:
parent
12e2e726f3
commit
61e88f44f9
|
@ -586,9 +586,8 @@ unsigned ARMFastISel::ARMMaterializeGV(const GlobalValue *GV, MVT VT) {
|
||||||
|
|
||||||
Reloc::Model RelocM = TM.getRelocationModel();
|
Reloc::Model RelocM = TM.getRelocationModel();
|
||||||
bool IsIndirect = Subtarget->GVIsIndirectSymbol(GV, RelocM);
|
bool IsIndirect = Subtarget->GVIsIndirectSymbol(GV, RelocM);
|
||||||
const TargetRegisterClass *RC = isThumb2 ?
|
const TargetRegisterClass *RC = isThumb2 ? &ARM::rGPRRegClass
|
||||||
(const TargetRegisterClass*)&ARM::rGPRRegClass :
|
: &ARM::GPRRegClass;
|
||||||
(const TargetRegisterClass*)&ARM::GPRRegClass;
|
|
||||||
unsigned DestReg = createResultReg(RC);
|
unsigned DestReg = createResultReg(RC);
|
||||||
|
|
||||||
// FastISel TLS support on non-MachO is broken, punt to SelectionDAG.
|
// FastISel TLS support on non-MachO is broken, punt to SelectionDAG.
|
||||||
|
@ -893,9 +892,8 @@ void ARMFastISel::ARMSimplifyAddress(Address &Addr, MVT VT, bool useAM3) {
|
||||||
// put the alloca address into a register, set the base type back to
|
// put the alloca address into a register, set the base type back to
|
||||||
// register and continue. This should almost never happen.
|
// register and continue. This should almost never happen.
|
||||||
if (needsLowering && Addr.BaseType == Address::FrameIndexBase) {
|
if (needsLowering && Addr.BaseType == Address::FrameIndexBase) {
|
||||||
const TargetRegisterClass *RC = isThumb2 ?
|
const TargetRegisterClass *RC = isThumb2 ? &ARM::tGPRRegClass
|
||||||
(const TargetRegisterClass*)&ARM::tGPRRegClass :
|
: &ARM::GPRRegClass;
|
||||||
(const TargetRegisterClass*)&ARM::GPRRegClass;
|
|
||||||
unsigned ResultReg = createResultReg(RC);
|
unsigned ResultReg = createResultReg(RC);
|
||||||
unsigned Opc = isThumb2 ? ARM::t2ADDri : ARM::ADDri;
|
unsigned Opc = isThumb2 ? ARM::t2ADDri : ARM::ADDri;
|
||||||
AddOptionalDefs(BuildMI(*FuncInfo.MBB, FuncInfo.InsertPt, DbgLoc,
|
AddOptionalDefs(BuildMI(*FuncInfo.MBB, FuncInfo.InsertPt, DbgLoc,
|
||||||
|
@ -1094,9 +1092,8 @@ bool ARMFastISel::ARMEmitStore(MVT VT, unsigned SrcReg, Address &Addr,
|
||||||
// This is mostly going to be Neon/vector support.
|
// This is mostly going to be Neon/vector support.
|
||||||
default: return false;
|
default: return false;
|
||||||
case MVT::i1: {
|
case MVT::i1: {
|
||||||
unsigned Res = createResultReg(isThumb2 ?
|
unsigned Res = createResultReg(isThumb2 ? &ARM::tGPRRegClass
|
||||||
(const TargetRegisterClass*)&ARM::tGPRRegClass :
|
: &ARM::GPRRegClass);
|
||||||
(const TargetRegisterClass*)&ARM::GPRRegClass);
|
|
||||||
unsigned Opc = isThumb2 ? ARM::t2ANDri : ARM::ANDri;
|
unsigned Opc = isThumb2 ? ARM::t2ANDri : ARM::ANDri;
|
||||||
SrcReg = constrainOperandRegClass(TII.get(Opc), SrcReg, 1);
|
SrcReg = constrainOperandRegClass(TII.get(Opc), SrcReg, 1);
|
||||||
AddOptionalDefs(BuildMI(*FuncInfo.MBB, FuncInfo.InsertPt, DbgLoc,
|
AddOptionalDefs(BuildMI(*FuncInfo.MBB, FuncInfo.InsertPt, DbgLoc,
|
||||||
|
@ -1500,9 +1497,8 @@ bool ARMFastISel::SelectCmp(const Instruction *I) {
|
||||||
// Now set a register based on the comparison. Explicitly set the predicates
|
// Now set a register based on the comparison. Explicitly set the predicates
|
||||||
// here.
|
// here.
|
||||||
unsigned MovCCOpc = isThumb2 ? ARM::t2MOVCCi : ARM::MOVCCi;
|
unsigned MovCCOpc = isThumb2 ? ARM::t2MOVCCi : ARM::MOVCCi;
|
||||||
const TargetRegisterClass *RC = isThumb2 ?
|
const TargetRegisterClass *RC = isThumb2 ? &ARM::rGPRRegClass
|
||||||
(const TargetRegisterClass*)&ARM::rGPRRegClass :
|
: &ARM::GPRRegClass;
|
||||||
(const TargetRegisterClass*)&ARM::GPRRegClass;
|
|
||||||
unsigned DestReg = createResultReg(RC);
|
unsigned DestReg = createResultReg(RC);
|
||||||
Constant *Zero = ConstantInt::get(Type::getInt32Ty(*Context), 0);
|
Constant *Zero = ConstantInt::get(Type::getInt32Ty(*Context), 0);
|
||||||
unsigned ZeroReg = fastMaterializeConstant(Zero);
|
unsigned ZeroReg = fastMaterializeConstant(Zero);
|
||||||
|
@ -2490,15 +2486,9 @@ bool ARMFastISel::SelectIntrinsicCall(const IntrinsicInst &I) {
|
||||||
MachineFrameInfo *MFI = FuncInfo.MF->getFrameInfo();
|
MachineFrameInfo *MFI = FuncInfo.MF->getFrameInfo();
|
||||||
MFI->setFrameAddressIsTaken(true);
|
MFI->setFrameAddressIsTaken(true);
|
||||||
|
|
||||||
unsigned LdrOpc;
|
unsigned LdrOpc = isThumb2 ? ARM::t2LDRi12 : ARM::LDRi12;
|
||||||
const TargetRegisterClass *RC;
|
const TargetRegisterClass *RC = isThumb2 ? &ARM::tGPRRegClass
|
||||||
if (isThumb2) {
|
: &ARM::GPRRegClass;
|
||||||
LdrOpc = ARM::t2LDRi12;
|
|
||||||
RC = (const TargetRegisterClass*)&ARM::tGPRRegClass;
|
|
||||||
} else {
|
|
||||||
LdrOpc = ARM::LDRi12;
|
|
||||||
RC = (const TargetRegisterClass*)&ARM::GPRRegClass;
|
|
||||||
}
|
|
||||||
|
|
||||||
const ARMBaseRegisterInfo *RegInfo =
|
const ARMBaseRegisterInfo *RegInfo =
|
||||||
static_cast<const ARMBaseRegisterInfo *>(
|
static_cast<const ARMBaseRegisterInfo *>(
|
||||||
|
|
|
@ -3129,9 +3129,8 @@ ARMTargetLowering::LowerFormalArguments(SDValue Chain,
|
||||||
else if (RegVT == MVT::v2f64)
|
else if (RegVT == MVT::v2f64)
|
||||||
RC = &ARM::QPRRegClass;
|
RC = &ARM::QPRRegClass;
|
||||||
else if (RegVT == MVT::i32)
|
else if (RegVT == MVT::i32)
|
||||||
RC = AFI->isThumb1OnlyFunction() ?
|
RC = AFI->isThumb1OnlyFunction() ? &ARM::tGPRRegClass
|
||||||
(const TargetRegisterClass*)&ARM::tGPRRegClass :
|
: &ARM::GPRRegClass;
|
||||||
(const TargetRegisterClass*)&ARM::GPRRegClass;
|
|
||||||
else
|
else
|
||||||
llvm_unreachable("RegVT not supported by FORMAL_ARGUMENTS Lowering");
|
llvm_unreachable("RegVT not supported by FORMAL_ARGUMENTS Lowering");
|
||||||
|
|
||||||
|
@ -6515,9 +6514,8 @@ SetupEntryBlockForSjLj(MachineInstr *MI, MachineBasicBlock *MBB,
|
||||||
ARMConstantPoolMBB::Create(F->getContext(), DispatchBB, PCLabelId, PCAdj);
|
ARMConstantPoolMBB::Create(F->getContext(), DispatchBB, PCLabelId, PCAdj);
|
||||||
unsigned CPI = MCP->getConstantPoolIndex(CPV, 4);
|
unsigned CPI = MCP->getConstantPoolIndex(CPV, 4);
|
||||||
|
|
||||||
const TargetRegisterClass *TRC = isThumb ?
|
const TargetRegisterClass *TRC = isThumb ? &ARM::tGPRRegClass
|
||||||
(const TargetRegisterClass*)&ARM::tGPRRegClass :
|
: &ARM::GPRRegClass;
|
||||||
(const TargetRegisterClass*)&ARM::GPRRegClass;
|
|
||||||
|
|
||||||
// Grab constant pool and fixed stack memory operands.
|
// Grab constant pool and fixed stack memory operands.
|
||||||
MachineMemOperand *CPMMO =
|
MachineMemOperand *CPMMO =
|
||||||
|
@ -6622,9 +6620,8 @@ EmitSjLjDispatchBlock(MachineInstr *MI, MachineBasicBlock *MBB) const {
|
||||||
MachineFrameInfo *MFI = MF->getFrameInfo();
|
MachineFrameInfo *MFI = MF->getFrameInfo();
|
||||||
int FI = MFI->getFunctionContextIndex();
|
int FI = MFI->getFunctionContextIndex();
|
||||||
|
|
||||||
const TargetRegisterClass *TRC = Subtarget->isThumb() ?
|
const TargetRegisterClass *TRC = Subtarget->isThumb() ? &ARM::tGPRRegClass
|
||||||
(const TargetRegisterClass*)&ARM::tGPRRegClass :
|
: &ARM::GPRnopcRegClass;
|
||||||
(const TargetRegisterClass*)&ARM::GPRnopcRegClass;
|
|
||||||
|
|
||||||
// Get a mapping of the call site numbers to all of the landing pads they're
|
// Get a mapping of the call site numbers to all of the landing pads they're
|
||||||
// associated with.
|
// associated with.
|
||||||
|
@ -7172,13 +7169,10 @@ ARMTargetLowering::EmitStructByval(MachineInstr *MI,
|
||||||
|
|
||||||
// Select the correct opcode and register class for unit size load/store
|
// Select the correct opcode and register class for unit size load/store
|
||||||
bool IsNeon = UnitSize >= 8;
|
bool IsNeon = UnitSize >= 8;
|
||||||
TRC = (IsThumb1 || IsThumb2) ? (const TargetRegisterClass *)&ARM::tGPRRegClass
|
TRC = (IsThumb1 || IsThumb2) ? &ARM::tGPRRegClass : &ARM::GPRRegClass;
|
||||||
: (const TargetRegisterClass *)&ARM::GPRRegClass;
|
|
||||||
if (IsNeon)
|
if (IsNeon)
|
||||||
VecTRC = UnitSize == 16
|
VecTRC = UnitSize == 16 ? &ARM::DPairRegClass
|
||||||
? (const TargetRegisterClass *)&ARM::DPairRegClass
|
: UnitSize == 8 ? &ARM::DPRRegClass
|
||||||
: UnitSize == 8
|
|
||||||
? (const TargetRegisterClass *)&ARM::DPRRegClass
|
|
||||||
: nullptr;
|
: nullptr;
|
||||||
|
|
||||||
unsigned BytesLeft = SizeVal % UnitSize;
|
unsigned BytesLeft = SizeVal % UnitSize;
|
||||||
|
@ -7627,9 +7621,8 @@ ARMTargetLowering::EmitInstrWithCustomInserter(MachineInstr *MI,
|
||||||
MachineRegisterInfo &MRI = Fn->getRegInfo();
|
MachineRegisterInfo &MRI = Fn->getRegInfo();
|
||||||
// In Thumb mode S must not be specified if source register is the SP or
|
// In Thumb mode S must not be specified if source register is the SP or
|
||||||
// PC and if destination register is the SP, so restrict register class
|
// PC and if destination register is the SP, so restrict register class
|
||||||
unsigned NewRsbDstReg = MRI.createVirtualRegister(isThumb2 ?
|
unsigned NewRsbDstReg =
|
||||||
(const TargetRegisterClass*)&ARM::rGPRRegClass :
|
MRI.createVirtualRegister(isThumb2 ? &ARM::rGPRRegClass : &ARM::GPRRegClass);
|
||||||
(const TargetRegisterClass*)&ARM::GPRRegClass);
|
|
||||||
|
|
||||||
// Transfer the remainder of BB and its successor edges to sinkMBB.
|
// Transfer the remainder of BB and its successor edges to sinkMBB.
|
||||||
SinkBB->splice(SinkBB->begin(), BB,
|
SinkBB->splice(SinkBB->begin(), BB,
|
||||||
|
|
|
@ -75,8 +75,7 @@ void Mips16DAGToDAGISel::initGlobalBaseReg(MachineFunction &MF) {
|
||||||
const TargetInstrInfo &TII = *MF.getSubtarget().getInstrInfo();
|
const TargetInstrInfo &TII = *MF.getSubtarget().getInstrInfo();
|
||||||
DebugLoc DL = I != MBB.end() ? I->getDebugLoc() : DebugLoc();
|
DebugLoc DL = I != MBB.end() ? I->getDebugLoc() : DebugLoc();
|
||||||
unsigned V0, V1, V2, GlobalBaseReg = MipsFI->getGlobalBaseReg();
|
unsigned V0, V1, V2, GlobalBaseReg = MipsFI->getGlobalBaseReg();
|
||||||
const TargetRegisterClass *RC =
|
const TargetRegisterClass *RC = &Mips::CPU16RegsRegClass;
|
||||||
(const TargetRegisterClass*)&Mips::CPU16RegsRegClass;
|
|
||||||
|
|
||||||
V0 = RegInfo.createVirtualRegister(RC);
|
V0 = RegInfo.createVirtualRegister(RC);
|
||||||
V1 = RegInfo.createVirtualRegister(RC);
|
V1 = RegInfo.createVirtualRegister(RC);
|
||||||
|
|
|
@ -80,13 +80,10 @@ unsigned MipsFunctionInfo::getGlobalBaseReg() {
|
||||||
|
|
||||||
const MipsSubtarget &ST = MF.getTarget().getSubtarget<MipsSubtarget>();
|
const MipsSubtarget &ST = MF.getTarget().getSubtarget<MipsSubtarget>();
|
||||||
|
|
||||||
const TargetRegisterClass *RC;
|
const TargetRegisterClass *RC =
|
||||||
if (ST.inMips16Mode())
|
ST.inMips16Mode() ? &Mips::CPU16RegsRegClass
|
||||||
RC=(const TargetRegisterClass*)&Mips::CPU16RegsRegClass;
|
: ST.isABI_N64() ? &Mips::GPR64RegClass
|
||||||
else
|
: &Mips::GPR32RegClass;
|
||||||
RC = ST.isABI_N64() ?
|
|
||||||
(const TargetRegisterClass*)&Mips::GPR64RegClass :
|
|
||||||
(const TargetRegisterClass*)&Mips::GPR32RegClass;
|
|
||||||
return GlobalBaseReg = MF.getRegInfo().createVirtualRegister(RC);
|
return GlobalBaseReg = MF.getRegInfo().createVirtualRegister(RC);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -98,8 +95,7 @@ unsigned MipsFunctionInfo::getMips16SPAliasReg() {
|
||||||
if (Mips16SPAliasReg)
|
if (Mips16SPAliasReg)
|
||||||
return Mips16SPAliasReg;
|
return Mips16SPAliasReg;
|
||||||
|
|
||||||
const TargetRegisterClass *RC;
|
const TargetRegisterClass *RC = &Mips::CPU16RegsRegClass;
|
||||||
RC=(const TargetRegisterClass*)&Mips::CPU16RegsRegClass;
|
|
||||||
return Mips16SPAliasReg = MF.getRegInfo().createVirtualRegister(RC);
|
return Mips16SPAliasReg = MF.getRegInfo().createVirtualRegister(RC);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -135,10 +135,7 @@ void MipsSEDAGToDAGISel::initGlobalBaseReg(MachineFunction &MF) {
|
||||||
unsigned V0, V1, GlobalBaseReg = MipsFI->getGlobalBaseReg();
|
unsigned V0, V1, GlobalBaseReg = MipsFI->getGlobalBaseReg();
|
||||||
const TargetRegisterClass *RC;
|
const TargetRegisterClass *RC;
|
||||||
|
|
||||||
if (Subtarget->isABI_N64())
|
RC = (Subtarget->isABI_N64()) ? &Mips::GPR64RegClass : &Mips::GPR32RegClass;
|
||||||
RC = (const TargetRegisterClass*)&Mips::GPR64RegClass;
|
|
||||||
else
|
|
||||||
RC = (const TargetRegisterClass*)&Mips::GPR32RegClass;
|
|
||||||
|
|
||||||
V0 = RegInfo.createVirtualRegister(RC);
|
V0 = RegInfo.createVirtualRegister(RC);
|
||||||
V1 = RegInfo.createVirtualRegister(RC);
|
V1 = RegInfo.createVirtualRegister(RC);
|
||||||
|
|
|
@ -6621,9 +6621,8 @@ PPCTargetLowering::EmitAtomicBinary(MachineInstr *MI, MachineBasicBlock *BB,
|
||||||
|
|
||||||
MachineRegisterInfo &RegInfo = F->getRegInfo();
|
MachineRegisterInfo &RegInfo = F->getRegInfo();
|
||||||
unsigned TmpReg = (!BinOpcode) ? incr :
|
unsigned TmpReg = (!BinOpcode) ? incr :
|
||||||
RegInfo.createVirtualRegister(
|
RegInfo.createVirtualRegister( is64bit ? &PPC::G8RCRegClass
|
||||||
is64bit ? (const TargetRegisterClass *) &PPC::G8RCRegClass :
|
: &PPC::GPRCRegClass);
|
||||||
(const TargetRegisterClass *) &PPC::GPRCRegClass);
|
|
||||||
|
|
||||||
// thisMBB:
|
// thisMBB:
|
||||||
// ...
|
// ...
|
||||||
|
@ -6689,9 +6688,8 @@ PPCTargetLowering::EmitPartwordAtomicBinary(MachineInstr *MI,
|
||||||
exitMBB->transferSuccessorsAndUpdatePHIs(BB);
|
exitMBB->transferSuccessorsAndUpdatePHIs(BB);
|
||||||
|
|
||||||
MachineRegisterInfo &RegInfo = F->getRegInfo();
|
MachineRegisterInfo &RegInfo = F->getRegInfo();
|
||||||
const TargetRegisterClass *RC =
|
const TargetRegisterClass *RC = is64bit ? &PPC::G8RCRegClass
|
||||||
is64bit ? (const TargetRegisterClass *) &PPC::G8RCRegClass :
|
: &PPC::GPRCRegClass;
|
||||||
(const TargetRegisterClass *) &PPC::GPRCRegClass;
|
|
||||||
unsigned PtrReg = RegInfo.createVirtualRegister(RC);
|
unsigned PtrReg = RegInfo.createVirtualRegister(RC);
|
||||||
unsigned Shift1Reg = RegInfo.createVirtualRegister(RC);
|
unsigned Shift1Reg = RegInfo.createVirtualRegister(RC);
|
||||||
unsigned ShiftReg = RegInfo.createVirtualRegister(RC);
|
unsigned ShiftReg = RegInfo.createVirtualRegister(RC);
|
||||||
|
@ -7309,9 +7307,8 @@ PPCTargetLowering::EmitInstrWithCustomInserter(MachineInstr *MI,
|
||||||
exitMBB->transferSuccessorsAndUpdatePHIs(BB);
|
exitMBB->transferSuccessorsAndUpdatePHIs(BB);
|
||||||
|
|
||||||
MachineRegisterInfo &RegInfo = F->getRegInfo();
|
MachineRegisterInfo &RegInfo = F->getRegInfo();
|
||||||
const TargetRegisterClass *RC =
|
const TargetRegisterClass *RC = is64bit ? &PPC::G8RCRegClass
|
||||||
is64bit ? (const TargetRegisterClass *) &PPC::G8RCRegClass :
|
: &PPC::GPRCRegClass;
|
||||||
(const TargetRegisterClass *) &PPC::GPRCRegClass;
|
|
||||||
unsigned PtrReg = RegInfo.createVirtualRegister(RC);
|
unsigned PtrReg = RegInfo.createVirtualRegister(RC);
|
||||||
unsigned Shift1Reg = RegInfo.createVirtualRegister(RC);
|
unsigned Shift1Reg = RegInfo.createVirtualRegister(RC);
|
||||||
unsigned ShiftReg = RegInfo.createVirtualRegister(RC);
|
unsigned ShiftReg = RegInfo.createVirtualRegister(RC);
|
||||||
|
|
|
@ -2065,9 +2065,8 @@ bool X86FastISel::X86SelectTrunc(const Instruction *I) {
|
||||||
if (!Subtarget->is64Bit()) {
|
if (!Subtarget->is64Bit()) {
|
||||||
// If we're on x86-32; we can't extract an i8 from a general register.
|
// If we're on x86-32; we can't extract an i8 from a general register.
|
||||||
// First issue a copy to GR16_ABCD or GR32_ABCD.
|
// First issue a copy to GR16_ABCD or GR32_ABCD.
|
||||||
const TargetRegisterClass *CopyRC = (SrcVT == MVT::i16) ?
|
const TargetRegisterClass *CopyRC =
|
||||||
(const TargetRegisterClass*)&X86::GR16_ABCDRegClass :
|
(SrcVT == MVT::i16) ? &X86::GR16_ABCDRegClass : &X86::GR32_ABCDRegClass;
|
||||||
(const TargetRegisterClass*)&X86::GR32_ABCDRegClass;
|
|
||||||
unsigned CopyReg = createResultReg(CopyRC);
|
unsigned CopyReg = createResultReg(CopyRC);
|
||||||
BuildMI(*FuncInfo.MBB, FuncInfo.InsertPt, DbgLoc, TII.get(TargetOpcode::COPY),
|
BuildMI(*FuncInfo.MBB, FuncInfo.InsertPt, DbgLoc, TII.get(TargetOpcode::COPY),
|
||||||
CopyReg).addReg(InputReg);
|
CopyReg).addReg(InputReg);
|
||||||
|
|
Loading…
Reference in New Issue