diff --git a/lib/Target/Mips/Mips16ISelDAGToDAG.cpp b/lib/Target/Mips/Mips16ISelDAGToDAG.cpp index 399bb011cd3..00b3449300c 100644 --- a/lib/Target/Mips/Mips16ISelDAGToDAG.cpp +++ b/lib/Target/Mips/Mips16ISelDAGToDAG.cpp @@ -37,26 +37,26 @@ using namespace llvm; /// Select multiply instructions. std::pair -Mips16DAGToDAGISel::SelectMULT(SDNode *N, unsigned Opc, DebugLoc dl, EVT Ty, +Mips16DAGToDAGISel::selectMULT(SDNode *N, unsigned Opc, DebugLoc DL, EVT Ty, bool HasLo, bool HasHi) { SDNode *Lo = 0, *Hi = 0; - SDNode *Mul = CurDAG->getMachineNode(Opc, dl, MVT::Glue, N->getOperand(0), + SDNode *Mul = CurDAG->getMachineNode(Opc, DL, MVT::Glue, N->getOperand(0), N->getOperand(1)); SDValue InFlag = SDValue(Mul, 0); if (HasLo) { unsigned Opcode = Mips::Mflo16; - Lo = CurDAG->getMachineNode(Opcode, dl, Ty, MVT::Glue, InFlag); + Lo = CurDAG->getMachineNode(Opcode, DL, Ty, MVT::Glue, InFlag); InFlag = SDValue(Lo, 1); } if (HasHi) { unsigned Opcode = Mips::Mfhi16; - Hi = CurDAG->getMachineNode(Opcode, dl, Ty, InFlag); + Hi = CurDAG->getMachineNode(Opcode, DL, Ty, InFlag); } return std::make_pair(Lo, Hi); } -void Mips16DAGToDAGISel::InitGlobalBaseReg(MachineFunction &MF) { +void Mips16DAGToDAGISel::initGlobalBaseReg(MachineFunction &MF) { MipsFunctionInfo *MipsFI = MF.getInfo(); if (!MipsFI->globalBaseRegSet()) @@ -87,7 +87,7 @@ void Mips16DAGToDAGISel::InitGlobalBaseReg(MachineFunction &MF) { // Insert instructions to initialize the Mips16 SP Alias register in the // first MBB of the function. // -void Mips16DAGToDAGISel::InitMips16SPAliasReg(MachineFunction &MF) { +void Mips16DAGToDAGISel::initMips16SPAliasReg(MachineFunction &MF) { MipsFunctionInfo *MipsFI = MF.getInfo(); if (!MipsFI->mips16SPAliasRegSet()) @@ -103,9 +103,9 @@ void Mips16DAGToDAGISel::InitMips16SPAliasReg(MachineFunction &MF) { .addReg(Mips::SP); } -void Mips16DAGToDAGISel::ProcessFunctionAfterISel(MachineFunction &MF) { - InitGlobalBaseReg(MF); - InitMips16SPAliasReg(MF); +void Mips16DAGToDAGISel::processFunctionAfterISel(MachineFunction &MF) { + initGlobalBaseReg(MF); + initMips16SPAliasReg(MF); } /// getMips16SPAliasReg - Output the instructions required to put the @@ -149,7 +149,7 @@ void Mips16DAGToDAGISel::getMips16SPRefReg(SDNode *Parent, SDValue &AliasReg) { } -bool Mips16DAGToDAGISel::SelectAddr16( +bool Mips16DAGToDAGISel::selectAddr16( SDNode *Parent, SDValue Addr, SDValue &Base, SDValue &Offset, SDValue &Alias) { EVT ValTy = Addr.getValueType(); @@ -228,9 +228,9 @@ bool Mips16DAGToDAGISel::SelectAddr16( /// Select instructions not customized! Used for /// expanded, promoted and normal instructions -std::pair Mips16DAGToDAGISel::SelectNode(SDNode *Node) { +std::pair Mips16DAGToDAGISel::selectNode(SDNode *Node) { unsigned Opcode = Node->getOpcode(); - DebugLoc dl = Node->getDebugLoc(); + DebugLoc DL = Node->getDebugLoc(); /// // Instruction Selection not handled by the auto-generated @@ -267,9 +267,9 @@ std::pair Mips16DAGToDAGISel::SelectNode(SDNode *Node) { EVT VT = LHS.getValueType(); unsigned Sltu_op = Mips::SltuRxRyRz16; - SDNode *Carry = CurDAG->getMachineNode(Sltu_op, dl, VT, Ops, 2); + SDNode *Carry = CurDAG->getMachineNode(Sltu_op, DL, VT, Ops, 2); unsigned Addu_op = Mips::AdduRxRyRz16; - SDNode *AddCarry = CurDAG->getMachineNode(Addu_op, dl, VT, + SDNode *AddCarry = CurDAG->getMachineNode(Addu_op, DL, VT, SDValue(Carry,0), RHS); SDNode *Result = CurDAG->SelectNodeTo(Node, MOp, VT, MVT::Glue, LHS, @@ -281,7 +281,7 @@ std::pair Mips16DAGToDAGISel::SelectNode(SDNode *Node) { case ISD::SMUL_LOHI: case ISD::UMUL_LOHI: { MultOpc = (Opcode == ISD::UMUL_LOHI ? Mips::MultuRxRy16 : Mips::MultRxRy16); - std::pair LoHi = SelectMULT(Node, MultOpc, dl, NodeTy, + std::pair LoHi = selectMULT(Node, MultOpc, DL, NodeTy, true, true); if (!SDValue(Node, 0).use_empty()) ReplaceUses(SDValue(Node, 0), SDValue(LoHi.first, 0)); @@ -295,7 +295,7 @@ std::pair Mips16DAGToDAGISel::SelectNode(SDNode *Node) { case ISD::MULHS: case ISD::MULHU: { MultOpc = (Opcode == ISD::MULHU ? Mips::MultuRxRy16 : Mips::MultRxRy16); - SDNode *Result = SelectMULT(Node, MultOpc, dl, NodeTy, false, true).second; + SDNode *Result = selectMULT(Node, MultOpc, DL, NodeTy, false, true).second; return std::make_pair(true, Result); } } diff --git a/lib/Target/Mips/Mips16ISelDAGToDAG.h b/lib/Target/Mips/Mips16ISelDAGToDAG.h index e5688d84ca4..baa85877d95 100644 --- a/lib/Target/Mips/Mips16ISelDAGToDAG.h +++ b/lib/Target/Mips/Mips16ISelDAGToDAG.h @@ -23,25 +23,25 @@ public: explicit Mips16DAGToDAGISel(MipsTargetMachine &TM) : MipsDAGToDAGISel(TM) {} private: - std::pair SelectMULT(SDNode *N, unsigned Opc, DebugLoc dl, + std::pair selectMULT(SDNode *N, unsigned Opc, DebugLoc DL, EVT Ty, bool HasLo, bool HasHi); SDValue getMips16SPAliasReg(); void getMips16SPRefReg(SDNode *Parent, SDValue &AliasReg); - virtual bool SelectAddr16(SDNode *Parent, SDValue N, SDValue &Base, + virtual bool selectAddr16(SDNode *Parent, SDValue N, SDValue &Base, SDValue &Offset, SDValue &Alias); - virtual std::pair SelectNode(SDNode *Node); + virtual std::pair selectNode(SDNode *Node); - virtual void ProcessFunctionAfterISel(MachineFunction &MF); + virtual void processFunctionAfterISel(MachineFunction &MF); // Insert instructions to initialize the global base register in the // first MBB of the function. - void InitGlobalBaseReg(MachineFunction &MF); + void initGlobalBaseReg(MachineFunction &MF); - void InitMips16SPAliasReg(MachineFunction &MF); + void initMips16SPAliasReg(MachineFunction &MF); }; FunctionPass *createMips16ISelDag(MipsTargetMachine &TM); diff --git a/lib/Target/Mips/Mips16InstrInfo.td b/lib/Target/Mips/Mips16InstrInfo.td index a9e9c52716d..629382965b4 100644 --- a/lib/Target/Mips/Mips16InstrInfo.td +++ b/lib/Target/Mips/Mips16InstrInfo.td @@ -15,7 +15,7 @@ // Mips Address // def addr16 : - ComplexPattern; + ComplexPattern; // // Address operand diff --git a/lib/Target/Mips/MipsISelDAGToDAG.cpp b/lib/Target/Mips/MipsISelDAGToDAG.cpp index 9e55c9ee09a..a0346212e72 100644 --- a/lib/Target/Mips/MipsISelDAGToDAG.cpp +++ b/lib/Target/Mips/MipsISelDAGToDAG.cpp @@ -49,7 +49,7 @@ using namespace llvm; bool MipsDAGToDAGISel::runOnMachineFunction(MachineFunction &MF) { bool Ret = SelectionDAGISel::runOnMachineFunction(MF); - ProcessFunctionAfterISel(MF); + processFunctionAfterISel(MF); return Ret; } @@ -81,7 +81,7 @@ bool MipsDAGToDAGISel::selectIntAddr(SDValue Addr, SDValue &Base, return false; } -bool MipsDAGToDAGISel::SelectAddr16(SDNode *Parent, SDValue N, SDValue &Base, +bool MipsDAGToDAGISel::selectAddr16(SDNode *Parent, SDValue N, SDValue &Base, SDValue &Offset, SDValue &Alias) { llvm_unreachable("Unimplemented function."); return false; @@ -91,7 +91,7 @@ bool MipsDAGToDAGISel::SelectAddr16(SDNode *Parent, SDValue N, SDValue &Base, /// expanded, promoted and normal instructions SDNode* MipsDAGToDAGISel::Select(SDNode *Node) { unsigned Opcode = Node->getOpcode(); - DebugLoc dl = Node->getDebugLoc(); + DebugLoc DL = Node->getDebugLoc(); EVT NodeTy = Node->getValueType(0); // Dump information about the Node being selected @@ -104,7 +104,7 @@ SDNode* MipsDAGToDAGISel::Select(SDNode *Node) { } // See if subclasses can handle this node. - std::pair Ret = SelectNode(Node); + std::pair Ret = selectNode(Node); if (Ret.first) return Ret.second; diff --git a/lib/Target/Mips/MipsISelDAGToDAG.h b/lib/Target/Mips/MipsISelDAGToDAG.h index eca89bdda18..cf0f9c58aa9 100644 --- a/lib/Target/Mips/MipsISelDAGToDAG.h +++ b/lib/Target/Mips/MipsISelDAGToDAG.h @@ -65,19 +65,19 @@ private: virtual bool selectIntAddr(SDValue Addr, SDValue &Base, SDValue &Offset) const; - virtual bool SelectAddr16(SDNode *Parent, SDValue N, SDValue &Base, + virtual bool selectAddr16(SDNode *Parent, SDValue N, SDValue &Base, SDValue &Offset, SDValue &Alias); virtual SDNode *Select(SDNode *N); - virtual std::pair SelectNode(SDNode *Node) = 0; + virtual std::pair selectNode(SDNode *Node) = 0; // getImm - Return a target constant with the specified value. inline SDValue getImm(const SDNode *Node, uint64_t Imm) { return CurDAG->getTargetConstant(Imm, Node->getValueType(0)); } - virtual void ProcessFunctionAfterISel(MachineFunction &MF) = 0; + virtual void processFunctionAfterISel(MachineFunction &MF) = 0; virtual bool SelectInlineAsmMemoryOperand(const SDValue &Op, char ConstraintCode, diff --git a/lib/Target/Mips/MipsSEISelDAGToDAG.cpp b/lib/Target/Mips/MipsSEISelDAGToDAG.cpp index 53c9e4e5929..1bc3187aaef 100644 --- a/lib/Target/Mips/MipsSEISelDAGToDAG.cpp +++ b/lib/Target/Mips/MipsSEISelDAGToDAG.cpp @@ -36,7 +36,7 @@ using namespace llvm; -bool MipsSEDAGToDAGISel::ReplaceUsesWithZeroReg(MachineRegisterInfo *MRI, +bool MipsSEDAGToDAGISel::replaceUsesWithZeroReg(MachineRegisterInfo *MRI, const MachineInstr& MI) { unsigned DstReg = 0, ZeroReg = 0; @@ -74,7 +74,7 @@ bool MipsSEDAGToDAGISel::ReplaceUsesWithZeroReg(MachineRegisterInfo *MRI, return true; } -void MipsSEDAGToDAGISel::InitGlobalBaseReg(MachineFunction &MF) { +void MipsSEDAGToDAGISel::initGlobalBaseReg(MachineFunction &MF) { MipsFunctionInfo *MipsFI = MF.getInfo(); if (!MipsFI->globalBaseRegSet()) @@ -166,34 +166,34 @@ void MipsSEDAGToDAGISel::InitGlobalBaseReg(MachineFunction &MF) { .addReg(Mips::V0).addReg(Mips::T9); } -void MipsSEDAGToDAGISel::ProcessFunctionAfterISel(MachineFunction &MF) { - InitGlobalBaseReg(MF); +void MipsSEDAGToDAGISel::processFunctionAfterISel(MachineFunction &MF) { + initGlobalBaseReg(MF); MachineRegisterInfo *MRI = &MF.getRegInfo(); for (MachineFunction::iterator MFI = MF.begin(), MFE = MF.end(); MFI != MFE; ++MFI) for (MachineBasicBlock::iterator I = MFI->begin(); I != MFI->end(); ++I) - ReplaceUsesWithZeroReg(MRI, *I); + replaceUsesWithZeroReg(MRI, *I); } /// Select multiply instructions. std::pair -MipsSEDAGToDAGISel::SelectMULT(SDNode *N, unsigned Opc, DebugLoc dl, EVT Ty, +MipsSEDAGToDAGISel::selectMULT(SDNode *N, unsigned Opc, DebugLoc DL, EVT Ty, bool HasLo, bool HasHi) { SDNode *Lo = 0, *Hi = 0; - SDNode *Mul = CurDAG->getMachineNode(Opc, dl, MVT::Glue, N->getOperand(0), + SDNode *Mul = CurDAG->getMachineNode(Opc, DL, MVT::Glue, N->getOperand(0), N->getOperand(1)); SDValue InFlag = SDValue(Mul, 0); if (HasLo) { unsigned Opcode = (Ty == MVT::i32 ? Mips::MFLO : Mips::MFLO64); - Lo = CurDAG->getMachineNode(Opcode, dl, Ty, MVT::Glue, InFlag); + Lo = CurDAG->getMachineNode(Opcode, DL, Ty, MVT::Glue, InFlag); InFlag = SDValue(Lo, 1); } if (HasHi) { unsigned Opcode = (Ty == MVT::i32 ? Mips::MFHI : Mips::MFHI64); - Hi = CurDAG->getMachineNode(Opcode, dl, Ty, InFlag); + Hi = CurDAG->getMachineNode(Opcode, DL, Ty, InFlag); } return std::make_pair(Lo, Hi); } @@ -279,9 +279,9 @@ bool MipsSEDAGToDAGISel::selectIntAddr(SDValue Addr, SDValue &Base, selectAddrDefault(Addr, Base, Offset); } -std::pair MipsSEDAGToDAGISel::SelectNode(SDNode *Node) { +std::pair MipsSEDAGToDAGISel::selectNode(SDNode *Node) { unsigned Opcode = Node->getOpcode(); - DebugLoc dl = Node->getDebugLoc(); + DebugLoc DL = Node->getDebugLoc(); /// // Instruction Selection not handled by the auto-generated @@ -319,9 +319,9 @@ std::pair MipsSEDAGToDAGISel::SelectNode(SDNode *Node) { EVT VT = LHS.getValueType(); unsigned Sltu_op = Mips::SLTu; - SDNode *Carry = CurDAG->getMachineNode(Sltu_op, dl, VT, Ops, 2); + SDNode *Carry = CurDAG->getMachineNode(Sltu_op, DL, VT, Ops, 2); unsigned Addu_op = Mips::ADDu; - SDNode *AddCarry = CurDAG->getMachineNode(Addu_op, dl, VT, + SDNode *AddCarry = CurDAG->getMachineNode(Addu_op, DL, VT, SDValue(Carry,0), RHS); Result = CurDAG->SelectNodeTo(Node, MOp, VT, MVT::Glue, LHS, @@ -337,7 +337,7 @@ std::pair MipsSEDAGToDAGISel::SelectNode(SDNode *Node) { else MultOpc = (Opcode == ISD::UMUL_LOHI ? Mips::DMULTu : Mips::DMULT); - std::pair LoHi = SelectMULT(Node, MultOpc, dl, NodeTy, + std::pair LoHi = selectMULT(Node, MultOpc, DL, NodeTy, true, true); if (!SDValue(Node, 0).use_empty()) @@ -355,7 +355,7 @@ std::pair MipsSEDAGToDAGISel::SelectNode(SDNode *Node) { if (Subtarget.hasMips32() && NodeTy == MVT::i32) break; MultOpc = NodeTy == MVT::i32 ? Mips::MULT : Mips::DMULT; - Result = SelectMULT(Node, MultOpc, dl, NodeTy, true, false).first; + Result = selectMULT(Node, MultOpc, DL, NodeTy, true, false).first; return std::make_pair(true, Result); } case ISD::MULHS: @@ -365,7 +365,7 @@ std::pair MipsSEDAGToDAGISel::SelectNode(SDNode *Node) { else MultOpc = (Opcode == ISD::MULHU ? Mips::DMULTu : Mips::DMULT); - Result = SelectMULT(Node, MultOpc, dl, NodeTy, false, true).second; + Result = selectMULT(Node, MultOpc, DL, NodeTy, false, true).second; return std::make_pair(true, Result); } @@ -373,13 +373,13 @@ std::pair MipsSEDAGToDAGISel::SelectNode(SDNode *Node) { ConstantFPSDNode *CN = dyn_cast(Node); if (Node->getValueType(0) == MVT::f64 && CN->isExactlyValue(+0.0)) { if (Subtarget.hasMips64()) { - SDValue Zero = CurDAG->getCopyFromReg(CurDAG->getEntryNode(), dl, + SDValue Zero = CurDAG->getCopyFromReg(CurDAG->getEntryNode(), DL, Mips::ZERO_64, MVT::i64); - Result = CurDAG->getMachineNode(Mips::DMTC1, dl, MVT::f64, Zero); + Result = CurDAG->getMachineNode(Mips::DMTC1, DL, MVT::f64, Zero); } else { - SDValue Zero = CurDAG->getCopyFromReg(CurDAG->getEntryNode(), dl, + SDValue Zero = CurDAG->getCopyFromReg(CurDAG->getEntryNode(), DL, Mips::ZERO, MVT::i32); - Result = CurDAG->getMachineNode(Mips::BuildPairF64, dl, MVT::f64, Zero, + Result = CurDAG->getMachineNode(Mips::BuildPairF64, DL, MVT::f64, Zero, Zero); } @@ -447,9 +447,9 @@ std::pair MipsSEDAGToDAGISel::SelectNode(SDNode *Node) { CurDAG->getMachineNode(RdhwrOpc, Node->getDebugLoc(), Node->getValueType(0), CurDAG->getRegister(SrcReg, PtrVT)); - SDValue Chain = CurDAG->getCopyToReg(CurDAG->getEntryNode(), dl, DestReg, + SDValue Chain = CurDAG->getCopyToReg(CurDAG->getEntryNode(), DL, DestReg, SDValue(Rdhwr, 0)); - SDValue ResNode = CurDAG->getCopyFromReg(Chain, dl, DestReg, PtrVT); + SDValue ResNode = CurDAG->getCopyFromReg(Chain, DL, DestReg, PtrVT); ReplaceUses(SDValue(Node, 0), ResNode); return std::make_pair(true, ResNode.getNode()); } diff --git a/lib/Target/Mips/MipsSEISelDAGToDAG.h b/lib/Target/Mips/MipsSEISelDAGToDAG.h index 11bf0660f6b..dbc6fcfc1f5 100644 --- a/lib/Target/Mips/MipsSEISelDAGToDAG.h +++ b/lib/Target/Mips/MipsSEISelDAGToDAG.h @@ -24,9 +24,9 @@ public: explicit MipsSEDAGToDAGISel(MipsTargetMachine &TM) : MipsDAGToDAGISel(TM) {} private: - bool ReplaceUsesWithZeroReg(MachineRegisterInfo *MRI, const MachineInstr&); + bool replaceUsesWithZeroReg(MachineRegisterInfo *MRI, const MachineInstr&); - std::pair SelectMULT(SDNode *N, unsigned Opc, DebugLoc dl, + std::pair selectMULT(SDNode *N, unsigned Opc, DebugLoc dl, EVT Ty, bool HasLo, bool HasHi); virtual bool selectAddrRegImm(SDValue Addr, SDValue &Base, @@ -38,13 +38,13 @@ private: virtual bool selectIntAddr(SDValue Addr, SDValue &Base, SDValue &Offset) const; - virtual std::pair SelectNode(SDNode *Node); + virtual std::pair selectNode(SDNode *Node); - virtual void ProcessFunctionAfterISel(MachineFunction &MF); + virtual void processFunctionAfterISel(MachineFunction &MF); // Insert instructions to initialize the global base register in the // first MBB of the function. - void InitGlobalBaseReg(MachineFunction &MF); + void initGlobalBaseReg(MachineFunction &MF); }; FunctionPass *createMipsSEISelDag(MipsTargetMachine &TM);