From 04bca5a57784a630ffb31c405f2da1f1b43d086e Mon Sep 17 00:00:00 2001 From: Reed Kotler Date: Wed, 3 Feb 2016 14:40:47 -0800 Subject: [PATCH] Following the newer convention enhances readability and in addition this is a prelude to some macro changes in unimplemented I would like to make in order to simplify that code. BUG= R=stichnot@chromium.org Review URL: https://codereview.chromium.org/1667553002 . Patch from Reed Kotler . --- src/IceTargetLoweringMIPS32.cpp | 118 ++++++++++++++++++++-------------------- src/IceTargetLoweringMIPS32.h | 40 +++++++------- 2 files changed, 79 insertions(+), 79 deletions(-) diff --git a/src/IceTargetLoweringMIPS32.cpp b/src/IceTargetLoweringMIPS32.cpp index 189f63418..ff93c4b78 100644 --- a/src/IceTargetLoweringMIPS32.cpp +++ b/src/IceTargetLoweringMIPS32.cpp @@ -271,8 +271,8 @@ void TargetMIPS32::translateOm1() { } } -bool TargetMIPS32::doBranchOpt(Inst *I, const CfgNode *NextNode) { - (void)I; +bool TargetMIPS32::doBranchOpt(Inst *Instr, const CfgNode *NextNode) { + (void)Instr; (void)NextNode; UnimplementedError(Func->getContext()->getFlags()); return false; @@ -560,7 +560,7 @@ llvm::SmallBitVector TargetMIPS32::getRegisterSet(RegSetMask Include, return Registers; } -void TargetMIPS32::lowerAlloca(const InstAlloca *Inst) { +void TargetMIPS32::lowerAlloca(const InstAlloca *Instr) { UsesFramePointer = true; // Conservatively require the stack to be aligned. Some stack adjustment // operations implemented below assume that the stack is aligned before the @@ -568,13 +568,13 @@ void TargetMIPS32::lowerAlloca(const InstAlloca *Inst) { // after the alloca. The stack alignment restriction can be relaxed in some // cases. NeedsStackAlignment = true; - UnimplementedLoweringError(this, Inst); + UnimplementedLoweringError(this, Instr); } -void TargetMIPS32::lowerInt64Arithmetic(const InstArithmetic *Inst, +void TargetMIPS32::lowerInt64Arithmetic(const InstArithmetic *Instr, Variable *Dest, Operand *Src0, Operand *Src1) { - InstArithmetic::OpKind Op = Inst->getOp(); + InstArithmetic::OpKind Op = Instr->getOp(); switch (Op) { case InstArithmetic::Add: case InstArithmetic::And: @@ -583,7 +583,7 @@ void TargetMIPS32::lowerInt64Arithmetic(const InstArithmetic *Inst, case InstArithmetic::Xor: break; default: - UnimplementedLoweringError(this, Inst); + UnimplementedLoweringError(this, Instr); return; } auto *DestLo = llvm::cast(loOperand(Dest)); @@ -651,28 +651,28 @@ void TargetMIPS32::lowerInt64Arithmetic(const InstArithmetic *Inst, return; } default: - UnimplementedLoweringError(this, Inst); + UnimplementedLoweringError(this, Instr); return; } } -void TargetMIPS32::lowerArithmetic(const InstArithmetic *Inst) { - Variable *Dest = Inst->getDest(); +void TargetMIPS32::lowerArithmetic(const InstArithmetic *Instr) { + Variable *Dest = Instr->getDest(); // We need to signal all the UnimplementedLoweringError errors before any // legalization into new variables, otherwise Om1 register allocation may fail // when it sees variables that are defined but not used. Type DestTy = Dest->getType(); - Operand *Src0 = legalizeUndef(Inst->getSrc(0)); - Operand *Src1 = legalizeUndef(Inst->getSrc(1)); + Operand *Src0 = legalizeUndef(Instr->getSrc(0)); + Operand *Src1 = legalizeUndef(Instr->getSrc(1)); if (DestTy == IceType_i64) { - lowerInt64Arithmetic(Inst, Inst->getDest(), Src0, Src1); + lowerInt64Arithmetic(Instr, Instr->getDest(), Src0, Src1); return; } if (isVectorType(Dest->getType())) { - UnimplementedLoweringError(this, Inst); + UnimplementedLoweringError(this, Instr); return; } - switch (Inst->getOp()) { + switch (Instr->getOp()) { default: break; case InstArithmetic::Shl: @@ -687,7 +687,7 @@ void TargetMIPS32::lowerArithmetic(const InstArithmetic *Inst) { case InstArithmetic::Fmul: case InstArithmetic::Fdiv: case InstArithmetic::Frem: - UnimplementedLoweringError(this, Inst); + UnimplementedLoweringError(this, Instr); return; } @@ -697,7 +697,7 @@ void TargetMIPS32::lowerArithmetic(const InstArithmetic *Inst) { Variable *Src0R = legalizeToReg(Src0); Variable *Src1R = legalizeToReg(Src1); - switch (Inst->getOp()) { + switch (Instr->getOp()) { case InstArithmetic::_num: break; case InstArithmetic::Add: @@ -750,12 +750,12 @@ void TargetMIPS32::lowerArithmetic(const InstArithmetic *Inst) { case InstArithmetic::Frem: break; } - UnimplementedLoweringError(this, Inst); + UnimplementedLoweringError(this, Instr); } -void TargetMIPS32::lowerAssign(const InstAssign *Inst) { - Variable *Dest = Inst->getDest(); - Operand *Src0 = Inst->getSrc(0); +void TargetMIPS32::lowerAssign(const InstAssign *Instr) { + Variable *Dest = Instr->getDest(); + Operand *Src0 = Instr->getSrc(0); assert(Dest->getType() == Src0->getType()); if (Dest->getType() == IceType_i64) { Src0 = legalizeUndef(Src0); @@ -784,15 +784,15 @@ void TargetMIPS32::lowerAssign(const InstAssign *Inst) { SrcR = legalize(Src0, Legal_Reg); } if (isVectorType(Dest->getType())) { - UnimplementedLoweringError(this, Inst); + UnimplementedLoweringError(this, Instr); } else { _mov(Dest, SrcR); } } } -void TargetMIPS32::lowerBr(const InstBr *Inst) { - UnimplementedLoweringError(this, Inst); +void TargetMIPS32::lowerBr(const InstBr *Instr) { + UnimplementedLoweringError(this, Instr); } void TargetMIPS32::lowerCall(const InstCall *Instr) { @@ -882,65 +882,65 @@ void TargetMIPS32::lowerCall(const InstCall *Instr) { } } -void TargetMIPS32::lowerCast(const InstCast *Inst) { - InstCast::OpKind CastKind = Inst->getCastKind(); +void TargetMIPS32::lowerCast(const InstCast *Instr) { + InstCast::OpKind CastKind = Instr->getCastKind(); switch (CastKind) { default: Func->setError("Cast type not supported"); return; case InstCast::Sext: { - UnimplementedLoweringError(this, Inst); + UnimplementedLoweringError(this, Instr); break; } case InstCast::Zext: { - UnimplementedLoweringError(this, Inst); + UnimplementedLoweringError(this, Instr); break; } case InstCast::Trunc: { - UnimplementedLoweringError(this, Inst); + UnimplementedLoweringError(this, Instr); break; } case InstCast::Fptrunc: - UnimplementedLoweringError(this, Inst); + UnimplementedLoweringError(this, Instr); break; case InstCast::Fpext: { - UnimplementedLoweringError(this, Inst); + UnimplementedLoweringError(this, Instr); break; } case InstCast::Fptosi: - UnimplementedLoweringError(this, Inst); + UnimplementedLoweringError(this, Instr); break; case InstCast::Fptoui: - UnimplementedLoweringError(this, Inst); + UnimplementedLoweringError(this, Instr); break; case InstCast::Sitofp: - UnimplementedLoweringError(this, Inst); + UnimplementedLoweringError(this, Instr); break; case InstCast::Uitofp: { - UnimplementedLoweringError(this, Inst); + UnimplementedLoweringError(this, Instr); break; } case InstCast::Bitcast: { - UnimplementedLoweringError(this, Inst); + UnimplementedLoweringError(this, Instr); break; } } } -void TargetMIPS32::lowerExtractElement(const InstExtractElement *Inst) { - UnimplementedLoweringError(this, Inst); +void TargetMIPS32::lowerExtractElement(const InstExtractElement *Instr) { + UnimplementedLoweringError(this, Instr); } -void TargetMIPS32::lowerFcmp(const InstFcmp *Inst) { - UnimplementedLoweringError(this, Inst); +void TargetMIPS32::lowerFcmp(const InstFcmp *Instr) { + UnimplementedLoweringError(this, Instr); } -void TargetMIPS32::lowerIcmp(const InstIcmp *Inst) { - UnimplementedLoweringError(this, Inst); +void TargetMIPS32::lowerIcmp(const InstIcmp *Instr) { + UnimplementedLoweringError(this, Instr); } -void TargetMIPS32::lowerInsertElement(const InstInsertElement *Inst) { - UnimplementedLoweringError(this, Inst); +void TargetMIPS32::lowerInsertElement(const InstInsertElement *Instr) { + UnimplementedLoweringError(this, Instr); } void TargetMIPS32::lowerIntrinsicCall(const InstIntrinsicCall *Instr) { @@ -1069,8 +1069,8 @@ void TargetMIPS32::lowerIntrinsicCall(const InstIntrinsicCall *Instr) { return; } -void TargetMIPS32::lowerLoad(const InstLoad *Inst) { - UnimplementedLoweringError(this, Inst); +void TargetMIPS32::lowerLoad(const InstLoad *Instr) { + UnimplementedLoweringError(this, Instr); } void TargetMIPS32::doAddressOptLoad() { @@ -1085,14 +1085,14 @@ void TargetMIPS32::randomlyInsertNop(float Probability, } } -void TargetMIPS32::lowerPhi(const InstPhi * /*Inst*/) { +void TargetMIPS32::lowerPhi(const InstPhi * /*Instr*/) { Func->setError("Phi found in regular instruction list"); } -void TargetMIPS32::lowerRet(const InstRet *Inst) { +void TargetMIPS32::lowerRet(const InstRet *Instr) { Variable *Reg = nullptr; - if (Inst->hasRetValue()) { - Operand *Src0 = Inst->getRetValue(); + if (Instr->hasRetValue()) { + Operand *Src0 = Instr->getRetValue(); switch (Src0->getType()) { case IceType_i1: case IceType_i8: @@ -1114,30 +1114,30 @@ void TargetMIPS32::lowerRet(const InstRet *Inst) { } default: - UnimplementedLoweringError(this, Inst); + UnimplementedLoweringError(this, Instr); } } _ret(getPhysicalRegister(RegMIPS32::Reg_RA), Reg); } -void TargetMIPS32::lowerSelect(const InstSelect *Inst) { - UnimplementedLoweringError(this, Inst); +void TargetMIPS32::lowerSelect(const InstSelect *Instr) { + UnimplementedLoweringError(this, Instr); } -void TargetMIPS32::lowerStore(const InstStore *Inst) { - UnimplementedLoweringError(this, Inst); +void TargetMIPS32::lowerStore(const InstStore *Instr) { + UnimplementedLoweringError(this, Instr); } void TargetMIPS32::doAddressOptStore() { UnimplementedError(Func->getContext()->getFlags()); } -void TargetMIPS32::lowerSwitch(const InstSwitch *Inst) { - UnimplementedLoweringError(this, Inst); +void TargetMIPS32::lowerSwitch(const InstSwitch *Instr) { + UnimplementedLoweringError(this, Instr); } -void TargetMIPS32::lowerUnreachable(const InstUnreachable *Inst) { - UnimplementedLoweringError(this, Inst); +void TargetMIPS32::lowerUnreachable(const InstUnreachable *Instr) { + UnimplementedLoweringError(this, Instr); } // Turn an i64 Phi instruction into a pair of i32 Phi instructions, to preserve diff --git a/src/IceTargetLoweringMIPS32.h b/src/IceTargetLoweringMIPS32.h index 57b9329cc..a61263ed1 100644 --- a/src/IceTargetLoweringMIPS32.h +++ b/src/IceTargetLoweringMIPS32.h @@ -44,7 +44,7 @@ public: void translateOm1() override; void translateO2() override; - bool doBranchOpt(Inst *I, const CfgNode *NextNode) override; + bool doBranchOpt(Inst *Instr, const CfgNode *NextNode) override; SizeT getNumRegisters() const override { return RegMIPS32::Reg_NUM; } Variable *getPhysicalRegister(SizeT RegNum, Type Ty = IceType_void) override; @@ -245,26 +245,26 @@ protected: void postLower() override; - void lowerAlloca(const InstAlloca *Inst) override; - void lowerArithmetic(const InstArithmetic *Inst) override; - void lowerInt64Arithmetic(const InstArithmetic *Inst, Variable *Dest, + void lowerAlloca(const InstAlloca *Instr) override; + void lowerArithmetic(const InstArithmetic *Instr) override; + void lowerInt64Arithmetic(const InstArithmetic *Instr, Variable *Dest, Operand *Src0, Operand *Src1); - void lowerAssign(const InstAssign *Inst) override; - void lowerBr(const InstBr *Inst) override; - void lowerCall(const InstCall *Inst) override; - void lowerCast(const InstCast *Inst) override; - void lowerExtractElement(const InstExtractElement *Inst) override; - void lowerFcmp(const InstFcmp *Inst) override; - void lowerIcmp(const InstIcmp *Inst) override; - void lowerIntrinsicCall(const InstIntrinsicCall *Inst) override; - void lowerInsertElement(const InstInsertElement *Inst) override; - void lowerLoad(const InstLoad *Inst) override; - void lowerPhi(const InstPhi *Inst) override; - void lowerRet(const InstRet *Inst) override; - void lowerSelect(const InstSelect *Inst) override; - void lowerStore(const InstStore *Inst) override; - void lowerSwitch(const InstSwitch *Inst) override; - void lowerUnreachable(const InstUnreachable *Inst) override; + void lowerAssign(const InstAssign *Instr) override; + void lowerBr(const InstBr *Instr) override; + void lowerCall(const InstCall *Instr) override; + void lowerCast(const InstCast *Instr) override; + void lowerExtractElement(const InstExtractElement *Instr) override; + void lowerFcmp(const InstFcmp *Instr) override; + void lowerIcmp(const InstIcmp *Instr) override; + void lowerIntrinsicCall(const InstIntrinsicCall *Instr) override; + void lowerInsertElement(const InstInsertElement *Instr) override; + void lowerLoad(const InstLoad *Instr) override; + void lowerPhi(const InstPhi *Instr) override; + void lowerRet(const InstRet *Instr) override; + void lowerSelect(const InstSelect *Instr) override; + void lowerStore(const InstStore *Instr) override; + void lowerSwitch(const InstSwitch *Instr) override; + void lowerUnreachable(const InstUnreachable *Instr) override; void prelowerPhis() override; uint32_t getCallStackArgumentsSizeBytes(const InstCall *Instr) override { (void)Instr; -- 2.11.0