Fix coding style violations. Remove white spaces and tabs.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@158471 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Akira Hatanaka 2012-06-14 21:10:56 +00:00
parent 1418045472
commit 864f66085c
18 changed files with 91 additions and 91 deletions

View File

@ -115,7 +115,8 @@ public:
CurVal |= (uint64_t)((uint8_t)Data[Offset + Idx]) << (i*8); CurVal |= (uint64_t)((uint8_t)Data[Offset + Idx]) << (i*8);
} }
uint64_t Mask = ((uint64_t)(-1) >> (64 - getFixupKindInfo(Kind).TargetSize)); uint64_t Mask = ((uint64_t)(-1) >>
(64 - getFixupKindInfo(Kind).TargetSize));
CurVal |= Value & Mask; CurVal |= Value & Mask;
// Write out the fixed up bytes back to the code/data bits. // Write out the fixed up bytes back to the code/data bits.

View File

@ -187,7 +187,7 @@ void MipsELFObjectWriter::sortRelocs(const MCAssembler &Asm,
// Call the defualt function first. Relocations are sorted in descending // Call the defualt function first. Relocations are sorted in descending
// order of r_offset. // order of r_offset.
MCELFObjectTargetWriter::sortRelocs(Asm, Relocs); MCELFObjectTargetWriter::sortRelocs(Asm, Relocs);
RelLs RelocLs; RelLs RelocLs;
std::vector<RelLsIter> Unmatched; std::vector<RelLsIter> Unmatched;

View File

@ -181,7 +181,7 @@ getMachineOpValue(const MCInst &MI, const MCOperand &MO,
} else if (MO.isFPImm()) { } else if (MO.isFPImm()) {
return static_cast<unsigned>(APFloat(MO.getFPImm()) return static_cast<unsigned>(APFloat(MO.getFPImm())
.bitcastToAPInt().getHiBits(32).getLimitedValue()); .bitcastToAPInt().getHiBits(32).getLimitedValue());
} }
// MO must be an Expr. // MO must be an Expr.
assert(MO.isExpr()); assert(MO.isExpr());
@ -195,7 +195,7 @@ getMachineOpValue(const MCInst &MI, const MCOperand &MO,
} }
assert (Kind == MCExpr::SymbolRef); assert (Kind == MCExpr::SymbolRef);
Mips::Fixups FixupKind = Mips::Fixups(0); Mips::Fixups FixupKind = Mips::Fixups(0);
switch(cast<MCSymbolRefExpr>(Expr)->getKind()) { switch(cast<MCSymbolRefExpr>(Expr)->getKind()) {

View File

@ -386,7 +386,7 @@ void MipsAsmPrinter::printOperand(const MachineInstr *MI, int opNum,
break; break;
case MachineOperand::MO_BlockAddress: { case MachineOperand::MO_BlockAddress: {
MCSymbol* BA = GetBlockAddressSymbol(MO.getBlockAddress()); MCSymbol *BA = GetBlockAddressSymbol(MO.getBlockAddress());
O << BA->getName(); O << BA->getName();
break; break;
} }
@ -447,7 +447,7 @@ printMemOperandEA(const MachineInstr *MI, int opNum, raw_ostream &O) {
void MipsAsmPrinter:: void MipsAsmPrinter::
printFCCOperand(const MachineInstr *MI, int opNum, raw_ostream &O, printFCCOperand(const MachineInstr *MI, int opNum, raw_ostream &O,
const char *Modifier) { const char *Modifier) {
const MachineOperand& MO = MI->getOperand(opNum); const MachineOperand &MO = MI->getOperand(opNum);
O << Mips::MipsFCCToString((Mips::CondCode)MO.getImm()); O << Mips::MipsFCCToString((Mips::CondCode)MO.getImm());
} }

View File

@ -76,14 +76,14 @@ namespace {
InstrIter candidate); InstrIter candidate);
void insertCallUses(InstrIter MI, void insertCallUses(InstrIter MI,
SmallSet<unsigned, 32>& RegDefs, SmallSet<unsigned, 32> &RegDefs,
SmallSet<unsigned, 32>& RegUses); SmallSet<unsigned, 32> &RegUses);
void insertDefsUses(InstrIter MI, void insertDefsUses(InstrIter MI,
SmallSet<unsigned, 32>& RegDefs, SmallSet<unsigned, 32> &RegDefs,
SmallSet<unsigned, 32>& RegUses); SmallSet<unsigned, 32> &RegUses);
bool IsRegInSet(SmallSet<unsigned, 32>& RegSet, bool IsRegInSet(SmallSet<unsigned, 32> &RegSet,
unsigned Reg); unsigned Reg);
bool delayHasHazard(InstrIter candidate, bool delayHasHazard(InstrIter candidate,
@ -230,8 +230,8 @@ bool Filler::delayHasHazard(InstrIter candidate,
// Insert Defs and Uses of MI into the sets RegDefs and RegUses. // Insert Defs and Uses of MI into the sets RegDefs and RegUses.
void Filler::insertDefsUses(InstrIter MI, void Filler::insertDefsUses(InstrIter MI,
SmallSet<unsigned, 32>& RegDefs, SmallSet<unsigned, 32> &RegDefs,
SmallSet<unsigned, 32>& RegUses) { SmallSet<unsigned, 32> &RegUses) {
// If MI is a call or return, just examine the explicit non-variadic operands. // If MI is a call or return, just examine the explicit non-variadic operands.
MCInstrDesc MCID = MI->getDesc(); MCInstrDesc MCID = MI->getDesc();
unsigned e = MI->isCall() || MI->isReturn() ? MCID.getNumOperands() : unsigned e = MI->isCall() || MI->isReturn() ? MCID.getNumOperands() :
@ -256,7 +256,7 @@ void Filler::insertDefsUses(InstrIter MI,
} }
//returns true if the Reg or its alias is in the RegSet. //returns true if the Reg or its alias is in the RegSet.
bool Filler::IsRegInSet(SmallSet<unsigned, 32>& RegSet, unsigned Reg) { bool Filler::IsRegInSet(SmallSet<unsigned, 32> &RegSet, unsigned Reg) {
// Check Reg and all aliased Registers. // Check Reg and all aliased Registers.
for (MCRegAliasIterator AI(Reg, TM.getRegisterInfo(), true); for (MCRegAliasIterator AI(Reg, TM.getRegisterInfo(), true);
AI.isValid(); ++AI) AI.isValid(); ++AI)

View File

@ -248,7 +248,7 @@ void MipsFrameLowering::emitEpilogue(MachineFunction &MF,
void MipsFrameLowering:: void MipsFrameLowering::
processFunctionBeforeCalleeSavedScan(MachineFunction &MF, processFunctionBeforeCalleeSavedScan(MachineFunction &MF,
RegScavenger *RS) const { RegScavenger *RS) const {
MachineRegisterInfo& MRI = MF.getRegInfo(); MachineRegisterInfo &MRI = MF.getRegInfo();
unsigned FP = STI.isABI_N64() ? Mips::FP_64 : Mips::FP; unsigned FP = STI.isABI_N64() ? Mips::FP_64 : Mips::FP;
// FIXME: remove this code if register allocator can correctly mark // FIXME: remove this code if register allocator can correctly mark

View File

@ -144,7 +144,8 @@ void MipsDAGToDAGISel::InitGlobalBaseReg(MachineFunction &MF) {
const GlobalValue *FName = MF.getFunction(); const GlobalValue *FName = MF.getFunction();
BuildMI(MBB, I, DL, TII.get(Mips::LUi64), V0) BuildMI(MBB, I, DL, TII.get(Mips::LUi64), V0)
.addGlobalAddress(FName, 0, MipsII::MO_GPOFF_HI); .addGlobalAddress(FName, 0, MipsII::MO_GPOFF_HI);
BuildMI(MBB, I, DL, TII.get(Mips::DADDu), V1).addReg(V0).addReg(Mips::T9_64); BuildMI(MBB, I, DL, TII.get(Mips::DADDu), V1).addReg(V0)
.addReg(Mips::T9_64);
BuildMI(MBB, I, DL, TII.get(Mips::DADDiu), GlobalBaseReg).addReg(V1) BuildMI(MBB, I, DL, TII.get(Mips::DADDiu), GlobalBaseReg).addReg(V1)
.addGlobalAddress(FName, 0, MipsII::MO_GPOFF_LO); .addGlobalAddress(FName, 0, MipsII::MO_GPOFF_LO);
MII->storeRegToStackSlot(MBB, I, GlobalBaseReg, false, FI, RC, MII->storeRegToStackSlot(MBB, I, GlobalBaseReg, false, FI, RC,
@ -281,7 +282,7 @@ SelectAddr(SDNode *Parent, SDValue Addr, SDValue &Base, SDValue &Offset) {
// If Parent is an unaligned f32 load or store, select a (base + index) // If Parent is an unaligned f32 load or store, select a (base + index)
// floating point load/store instruction (luxc1 or suxc1). // floating point load/store instruction (luxc1 or suxc1).
const LSBaseSDNode* LS = 0; const LSBaseSDNode *LS = 0;
if (Parent && (LS = dyn_cast<LSBaseSDNode>(Parent))) { if (Parent && (LS = dyn_cast<LSBaseSDNode>(Parent))) {
EVT VT = LS->getMemoryVT(); EVT VT = LS->getMemoryVT();
@ -352,7 +353,8 @@ SelectAddr(SDNode *Parent, SDValue Addr, SDValue &Base, SDValue &Offset) {
} }
// If an indexed floating point load/store can be emitted, return false. // If an indexed floating point load/store can be emitted, return false.
if (LS && (LS->getMemoryVT() == MVT::f32 || LS->getMemoryVT() == MVT::f64) && if (LS &&
(LS->getMemoryVT() == MVT::f32 || LS->getMemoryVT() == MVT::f64) &&
Subtarget.hasMips32r2Or64()) Subtarget.hasMips32r2Or64())
return false; return false;
} }

View File

@ -334,17 +334,17 @@ EVT MipsTargetLowering::getSetCCResultType(EVT VT) const {
// Lo0: initial value of Lo register // Lo0: initial value of Lo register
// Hi0: initial value of Hi register // Hi0: initial value of Hi register
// Return true if pattern matching was successful. // Return true if pattern matching was successful.
static bool SelectMadd(SDNode* ADDENode, SelectionDAG* CurDAG) { static bool SelectMadd(SDNode *ADDENode, SelectionDAG *CurDAG) {
// ADDENode's second operand must be a flag output of an ADDC node in order // ADDENode's second operand must be a flag output of an ADDC node in order
// for the matching to be successful. // for the matching to be successful.
SDNode* ADDCNode = ADDENode->getOperand(2).getNode(); SDNode *ADDCNode = ADDENode->getOperand(2).getNode();
if (ADDCNode->getOpcode() != ISD::ADDC) if (ADDCNode->getOpcode() != ISD::ADDC)
return false; return false;
SDValue MultHi = ADDENode->getOperand(0); SDValue MultHi = ADDENode->getOperand(0);
SDValue MultLo = ADDCNode->getOperand(0); SDValue MultLo = ADDCNode->getOperand(0);
SDNode* MultNode = MultHi.getNode(); SDNode *MultNode = MultHi.getNode();
unsigned MultOpc = MultHi.getOpcode(); unsigned MultOpc = MultHi.getOpcode();
// MultHi and MultLo must be generated by the same node, // MultHi and MultLo must be generated by the same node,
@ -407,17 +407,17 @@ static bool SelectMadd(SDNode* ADDENode, SelectionDAG* CurDAG) {
// Lo0: initial value of Lo register // Lo0: initial value of Lo register
// Hi0: initial value of Hi register // Hi0: initial value of Hi register
// Return true if pattern matching was successful. // Return true if pattern matching was successful.
static bool SelectMsub(SDNode* SUBENode, SelectionDAG* CurDAG) { static bool SelectMsub(SDNode *SUBENode, SelectionDAG *CurDAG) {
// SUBENode's second operand must be a flag output of an SUBC node in order // SUBENode's second operand must be a flag output of an SUBC node in order
// for the matching to be successful. // for the matching to be successful.
SDNode* SUBCNode = SUBENode->getOperand(2).getNode(); SDNode *SUBCNode = SUBENode->getOperand(2).getNode();
if (SUBCNode->getOpcode() != ISD::SUBC) if (SUBCNode->getOpcode() != ISD::SUBC)
return false; return false;
SDValue MultHi = SUBENode->getOperand(1); SDValue MultHi = SUBENode->getOperand(1);
SDValue MultLo = SUBCNode->getOperand(1); SDValue MultLo = SUBCNode->getOperand(1);
SDNode* MultNode = MultHi.getNode(); SDNode *MultNode = MultHi.getNode();
unsigned MultOpc = MultHi.getOpcode(); unsigned MultOpc = MultHi.getOpcode();
// MultHi and MultLo must be generated by the same node, // MultHi and MultLo must be generated by the same node,
@ -472,9 +472,9 @@ static bool SelectMsub(SDNode* SUBENode, SelectionDAG* CurDAG) {
return true; return true;
} }
static SDValue PerformADDECombine(SDNode *N, SelectionDAG& DAG, static SDValue PerformADDECombine(SDNode *N, SelectionDAG &DAG,
TargetLowering::DAGCombinerInfo &DCI, TargetLowering::DAGCombinerInfo &DCI,
const MipsSubtarget* Subtarget) { const MipsSubtarget *Subtarget) {
if (DCI.isBeforeLegalize()) if (DCI.isBeforeLegalize())
return SDValue(); return SDValue();
@ -485,9 +485,9 @@ static SDValue PerformADDECombine(SDNode *N, SelectionDAG& DAG,
return SDValue(); return SDValue();
} }
static SDValue PerformSUBECombine(SDNode *N, SelectionDAG& DAG, static SDValue PerformSUBECombine(SDNode *N, SelectionDAG &DAG,
TargetLowering::DAGCombinerInfo &DCI, TargetLowering::DAGCombinerInfo &DCI,
const MipsSubtarget* Subtarget) { const MipsSubtarget *Subtarget) {
if (DCI.isBeforeLegalize()) if (DCI.isBeforeLegalize())
return SDValue(); return SDValue();
@ -498,9 +498,9 @@ static SDValue PerformSUBECombine(SDNode *N, SelectionDAG& DAG,
return SDValue(); return SDValue();
} }
static SDValue PerformDivRemCombine(SDNode *N, SelectionDAG& DAG, static SDValue PerformDivRemCombine(SDNode *N, SelectionDAG &DAG,
TargetLowering::DAGCombinerInfo &DCI, TargetLowering::DAGCombinerInfo &DCI,
const MipsSubtarget* Subtarget) { const MipsSubtarget *Subtarget) {
if (DCI.isBeforeLegalizeOps()) if (DCI.isBeforeLegalizeOps())
return SDValue(); return SDValue();
@ -575,7 +575,7 @@ static bool InvertFPCondCode(Mips::CondCode CC) {
// Creates and returns an FPCmp node from a setcc node. // Creates and returns an FPCmp node from a setcc node.
// Returns Op if setcc is not a floating point comparison. // Returns Op if setcc is not a floating point comparison.
static SDValue CreateFPCmp(SelectionDAG& DAG, const SDValue& Op) { static SDValue CreateFPCmp(SelectionDAG &DAG, const SDValue &Op) {
// must be a SETCC node // must be a SETCC node
if (Op.getOpcode() != ISD::SETCC) if (Op.getOpcode() != ISD::SETCC)
return Op; return Op;
@ -597,7 +597,7 @@ static SDValue CreateFPCmp(SelectionDAG& DAG, const SDValue& Op) {
} }
// Creates and returns a CMovFPT/F node. // Creates and returns a CMovFPT/F node.
static SDValue CreateCMovFP(SelectionDAG& DAG, SDValue Cond, SDValue True, static SDValue CreateCMovFP(SelectionDAG &DAG, SDValue Cond, SDValue True,
SDValue False, DebugLoc DL) { SDValue False, DebugLoc DL) {
bool invert = InvertFPCondCode((Mips::CondCode) bool invert = InvertFPCondCode((Mips::CondCode)
cast<ConstantSDNode>(Cond.getOperand(2)) cast<ConstantSDNode>(Cond.getOperand(2))
@ -607,9 +607,9 @@ static SDValue CreateCMovFP(SelectionDAG& DAG, SDValue Cond, SDValue True,
True.getValueType(), True, False, Cond); True.getValueType(), True, False, Cond);
} }
static SDValue PerformSELECTCombine(SDNode *N, SelectionDAG& DAG, static SDValue PerformSELECTCombine(SDNode *N, SelectionDAG &DAG,
TargetLowering::DAGCombinerInfo &DCI, TargetLowering::DAGCombinerInfo &DCI,
const MipsSubtarget* Subtarget) { const MipsSubtarget *Subtarget) {
if (DCI.isBeforeLegalizeOps()) if (DCI.isBeforeLegalizeOps())
return SDValue(); return SDValue();
@ -633,16 +633,16 @@ static SDValue PerformSELECTCombine(SDNode *N, SelectionDAG& DAG,
const DebugLoc DL = N->getDebugLoc(); const DebugLoc DL = N->getDebugLoc();
ISD::CondCode CC = cast<CondCodeSDNode>(SetCC.getOperand(2))->get(); ISD::CondCode CC = cast<CondCodeSDNode>(SetCC.getOperand(2))->get();
SDValue True = N->getOperand(1); SDValue True = N->getOperand(1);
SetCC = DAG.getSetCC(DL, SetCC.getValueType(), SetCC.getOperand(0), SetCC = DAG.getSetCC(DL, SetCC.getValueType(), SetCC.getOperand(0),
SetCC.getOperand(1), ISD::getSetCCInverse(CC, true)); SetCC.getOperand(1), ISD::getSetCCInverse(CC, true));
return DAG.getNode(ISD::SELECT, DL, FalseTy, SetCC, False, True); return DAG.getNode(ISD::SELECT, DL, FalseTy, SetCC, False, True);
} }
static SDValue PerformANDCombine(SDNode *N, SelectionDAG& DAG, static SDValue PerformANDCombine(SDNode *N, SelectionDAG &DAG,
TargetLowering::DAGCombinerInfo &DCI, TargetLowering::DAGCombinerInfo &DCI,
const MipsSubtarget* Subtarget) { const MipsSubtarget *Subtarget) {
// Pattern match EXT. // Pattern match EXT.
// $dst = and ((sra or srl) $src , pos), (2**size - 1) // $dst = and ((sra or srl) $src , pos), (2**size - 1)
// => ext $dst, $src, size, pos // => ext $dst, $src, size, pos
@ -680,9 +680,9 @@ static SDValue PerformANDCombine(SDNode *N, SelectionDAG& DAG,
DAG.getConstant(SMSize, MVT::i32)); DAG.getConstant(SMSize, MVT::i32));
} }
static SDValue PerformORCombine(SDNode *N, SelectionDAG& DAG, static SDValue PerformORCombine(SDNode *N, SelectionDAG &DAG,
TargetLowering::DAGCombinerInfo &DCI, TargetLowering::DAGCombinerInfo &DCI,
const MipsSubtarget* Subtarget) { const MipsSubtarget *Subtarget) {
// Pattern match INS. // Pattern match INS.
// $dst = or (and $src1 , mask0), (and (shl $src, pos), mask1), // $dst = or (and $src1 , mask0), (and (shl $src, pos), mask1),
// where mask1 = (2**size - 1) << pos, mask0 = ~mask1 // where mask1 = (2**size - 1) << pos, mask0 = ~mask1
@ -734,9 +734,9 @@ static SDValue PerformORCombine(SDNode *N, SelectionDAG& DAG,
DAG.getConstant(SMSize0, MVT::i32), And0.getOperand(0)); DAG.getConstant(SMSize0, MVT::i32), And0.getOperand(0));
} }
static SDValue PerformADDCombine(SDNode *N, SelectionDAG& DAG, static SDValue PerformADDCombine(SDNode *N, SelectionDAG &DAG,
TargetLowering::DAGCombinerInfo &DCI, TargetLowering::DAGCombinerInfo &DCI,
const MipsSubtarget* Subtarget) { const MipsSubtarget *Subtarget) {
// (add v0, (add v1, abs_lo(tjt))) => (add (add v0, v1), abs_lo(tjt)) // (add v0, (add v1, abs_lo(tjt))) => (add (add v0, v1), abs_lo(tjt))
if (DCI.isBeforeLegalizeOps()) if (DCI.isBeforeLegalizeOps())
@ -776,7 +776,7 @@ SDValue MipsTargetLowering::PerformDAGCombine(SDNode *N, DAGCombinerInfo &DCI)
case ISD::UDIVREM: case ISD::UDIVREM:
return PerformDivRemCombine(N, DAG, DCI, Subtarget); return PerformDivRemCombine(N, DAG, DCI, Subtarget);
case ISD::SELECT: case ISD::SELECT:
return PerformSELECTCombine(N, DAG, DCI, Subtarget); return PerformSELECTCombine(N, DAG, DCI, Subtarget);
case ISD::AND: case ISD::AND:
return PerformANDCombine(N, DAG, DCI, Subtarget); return PerformANDCombine(N, DAG, DCI, Subtarget);
case ISD::OR: case ISD::OR:
@ -847,7 +847,7 @@ static Mips::FPBranchCode GetFPBranchCodeFromCond(Mips::CondCode CC) {
/* /*
static MachineBasicBlock* ExpandCondMov(MachineInstr *MI, MachineBasicBlock *BB, static MachineBasicBlock* ExpandCondMov(MachineInstr *MI, MachineBasicBlock *BB,
DebugLoc dl, DebugLoc dl,
const MipsSubtarget* Subtarget, const MipsSubtarget *Subtarget,
const TargetInstrInfo *TII, const TargetInstrInfo *TII,
bool isFPCmp, unsigned Opc) { bool isFPCmp, unsigned Opc) {
// There is no need to expand CMov instructions if target has // There is no need to expand CMov instructions if target has
@ -2011,7 +2011,7 @@ LowerFRAMEADDR(SDValue Op, SelectionDAG &DAG) const {
// TODO: set SType according to the desired memory barrier behavior. // TODO: set SType according to the desired memory barrier behavior.
SDValue SDValue
MipsTargetLowering::LowerMEMBARRIER(SDValue Op, SelectionDAG& DAG) const { MipsTargetLowering::LowerMEMBARRIER(SDValue Op, SelectionDAG &DAG) const {
unsigned SType = 0; unsigned SType = 0;
DebugLoc dl = Op.getDebugLoc(); DebugLoc dl = Op.getDebugLoc();
return DAG.getNode(MipsISD::Sync, dl, MVT::Other, Op.getOperand(0), return DAG.getNode(MipsISD::Sync, dl, MVT::Other, Op.getOperand(0),
@ -2019,7 +2019,7 @@ MipsTargetLowering::LowerMEMBARRIER(SDValue Op, SelectionDAG& DAG) const {
} }
SDValue MipsTargetLowering::LowerATOMIC_FENCE(SDValue Op, SDValue MipsTargetLowering::LowerATOMIC_FENCE(SDValue Op,
SelectionDAG& DAG) const { SelectionDAG &DAG) const {
// FIXME: Need pseudo-fence for 'singlethread' fences // FIXME: Need pseudo-fence for 'singlethread' fences
// FIXME: Set SType for weaker fences where supported/appropriate. // FIXME: Set SType for weaker fences where supported/appropriate.
unsigned SType = 0; unsigned SType = 0;
@ -2029,7 +2029,7 @@ SDValue MipsTargetLowering::LowerATOMIC_FENCE(SDValue Op,
} }
SDValue MipsTargetLowering::LowerShiftLeftParts(SDValue Op, SDValue MipsTargetLowering::LowerShiftLeftParts(SDValue Op,
SelectionDAG& DAG) const { SelectionDAG &DAG) const {
DebugLoc DL = Op.getDebugLoc(); DebugLoc DL = Op.getDebugLoc();
SDValue Lo = Op.getOperand(0), Hi = Op.getOperand(1); SDValue Lo = Op.getOperand(0), Hi = Op.getOperand(1);
SDValue Shamt = Op.getOperand(2); SDValue Shamt = Op.getOperand(2);
@ -2051,15 +2051,15 @@ SDValue MipsTargetLowering::LowerShiftLeftParts(SDValue Op,
SDValue ShiftLeftLo = DAG.getNode(ISD::SHL, DL, MVT::i32, Lo, Shamt); SDValue ShiftLeftLo = DAG.getNode(ISD::SHL, DL, MVT::i32, Lo, Shamt);
SDValue Cond = DAG.getNode(ISD::AND, DL, MVT::i32, Shamt, SDValue Cond = DAG.getNode(ISD::AND, DL, MVT::i32, Shamt,
DAG.getConstant(0x20, MVT::i32)); DAG.getConstant(0x20, MVT::i32));
Lo = DAG.getNode(ISD::SELECT, DL, MVT::i32, Cond, DAG.getConstant(0, MVT::i32), Lo = DAG.getNode(ISD::SELECT, DL, MVT::i32, Cond,
ShiftLeftLo); DAG.getConstant(0, MVT::i32), ShiftLeftLo);
Hi = DAG.getNode(ISD::SELECT, DL, MVT::i32, Cond, ShiftLeftLo, Or); Hi = DAG.getNode(ISD::SELECT, DL, MVT::i32, Cond, ShiftLeftLo, Or);
SDValue Ops[2] = {Lo, Hi}; SDValue Ops[2] = {Lo, Hi};
return DAG.getMergeValues(Ops, 2, DL); return DAG.getMergeValues(Ops, 2, DL);
} }
SDValue MipsTargetLowering::LowerShiftRightParts(SDValue Op, SelectionDAG& DAG, SDValue MipsTargetLowering::LowerShiftRightParts(SDValue Op, SelectionDAG &DAG,
bool IsSRA) const { bool IsSRA) const {
DebugLoc DL = Op.getDebugLoc(); DebugLoc DL = Op.getDebugLoc();
SDValue Lo = Op.getOperand(0), Hi = Op.getOperand(1); SDValue Lo = Op.getOperand(0), Hi = Op.getOperand(1);
@ -2425,10 +2425,10 @@ static unsigned getNextIntArgReg(unsigned Reg) {
// Write ByVal Arg to arg registers and stack. // Write ByVal Arg to arg registers and stack.
static void static void
WriteByValArg(SDValue& ByValChain, SDValue Chain, DebugLoc dl, WriteByValArg(SDValue& ByValChain, SDValue Chain, DebugLoc dl,
SmallVector<std::pair<unsigned, SDValue>, 16>& RegsToPass, SmallVector<std::pair<unsigned, SDValue>, 16> &RegsToPass,
SmallVector<SDValue, 8>& MemOpChains, int& LastFI, SmallVector<SDValue, 8> &MemOpChains, int &LastFI,
MachineFrameInfo *MFI, SelectionDAG &DAG, SDValue Arg, MachineFrameInfo *MFI, SelectionDAG &DAG, SDValue Arg,
const CCValAssign &VA, const ISD::ArgFlagsTy& Flags, const CCValAssign &VA, const ISD::ArgFlagsTy &Flags,
MVT PtrType, bool isLittle) { MVT PtrType, bool isLittle) {
unsigned LocMemOffset = VA.getLocMemOffset(); unsigned LocMemOffset = VA.getLocMemOffset();
unsigned Offset = 0; unsigned Offset = 0;
@ -2516,10 +2516,10 @@ WriteByValArg(SDValue& ByValChain, SDValue Chain, DebugLoc dl,
// Copy Mips64 byVal arg to registers and stack. // Copy Mips64 byVal arg to registers and stack.
void static void static
PassByValArg64(SDValue& ByValChain, SDValue Chain, DebugLoc dl, PassByValArg64(SDValue& ByValChain, SDValue Chain, DebugLoc dl,
SmallVector<std::pair<unsigned, SDValue>, 16>& RegsToPass, SmallVector<std::pair<unsigned, SDValue>, 16> &RegsToPass,
SmallVector<SDValue, 8>& MemOpChains, int& LastFI, SmallVector<SDValue, 8> &MemOpChains, int &LastFI,
MachineFrameInfo *MFI, SelectionDAG &DAG, SDValue Arg, MachineFrameInfo *MFI, SelectionDAG &DAG, SDValue Arg,
const CCValAssign &VA, const ISD::ArgFlagsTy& Flags, const CCValAssign &VA, const ISD::ArgFlagsTy &Flags,
EVT PtrTy, bool isLittle) { EVT PtrTy, bool isLittle) {
unsigned ByValSize = Flags.getByValSize(); unsigned ByValSize = Flags.getByValSize();
unsigned Alignment = std::min(Flags.getByValAlign(), (unsigned)8); unsigned Alignment = std::min(Flags.getByValAlign(), (unsigned)8);
@ -2913,7 +2913,7 @@ MipsTargetLowering::LowerCallResult(SDValue Chain, SDValue InFlag,
// Assign locations to each value returned by this call. // Assign locations to each value returned by this call.
SmallVector<CCValAssign, 16> RVLocs; SmallVector<CCValAssign, 16> RVLocs;
CCState CCInfo(CallConv, isVarArg, DAG.getMachineFunction(), CCState CCInfo(CallConv, isVarArg, DAG.getMachineFunction(),
getTargetMachine(), RVLocs, *DAG.getContext()); getTargetMachine(), RVLocs, *DAG.getContext());
CCInfo.AnalyzeCallResult(Ins, RetCC_Mips); CCInfo.AnalyzeCallResult(Ins, RetCC_Mips);
@ -2932,9 +2932,9 @@ MipsTargetLowering::LowerCallResult(SDValue Chain, SDValue InFlag,
// Formal Arguments Calling Convention Implementation // Formal Arguments Calling Convention Implementation
//===----------------------------------------------------------------------===// //===----------------------------------------------------------------------===//
static void ReadByValArg(MachineFunction &MF, SDValue Chain, DebugLoc dl, static void ReadByValArg(MachineFunction &MF, SDValue Chain, DebugLoc dl,
std::vector<SDValue>& OutChains, std::vector<SDValue> &OutChains,
SelectionDAG &DAG, unsigned NumWords, SDValue FIN, SelectionDAG &DAG, unsigned NumWords, SDValue FIN,
const CCValAssign &VA, const ISD::ArgFlagsTy& Flags, const CCValAssign &VA, const ISD::ArgFlagsTy &Flags,
const Argument *FuncArg) { const Argument *FuncArg) {
unsigned LocMem = VA.getLocMemOffset(); unsigned LocMem = VA.getLocMemOffset();
unsigned FirstWord = LocMem / 4; unsigned FirstWord = LocMem / 4;
@ -2959,8 +2959,8 @@ static void ReadByValArg(MachineFunction &MF, SDValue Chain, DebugLoc dl,
// Create frame object on stack and copy registers used for byval passing to it. // Create frame object on stack and copy registers used for byval passing to it.
static unsigned static unsigned
CopyMips64ByValRegs(MachineFunction &MF, SDValue Chain, DebugLoc dl, CopyMips64ByValRegs(MachineFunction &MF, SDValue Chain, DebugLoc dl,
std::vector<SDValue>& OutChains, SelectionDAG &DAG, std::vector<SDValue> &OutChains, SelectionDAG &DAG,
const CCValAssign &VA, const ISD::ArgFlagsTy& Flags, const CCValAssign &VA, const ISD::ArgFlagsTy &Flags,
MachineFrameInfo *MFI, bool IsRegLoc, MachineFrameInfo *MFI, bool IsRegLoc,
SmallVectorImpl<SDValue> &InVals, MipsFunctionInfo *MipsFI, SmallVectorImpl<SDValue> &InVals, MipsFunctionInfo *MipsFI,
EVT PtrTy, const Argument *FuncArg) { EVT PtrTy, const Argument *FuncArg) {
@ -3207,7 +3207,7 @@ MipsTargetLowering::LowerReturn(SDValue Chain,
// CCState - Info about the registers and stack slot. // CCState - Info about the registers and stack slot.
CCState CCInfo(CallConv, isVarArg, DAG.getMachineFunction(), CCState CCInfo(CallConv, isVarArg, DAG.getMachineFunction(),
getTargetMachine(), RVLocs, *DAG.getContext()); getTargetMachine(), RVLocs, *DAG.getContext());
// Analize return values. // Analize return values.
CCInfo.AnalyzeReturn(Outs, RetCC_Mips); CCInfo.AnalyzeReturn(Outs, RetCC_Mips);

View File

@ -146,7 +146,8 @@ namespace llvm {
SDValue LowerMEMBARRIER(SDValue Op, SelectionDAG& DAG) const; SDValue LowerMEMBARRIER(SDValue Op, SelectionDAG& DAG) const;
SDValue LowerATOMIC_FENCE(SDValue Op, SelectionDAG& DAG) const; SDValue LowerATOMIC_FENCE(SDValue Op, SelectionDAG& DAG) const;
SDValue LowerShiftLeftParts(SDValue Op, SelectionDAG& DAG) const; SDValue LowerShiftLeftParts(SDValue Op, SelectionDAG& DAG) const;
SDValue LowerShiftRightParts(SDValue Op, SelectionDAG& DAG, bool IsSRA) const; SDValue LowerShiftRightParts(SDValue Op, SelectionDAG& DAG,
bool IsSRA) const;
SDValue LowerLOAD(SDValue Op, SelectionDAG &DAG) const; SDValue LowerLOAD(SDValue Op, SelectionDAG &DAG) const;
SDValue LowerSTORE(SDValue Op, SelectionDAG &DAG) const; SDValue LowerSTORE(SDValue Op, SelectionDAG &DAG) const;

View File

@ -330,9 +330,9 @@ unsigned Mips::GetOppositeBranchOpc(unsigned Opc)
} }
} }
static void AnalyzeCondBr(const MachineInstr* Inst, unsigned Opc, static void AnalyzeCondBr(const MachineInstr *Inst, unsigned Opc,
MachineBasicBlock *&BB, MachineBasicBlock *&BB,
SmallVectorImpl<MachineOperand>& Cond) { SmallVectorImpl<MachineOperand> &Cond) {
assert(GetAnalyzableBrOpc(Opc) && "Not an analyzable branch"); assert(GetAnalyzableBrOpc(Opc) && "Not an analyzable branch");
int NumOp = Inst->getNumExplicitOperands(); int NumOp = Inst->getNumExplicitOperands();

View File

@ -154,8 +154,8 @@ TargetJITInfo::StubLayout MipsJITInfo::getStubLayout() {
return Result; return Result;
} }
void *MipsJITInfo::emitFunctionStub(const Function* F, void *Fn, void *MipsJITInfo::emitFunctionStub(const Function *F, void *Fn,
JITCodeEmitter &JCE) { JITCodeEmitter &JCE) {
JCE.emitAlignment(4); JCE.emitAlignment(4);
void *Addr = (void*) (JCE.getCurrentPCValue()); void *Addr = (void*) (JCE.getCurrentPCValue());
if (!sys::Memory::setRangeWritable(Addr, 16)) if (!sys::Memory::setRangeWritable(Addr, 16))
@ -193,7 +193,7 @@ void *MipsJITInfo::emitFunctionStub(const Function* F, void *Fn,
/// it must rewrite the code to contain the actual addresses of any /// it must rewrite the code to contain the actual addresses of any
/// referenced global symbols. /// referenced global symbols.
void MipsJITInfo::relocate(void *Function, MachineRelocation *MR, void MipsJITInfo::relocate(void *Function, MachineRelocation *MR,
unsigned NumRelocs, unsigned char* GOTBase) { unsigned NumRelocs, unsigned char *GOTBase) {
for (unsigned i = 0; i != NumRelocs; ++i, ++MR) { for (unsigned i = 0; i != NumRelocs; ++i, ++MR) {
void *RelocPos = (char*) Function + MR->getMachineCodeOffset(); void *RelocPos = (char*) Function + MR->getMachineCodeOffset();

View File

@ -45,8 +45,8 @@ class MipsJITInfo : public TargetJITInfo {
/// emitFunctionStub - Use the specified JITCodeEmitter object to emit a /// emitFunctionStub - Use the specified JITCodeEmitter object to emit a
/// small native function that simply calls the function at the specified /// small native function that simply calls the function at the specified
/// address. /// address.
virtual void *emitFunctionStub(const Function* F, void *Fn, virtual void *emitFunctionStub(const Function *F, void *Fn,
JITCodeEmitter &JCE); JITCodeEmitter &JCE);
/// getLazyResolverFunction - Expose the lazy resolver to the JIT. /// getLazyResolverFunction - Expose the lazy resolver to the JIT.
virtual LazyResolverFn getLazyResolverFunction(JITCompilerFn); virtual LazyResolverFn getLazyResolverFunction(JITCompilerFn);
@ -55,7 +55,7 @@ class MipsJITInfo : public TargetJITInfo {
/// it must rewrite the code to contain the actual addresses of any /// it must rewrite the code to contain the actual addresses of any
/// referenced global symbols. /// referenced global symbols.
virtual void relocate(void *Function, MachineRelocation *MR, virtual void relocate(void *Function, MachineRelocation *MR,
unsigned NumRelocs, unsigned char* GOTBase); unsigned NumRelocs, unsigned char *GOTBase);
/// Initialize - Initialize internal stage for the function being JITted. /// Initialize - Initialize internal stage for the function being JITted.
void Initialize(const MachineFunction &MF, bool isPIC) { void Initialize(const MachineFunction &MF, bool isPIC) {

View File

@ -29,7 +29,7 @@ using namespace llvm;
MipsMCInstLower::MipsMCInstLower(MipsAsmPrinter &asmprinter) MipsMCInstLower::MipsMCInstLower(MipsAsmPrinter &asmprinter)
: AsmPrinter(asmprinter) {} : AsmPrinter(asmprinter) {}
void MipsMCInstLower::Initialize(Mangler *M, MCContext* C) { void MipsMCInstLower::Initialize(Mangler *M, MCContext *C) {
Mang = M; Mang = M;
Ctx = C; Ctx = C;
} }
@ -105,14 +105,14 @@ MCOperand MipsMCInstLower::LowerSymbolOperand(const MachineOperand &MO,
assert(Offset > 0); assert(Offset > 0);
const MCConstantExpr *OffsetExpr = MCConstantExpr::Create(Offset, *Ctx); const MCConstantExpr *OffsetExpr = MCConstantExpr::Create(Offset, *Ctx);
const MCBinaryExpr *AddExpr = MCBinaryExpr::CreateAdd(MCSym, OffsetExpr, *Ctx); const MCBinaryExpr *Add = MCBinaryExpr::CreateAdd(MCSym, OffsetExpr, *Ctx);
return MCOperand::CreateExpr(AddExpr); return MCOperand::CreateExpr(Add);
} }
/* /*
static void CreateMCInst(MCInst& Inst, unsigned Opc, const MCOperand& Opnd0, static void CreateMCInst(MCInst& Inst, unsigned Opc, const MCOperand &Opnd0,
const MCOperand& Opnd1, const MCOperand &Opnd1,
const MCOperand& Opnd2 = MCOperand()) { const MCOperand &Opnd2 = MCOperand()) {
Inst.setOpcode(Opc); Inst.setOpcode(Opc);
Inst.addOperand(Opnd0); Inst.addOperand(Opnd0);
Inst.addOperand(Opnd1); Inst.addOperand(Opnd1);
@ -121,7 +121,7 @@ static void CreateMCInst(MCInst& Inst, unsigned Opc, const MCOperand& Opnd0,
} }
*/ */
MCOperand MipsMCInstLower::LowerOperand(const MachineOperand& MO, MCOperand MipsMCInstLower::LowerOperand(const MachineOperand &MO,
unsigned offset) const { unsigned offset) const {
MachineOperandType MOTy = MO.getType(); MachineOperandType MOTy = MO.getType();

View File

@ -31,7 +31,7 @@ class LLVM_LIBRARY_VISIBILITY MipsMCInstLower {
MipsAsmPrinter &AsmPrinter; MipsAsmPrinter &AsmPrinter;
public: public:
MipsMCInstLower(MipsAsmPrinter &asmprinter); MipsMCInstLower(MipsAsmPrinter &asmprinter);
void Initialize(Mangler *mang, MCContext* C); void Initialize(Mangler *mang, MCContext *C);
void Lower(const MachineInstr *MI, MCInst &OutMI) const; void Lower(const MachineInstr *MI, MCInst &OutMI) const;
private: private:
MCOperand LowerSymbolOperand(const MachineOperand &MO, MCOperand LowerSymbolOperand(const MachineOperand &MO,

View File

@ -55,8 +55,7 @@ unsigned MipsRegisterInfo::getPICCallReg() { return Mips::T9; }
/// Mips Callee Saved Registers /// Mips Callee Saved Registers
const uint16_t* MipsRegisterInfo:: const uint16_t* MipsRegisterInfo::
getCalleeSavedRegs(const MachineFunction *MF) const getCalleeSavedRegs(const MachineFunction *MF) const {
{
if (Subtarget.isSingleFloat()) if (Subtarget.isSingleFloat())
return CSR_SingleFloatOnly_SaveList; return CSR_SingleFloatOnly_SaveList;
else if (!Subtarget.hasMips64()) else if (!Subtarget.hasMips64())
@ -65,12 +64,11 @@ getCalleeSavedRegs(const MachineFunction *MF) const
return CSR_N32_SaveList; return CSR_N32_SaveList;
assert(Subtarget.isABI_N64()); assert(Subtarget.isABI_N64());
return CSR_N64_SaveList; return CSR_N64_SaveList;
} }
const uint32_t* const uint32_t*
MipsRegisterInfo::getCallPreservedMask(CallingConv::ID) const MipsRegisterInfo::getCallPreservedMask(CallingConv::ID) const {
{
if (Subtarget.isSingleFloat()) if (Subtarget.isSingleFloat())
return CSR_SingleFloatOnly_RegMask; return CSR_SingleFloatOnly_RegMask;
else if (!Subtarget.hasMips64()) else if (!Subtarget.hasMips64())
@ -79,7 +77,7 @@ MipsRegisterInfo::getCallPreservedMask(CallingConv::ID) const
return CSR_N32_RegMask; return CSR_N32_RegMask;
assert(Subtarget.isABI_N64()); assert(Subtarget.isABI_N64());
return CSR_N64_RegMask; return CSR_N64_RegMask;
} }
BitVector MipsRegisterInfo:: BitVector MipsRegisterInfo::

View File

@ -42,7 +42,7 @@ struct MipsRegisterInfo : public MipsGenRegisterInfo {
void adjustMipsStackFrame(MachineFunction &MF) const; void adjustMipsStackFrame(MachineFunction &MF) const;
/// Code Generation virtual methods... /// Code Generation virtual methods...
const uint16_t *getCalleeSavedRegs(const MachineFunction* MF = 0) const; const uint16_t *getCalleeSavedRegs(const MachineFunction *MF = 0) const;
const uint32_t *getCallPreservedMask(CallingConv::ID) const; const uint32_t *getCallPreservedMask(CallingConv::ID) const;
BitVector getReservedRegs(const MachineFunction &MF) const; BitVector getReservedRegs(const MachineFunction &MF) const;

View File

@ -58,8 +58,8 @@ MipsSubtarget::MipsSubtarget(const std::string &TT, const std::string &CPU,
bool bool
MipsSubtarget::enablePostRAScheduler(CodeGenOpt::Level OptLevel, MipsSubtarget::enablePostRAScheduler(CodeGenOpt::Level OptLevel,
TargetSubtargetInfo::AntiDepBreakMode& Mode, TargetSubtargetInfo::AntiDepBreakMode &Mode,
RegClassVector& CriticalPathRCs) const { RegClassVector &CriticalPathRCs) const {
Mode = TargetSubtargetInfo::ANTIDEP_NONE; Mode = TargetSubtargetInfo::ANTIDEP_NONE;
CriticalPathRCs.clear(); CriticalPathRCs.clear();
CriticalPathRCs.push_back(hasMips64() ? CriticalPathRCs.push_back(hasMips64() ?

View File

@ -69,9 +69,7 @@ namespace llvm {
// Pass Pipeline Configuration // Pass Pipeline Configuration
virtual TargetPassConfig *createPassConfig(PassManagerBase &PM); virtual TargetPassConfig *createPassConfig(PassManagerBase &PM);
virtual bool addCodeEmitter(PassManagerBase &PM, virtual bool addCodeEmitter(PassManagerBase &PM, JITCodeEmitter &JCE);
JITCodeEmitter &JCE);
}; };
/// MipsebTargetMachine - Mips32 big endian target machine. /// MipsebTargetMachine - Mips32 big endian target machine.