Subzero: Cleanup Inst==>Instr.
In the beginning, Ice::Inst was called IceInst, and patterns like "IceInst *Inst = ..." made perfect sense.
After the Ice:: name change, "Inst *Inst = ..." continued to compile, mostly.
However, shadowing a type name is clumsy and newer code tends to use "Inst *Instr", so we might as well switch all the instances over.
Some are still called "I" and those are left alone.
BUG= none
R=kschimpf@google.com
Review URL: https://codereview.chromium.org/1665423002 .
diff --git a/src/IceCfg.cpp b/src/IceCfg.cpp
index 5c43562..fe44ee7 100644
--- a/src/IceCfg.cpp
+++ b/src/IceCfg.cpp
@@ -898,13 +898,13 @@
Ostream &Str = Ctx->getStrDump();
for (CfgNode *Node : Nodes) {
Inst *FirstInst = nullptr;
- for (Inst &Inst : Node->getInsts()) {
- if (Inst.isDeleted())
+ for (Inst &Instr : Node->getInsts()) {
+ if (Instr.isDeleted())
continue;
if (FirstInst == nullptr)
- FirstInst = &Inst;
- InstNumberT InstNumber = Inst.getNumber();
- if (Variable *Dest = Inst.getDest()) {
+ FirstInst = &Instr;
+ InstNumberT InstNumber = Instr.getNumber();
+ if (Variable *Dest = Instr.getDest()) {
if (!Dest->getIgnoreLiveness()) {
bool Invalid = false;
constexpr bool IsDest = true;
@@ -916,24 +916,24 @@
// of the block, because a Phi temporary may be live at the end of
// the previous block, and if it is also assigned in the first
// instruction of this block, the adjacent live ranges get merged.
- if (static_cast<class Inst *>(&Inst) != FirstInst &&
- !Inst.isDestRedefined() &&
+ if (static_cast<class Inst *>(&Instr) != FirstInst &&
+ !Instr.isDestRedefined() &&
Dest->getLiveRange().containsValue(InstNumber - 1, IsDest))
Invalid = true;
if (Invalid) {
Valid = false;
- Str << "Liveness error: inst " << Inst.getNumber() << " dest ";
+ Str << "Liveness error: inst " << Instr.getNumber() << " dest ";
Dest->dump(this);
Str << " live range " << Dest->getLiveRange() << "\n";
}
}
}
- FOREACH_VAR_IN_INST(Var, Inst) {
+ FOREACH_VAR_IN_INST(Var, Instr) {
static constexpr bool IsDest = false;
if (!Var->getIgnoreLiveness() &&
!Var->getLiveRange().containsValue(InstNumber, IsDest)) {
Valid = false;
- Str << "Liveness error: inst " << Inst.getNumber() << " var ";
+ Str << "Liveness error: inst " << Instr.getNumber() << " var ";
Var->dump(this);
Str << " live range " << Var->getLiveRange() << "\n";
}
diff --git a/src/IceCfgNode.cpp b/src/IceCfgNode.cpp
index f06e631..647da89 100644
--- a/src/IceCfgNode.cpp
+++ b/src/IceCfgNode.cpp
@@ -39,16 +39,16 @@
// Adds an instruction to either the Phi list or the regular instruction list.
// Validates that all Phis are added before all regular instructions.
-void CfgNode::appendInst(Inst *Inst) {
+void CfgNode::appendInst(Inst *Instr) {
++InstCountEstimate;
- if (auto *Phi = llvm::dyn_cast<InstPhi>(Inst)) {
+ if (auto *Phi = llvm::dyn_cast<InstPhi>(Instr)) {
if (!Insts.empty()) {
Func->setError("Phi instruction added to the middle of a block");
return;
}
Phis.push_back(Phi);
} else {
- Insts.push_back(Inst);
+ Insts.push_back(Instr);
}
}
@@ -1429,13 +1429,13 @@
Constant *OrderAcquireRelease =
Context->getConstantInt32(Intrinsics::MemoryOrderAcquireRelease);
- auto *Inst = InstIntrinsicCall::create(
+ auto *Instr = InstIntrinsicCall::create(
Func, 5, Func->makeVariable(IceType_i64), RMWI64Name, Info->Info);
- Inst->addArg(AtomicRMWOp);
- Inst->addArg(Counter);
- Inst->addArg(One);
- Inst->addArg(OrderAcquireRelease);
- Insts.push_front(Inst);
+ Instr->addArg(AtomicRMWOp);
+ Instr->addArg(Counter);
+ Instr->addArg(One);
+ Instr->addArg(OrderAcquireRelease);
+ Insts.push_front(Instr);
}
} // end of namespace Ice
diff --git a/src/IceCfgNode.h b/src/IceCfgNode.h
index 4a27af6..f7e7b0e 100644
--- a/src/IceCfgNode.h
+++ b/src/IceCfgNode.h
@@ -72,7 +72,7 @@
/// @{
InstList &getInsts() { return Insts; }
PhiList &getPhis() { return Phis; }
- void appendInst(Inst *Inst);
+ void appendInst(Inst *Instr);
void renumberInstructions();
/// Rough and generally conservative estimate of the number of instructions in
/// the block. It is updated when an instruction is added, but not when
diff --git a/src/IceConverter.cpp b/src/IceConverter.cpp
index 4cd7091..b89666b 100644
--- a/src/IceConverter.cpp
+++ b/src/IceConverter.cpp
@@ -201,11 +201,11 @@
// Given an LLVM instruction and an operand number, produce the Ice::Operand
// this refers to. If there's no such operand, return nullptr.
- Ice::Operand *convertOperand(const Instruction *Inst, unsigned OpNum) {
- if (OpNum >= Inst->getNumOperands()) {
+ Ice::Operand *convertOperand(const Instruction *Instr, unsigned OpNum) {
+ if (OpNum >= Instr->getNumOperands()) {
return nullptr;
}
- const Value *Op = Inst->getOperand(OpNum);
+ const Value *Op = Instr->getOperand(OpNum);
return convertValue(Op);
}
@@ -219,173 +219,173 @@
// Note: this currently assumes a 1x1 mapping between LLVM IR and Ice
// instructions.
- Ice::Inst *convertInstruction(const Instruction *Inst) {
- switch (Inst->getOpcode()) {
+ Ice::Inst *convertInstruction(const Instruction *Instr) {
+ switch (Instr->getOpcode()) {
case Instruction::PHI:
- return convertPHINodeInstruction(cast<PHINode>(Inst));
+ return convertPHINodeInstruction(cast<PHINode>(Instr));
case Instruction::Br:
- return convertBrInstruction(cast<BranchInst>(Inst));
+ return convertBrInstruction(cast<BranchInst>(Instr));
case Instruction::Ret:
- return convertRetInstruction(cast<ReturnInst>(Inst));
+ return convertRetInstruction(cast<ReturnInst>(Instr));
case Instruction::IntToPtr:
- return convertIntToPtrInstruction(cast<IntToPtrInst>(Inst));
+ return convertIntToPtrInstruction(cast<IntToPtrInst>(Instr));
case Instruction::PtrToInt:
- return convertPtrToIntInstruction(cast<PtrToIntInst>(Inst));
+ return convertPtrToIntInstruction(cast<PtrToIntInst>(Instr));
case Instruction::ICmp:
- return convertICmpInstruction(cast<ICmpInst>(Inst));
+ return convertICmpInstruction(cast<ICmpInst>(Instr));
case Instruction::FCmp:
- return convertFCmpInstruction(cast<FCmpInst>(Inst));
+ return convertFCmpInstruction(cast<FCmpInst>(Instr));
case Instruction::Select:
- return convertSelectInstruction(cast<SelectInst>(Inst));
+ return convertSelectInstruction(cast<SelectInst>(Instr));
case Instruction::Switch:
- return convertSwitchInstruction(cast<SwitchInst>(Inst));
+ return convertSwitchInstruction(cast<SwitchInst>(Instr));
case Instruction::Load:
- return convertLoadInstruction(cast<LoadInst>(Inst));
+ return convertLoadInstruction(cast<LoadInst>(Instr));
case Instruction::Store:
- return convertStoreInstruction(cast<StoreInst>(Inst));
+ return convertStoreInstruction(cast<StoreInst>(Instr));
case Instruction::ZExt:
- return convertCastInstruction(cast<ZExtInst>(Inst), Ice::InstCast::Zext);
+ return convertCastInstruction(cast<ZExtInst>(Instr), Ice::InstCast::Zext);
case Instruction::SExt:
- return convertCastInstruction(cast<SExtInst>(Inst), Ice::InstCast::Sext);
+ return convertCastInstruction(cast<SExtInst>(Instr), Ice::InstCast::Sext);
case Instruction::Trunc:
- return convertCastInstruction(cast<TruncInst>(Inst),
+ return convertCastInstruction(cast<TruncInst>(Instr),
Ice::InstCast::Trunc);
case Instruction::FPTrunc:
- return convertCastInstruction(cast<FPTruncInst>(Inst),
+ return convertCastInstruction(cast<FPTruncInst>(Instr),
Ice::InstCast::Fptrunc);
case Instruction::FPExt:
- return convertCastInstruction(cast<FPExtInst>(Inst),
+ return convertCastInstruction(cast<FPExtInst>(Instr),
Ice::InstCast::Fpext);
case Instruction::FPToSI:
- return convertCastInstruction(cast<FPToSIInst>(Inst),
+ return convertCastInstruction(cast<FPToSIInst>(Instr),
Ice::InstCast::Fptosi);
case Instruction::FPToUI:
- return convertCastInstruction(cast<FPToUIInst>(Inst),
+ return convertCastInstruction(cast<FPToUIInst>(Instr),
Ice::InstCast::Fptoui);
case Instruction::SIToFP:
- return convertCastInstruction(cast<SIToFPInst>(Inst),
+ return convertCastInstruction(cast<SIToFPInst>(Instr),
Ice::InstCast::Sitofp);
case Instruction::UIToFP:
- return convertCastInstruction(cast<UIToFPInst>(Inst),
+ return convertCastInstruction(cast<UIToFPInst>(Instr),
Ice::InstCast::Uitofp);
case Instruction::BitCast:
- return convertCastInstruction(cast<BitCastInst>(Inst),
+ return convertCastInstruction(cast<BitCastInst>(Instr),
Ice::InstCast::Bitcast);
case Instruction::Add:
- return convertArithInstruction(Inst, Ice::InstArithmetic::Add);
+ return convertArithInstruction(Instr, Ice::InstArithmetic::Add);
case Instruction::Sub:
- return convertArithInstruction(Inst, Ice::InstArithmetic::Sub);
+ return convertArithInstruction(Instr, Ice::InstArithmetic::Sub);
case Instruction::Mul:
- return convertArithInstruction(Inst, Ice::InstArithmetic::Mul);
+ return convertArithInstruction(Instr, Ice::InstArithmetic::Mul);
case Instruction::UDiv:
- return convertArithInstruction(Inst, Ice::InstArithmetic::Udiv);
+ return convertArithInstruction(Instr, Ice::InstArithmetic::Udiv);
case Instruction::SDiv:
- return convertArithInstruction(Inst, Ice::InstArithmetic::Sdiv);
+ return convertArithInstruction(Instr, Ice::InstArithmetic::Sdiv);
case Instruction::URem:
- return convertArithInstruction(Inst, Ice::InstArithmetic::Urem);
+ return convertArithInstruction(Instr, Ice::InstArithmetic::Urem);
case Instruction::SRem:
- return convertArithInstruction(Inst, Ice::InstArithmetic::Srem);
+ return convertArithInstruction(Instr, Ice::InstArithmetic::Srem);
case Instruction::Shl:
- return convertArithInstruction(Inst, Ice::InstArithmetic::Shl);
+ return convertArithInstruction(Instr, Ice::InstArithmetic::Shl);
case Instruction::LShr:
- return convertArithInstruction(Inst, Ice::InstArithmetic::Lshr);
+ return convertArithInstruction(Instr, Ice::InstArithmetic::Lshr);
case Instruction::AShr:
- return convertArithInstruction(Inst, Ice::InstArithmetic::Ashr);
+ return convertArithInstruction(Instr, Ice::InstArithmetic::Ashr);
case Instruction::FAdd:
- return convertArithInstruction(Inst, Ice::InstArithmetic::Fadd);
+ return convertArithInstruction(Instr, Ice::InstArithmetic::Fadd);
case Instruction::FSub:
- return convertArithInstruction(Inst, Ice::InstArithmetic::Fsub);
+ return convertArithInstruction(Instr, Ice::InstArithmetic::Fsub);
case Instruction::FMul:
- return convertArithInstruction(Inst, Ice::InstArithmetic::Fmul);
+ return convertArithInstruction(Instr, Ice::InstArithmetic::Fmul);
case Instruction::FDiv:
- return convertArithInstruction(Inst, Ice::InstArithmetic::Fdiv);
+ return convertArithInstruction(Instr, Ice::InstArithmetic::Fdiv);
case Instruction::FRem:
- return convertArithInstruction(Inst, Ice::InstArithmetic::Frem);
+ return convertArithInstruction(Instr, Ice::InstArithmetic::Frem);
case Instruction::And:
- return convertArithInstruction(Inst, Ice::InstArithmetic::And);
+ return convertArithInstruction(Instr, Ice::InstArithmetic::And);
case Instruction::Or:
- return convertArithInstruction(Inst, Ice::InstArithmetic::Or);
+ return convertArithInstruction(Instr, Ice::InstArithmetic::Or);
case Instruction::Xor:
- return convertArithInstruction(Inst, Ice::InstArithmetic::Xor);
+ return convertArithInstruction(Instr, Ice::InstArithmetic::Xor);
case Instruction::ExtractElement:
- return convertExtractElementInstruction(cast<ExtractElementInst>(Inst));
+ return convertExtractElementInstruction(cast<ExtractElementInst>(Instr));
case Instruction::InsertElement:
- return convertInsertElementInstruction(cast<InsertElementInst>(Inst));
+ return convertInsertElementInstruction(cast<InsertElementInst>(Instr));
case Instruction::Call:
- return convertCallInstruction(cast<CallInst>(Inst));
+ return convertCallInstruction(cast<CallInst>(Instr));
case Instruction::Alloca:
- return convertAllocaInstruction(cast<AllocaInst>(Inst));
+ return convertAllocaInstruction(cast<AllocaInst>(Instr));
case Instruction::Unreachable:
- return convertUnreachableInstruction(cast<UnreachableInst>(Inst));
+ return convertUnreachableInstruction(cast<UnreachableInst>(Instr));
default:
report_fatal_error(std::string("Invalid PNaCl instruction: ") +
- LLVMObjectAsString(Inst));
+ LLVMObjectAsString(Instr));
}
llvm_unreachable("convertInstruction");
return nullptr;
}
- Ice::Inst *convertLoadInstruction(const LoadInst *Inst) {
- Ice::Operand *Src = convertOperand(Inst, 0);
- Ice::Variable *Dest = mapValueToIceVar(Inst);
+ Ice::Inst *convertLoadInstruction(const LoadInst *Instr) {
+ Ice::Operand *Src = convertOperand(Instr, 0);
+ Ice::Variable *Dest = mapValueToIceVar(Instr);
return Ice::InstLoad::create(Func.get(), Dest, Src);
}
- Ice::Inst *convertStoreInstruction(const StoreInst *Inst) {
- Ice::Operand *Addr = convertOperand(Inst, 1);
- Ice::Operand *Val = convertOperand(Inst, 0);
+ Ice::Inst *convertStoreInstruction(const StoreInst *Instr) {
+ Ice::Operand *Addr = convertOperand(Instr, 1);
+ Ice::Operand *Val = convertOperand(Instr, 0);
return Ice::InstStore::create(Func.get(), Val, Addr);
}
- Ice::Inst *convertArithInstruction(const Instruction *Inst,
+ Ice::Inst *convertArithInstruction(const Instruction *Instr,
Ice::InstArithmetic::OpKind Opcode) {
- const auto BinOp = cast<BinaryOperator>(Inst);
- Ice::Operand *Src0 = convertOperand(Inst, 0);
- Ice::Operand *Src1 = convertOperand(Inst, 1);
+ const auto BinOp = cast<BinaryOperator>(Instr);
+ Ice::Operand *Src0 = convertOperand(Instr, 0);
+ Ice::Operand *Src1 = convertOperand(Instr, 1);
Ice::Variable *Dest = mapValueToIceVar(BinOp);
return Ice::InstArithmetic::create(Func.get(), Opcode, Dest, Src0, Src1);
}
- Ice::Inst *convertPHINodeInstruction(const PHINode *Inst) {
- unsigned NumValues = Inst->getNumIncomingValues();
+ Ice::Inst *convertPHINodeInstruction(const PHINode *Instr) {
+ unsigned NumValues = Instr->getNumIncomingValues();
Ice::InstPhi *IcePhi =
- Ice::InstPhi::create(Func.get(), NumValues, mapValueToIceVar(Inst));
+ Ice::InstPhi::create(Func.get(), NumValues, mapValueToIceVar(Instr));
for (unsigned N = 0, E = NumValues; N != E; ++N) {
- IcePhi->addArgument(convertOperand(Inst, N),
- mapBasicBlockToNode(Inst->getIncomingBlock(N)));
+ IcePhi->addArgument(convertOperand(Instr, N),
+ mapBasicBlockToNode(Instr->getIncomingBlock(N)));
}
return IcePhi;
}
- Ice::Inst *convertBrInstruction(const BranchInst *Inst) {
- if (Inst->isConditional()) {
- Ice::Operand *Src = convertOperand(Inst, 0);
- BasicBlock *BBThen = Inst->getSuccessor(0);
- BasicBlock *BBElse = Inst->getSuccessor(1);
+ Ice::Inst *convertBrInstruction(const BranchInst *Instr) {
+ if (Instr->isConditional()) {
+ Ice::Operand *Src = convertOperand(Instr, 0);
+ BasicBlock *BBThen = Instr->getSuccessor(0);
+ BasicBlock *BBElse = Instr->getSuccessor(1);
Ice::CfgNode *NodeThen = mapBasicBlockToNode(BBThen);
Ice::CfgNode *NodeElse = mapBasicBlockToNode(BBElse);
return Ice::InstBr::create(Func.get(), Src, NodeThen, NodeElse);
} else {
- BasicBlock *BBSucc = Inst->getSuccessor(0);
+ BasicBlock *BBSucc = Instr->getSuccessor(0);
return Ice::InstBr::create(Func.get(), mapBasicBlockToNode(BBSucc));
}
}
- Ice::Inst *convertIntToPtrInstruction(const IntToPtrInst *Inst) {
- Ice::Operand *Src = convertOperand(Inst, 0);
- Ice::Variable *Dest = mapValueToIceVar(Inst, Ice::getPointerType());
+ Ice::Inst *convertIntToPtrInstruction(const IntToPtrInst *Instr) {
+ Ice::Operand *Src = convertOperand(Instr, 0);
+ Ice::Variable *Dest = mapValueToIceVar(Instr, Ice::getPointerType());
return Ice::InstAssign::create(Func.get(), Dest, Src);
}
- Ice::Inst *convertPtrToIntInstruction(const PtrToIntInst *Inst) {
- Ice::Operand *Src = convertOperand(Inst, 0);
- Ice::Variable *Dest = mapValueToIceVar(Inst);
+ Ice::Inst *convertPtrToIntInstruction(const PtrToIntInst *Instr) {
+ Ice::Operand *Src = convertOperand(Instr, 0);
+ Ice::Variable *Dest = mapValueToIceVar(Instr);
return Ice::InstAssign::create(Func.get(), Dest, Src);
}
- Ice::Inst *convertRetInstruction(const ReturnInst *Inst) {
- Ice::Operand *RetOperand = convertOperand(Inst, 0);
+ Ice::Inst *convertRetInstruction(const ReturnInst *Instr) {
+ Ice::Operand *RetOperand = convertOperand(Instr, 0);
if (RetOperand) {
return Ice::InstRet::create(Func.get(), RetOperand);
} else {
@@ -393,20 +393,20 @@
}
}
- Ice::Inst *convertCastInstruction(const Instruction *Inst,
+ Ice::Inst *convertCastInstruction(const Instruction *Instr,
Ice::InstCast::OpKind CastKind) {
- Ice::Operand *Src = convertOperand(Inst, 0);
- Ice::Variable *Dest = mapValueToIceVar(Inst);
+ Ice::Operand *Src = convertOperand(Instr, 0);
+ Ice::Variable *Dest = mapValueToIceVar(Instr);
return Ice::InstCast::create(Func.get(), CastKind, Dest, Src);
}
- Ice::Inst *convertICmpInstruction(const ICmpInst *Inst) {
- Ice::Operand *Src0 = convertOperand(Inst, 0);
- Ice::Operand *Src1 = convertOperand(Inst, 1);
- Ice::Variable *Dest = mapValueToIceVar(Inst);
+ Ice::Inst *convertICmpInstruction(const ICmpInst *Instr) {
+ Ice::Operand *Src0 = convertOperand(Instr, 0);
+ Ice::Operand *Src1 = convertOperand(Instr, 1);
+ Ice::Variable *Dest = mapValueToIceVar(Instr);
Ice::InstIcmp::ICond Cond;
- switch (Inst->getPredicate()) {
+ switch (Instr->getPredicate()) {
default:
llvm_unreachable("ICmpInst predicate");
case CmpInst::ICMP_EQ:
@@ -444,13 +444,13 @@
return Ice::InstIcmp::create(Func.get(), Cond, Dest, Src0, Src1);
}
- Ice::Inst *convertFCmpInstruction(const FCmpInst *Inst) {
- Ice::Operand *Src0 = convertOperand(Inst, 0);
- Ice::Operand *Src1 = convertOperand(Inst, 1);
- Ice::Variable *Dest = mapValueToIceVar(Inst);
+ Ice::Inst *convertFCmpInstruction(const FCmpInst *Instr) {
+ Ice::Operand *Src0 = convertOperand(Instr, 0);
+ Ice::Operand *Src1 = convertOperand(Instr, 1);
+ Ice::Variable *Dest = mapValueToIceVar(Instr);
Ice::InstFcmp::FCond Cond;
- switch (Inst->getPredicate()) {
+ switch (Instr->getPredicate()) {
default:
llvm_unreachable("FCmpInst predicate");
@@ -508,38 +508,38 @@
return Ice::InstFcmp::create(Func.get(), Cond, Dest, Src0, Src1);
}
- Ice::Inst *convertExtractElementInstruction(const ExtractElementInst *Inst) {
- Ice::Variable *Dest = mapValueToIceVar(Inst);
- Ice::Operand *Source1 = convertValue(Inst->getOperand(0));
- Ice::Operand *Source2 = convertValue(Inst->getOperand(1));
+ Ice::Inst *convertExtractElementInstruction(const ExtractElementInst *Instr) {
+ Ice::Variable *Dest = mapValueToIceVar(Instr);
+ Ice::Operand *Source1 = convertValue(Instr->getOperand(0));
+ Ice::Operand *Source2 = convertValue(Instr->getOperand(1));
return Ice::InstExtractElement::create(Func.get(), Dest, Source1, Source2);
}
- Ice::Inst *convertInsertElementInstruction(const InsertElementInst *Inst) {
- Ice::Variable *Dest = mapValueToIceVar(Inst);
- Ice::Operand *Source1 = convertValue(Inst->getOperand(0));
- Ice::Operand *Source2 = convertValue(Inst->getOperand(1));
- Ice::Operand *Source3 = convertValue(Inst->getOperand(2));
+ Ice::Inst *convertInsertElementInstruction(const InsertElementInst *Instr) {
+ Ice::Variable *Dest = mapValueToIceVar(Instr);
+ Ice::Operand *Source1 = convertValue(Instr->getOperand(0));
+ Ice::Operand *Source2 = convertValue(Instr->getOperand(1));
+ Ice::Operand *Source3 = convertValue(Instr->getOperand(2));
return Ice::InstInsertElement::create(Func.get(), Dest, Source1, Source2,
Source3);
}
- Ice::Inst *convertSelectInstruction(const SelectInst *Inst) {
- Ice::Variable *Dest = mapValueToIceVar(Inst);
- Ice::Operand *Cond = convertValue(Inst->getCondition());
- Ice::Operand *Source1 = convertValue(Inst->getTrueValue());
- Ice::Operand *Source2 = convertValue(Inst->getFalseValue());
+ Ice::Inst *convertSelectInstruction(const SelectInst *Instr) {
+ Ice::Variable *Dest = mapValueToIceVar(Instr);
+ Ice::Operand *Cond = convertValue(Instr->getCondition());
+ Ice::Operand *Source1 = convertValue(Instr->getTrueValue());
+ Ice::Operand *Source2 = convertValue(Instr->getFalseValue());
return Ice::InstSelect::create(Func.get(), Dest, Cond, Source1, Source2);
}
- Ice::Inst *convertSwitchInstruction(const SwitchInst *Inst) {
- Ice::Operand *Source = convertValue(Inst->getCondition());
- Ice::CfgNode *LabelDefault = mapBasicBlockToNode(Inst->getDefaultDest());
- unsigned NumCases = Inst->getNumCases();
+ Ice::Inst *convertSwitchInstruction(const SwitchInst *Instr) {
+ Ice::Operand *Source = convertValue(Instr->getCondition());
+ Ice::CfgNode *LabelDefault = mapBasicBlockToNode(Instr->getDefaultDest());
+ unsigned NumCases = Instr->getNumCases();
Ice::InstSwitch *Switch =
Ice::InstSwitch::create(Func.get(), NumCases, Source, LabelDefault);
unsigned CurrentCase = 0;
- for (SwitchInst::ConstCaseIt I = Inst->case_begin(), E = Inst->case_end();
+ for (SwitchInst::ConstCaseIt I = Instr->case_begin(), E = Instr->case_end();
I != E; ++I, ++CurrentCase) {
uint64_t CaseValue = I.getCaseValue()->getSExtValue();
Ice::CfgNode *CaseSuccessor = mapBasicBlockToNode(I.getCaseSuccessor());
@@ -548,10 +548,10 @@
return Switch;
}
- Ice::Inst *convertCallInstruction(const CallInst *Inst) {
- Ice::Variable *Dest = mapValueToIceVar(Inst);
- Ice::Operand *CallTarget = convertValue(Inst->getCalledValue());
- unsigned NumArgs = Inst->getNumArgOperands();
+ Ice::Inst *convertCallInstruction(const CallInst *Instr) {
+ Ice::Variable *Dest = mapValueToIceVar(Instr);
+ Ice::Operand *CallTarget = convertValue(Instr->getCalledValue());
+ unsigned NumArgs = Instr->getNumArgOperands();
// Note: Subzero doesn't (yet) do anything special with the Tail flag in
// the bitcode, i.e. CallInst::isTailCall().
Ice::InstCall *NewInst = nullptr;
@@ -563,7 +563,7 @@
Info = Ctx->getIntrinsicsInfo().find(Target->getName(), BadIntrinsic);
if (BadIntrinsic) {
report_fatal_error(std::string("Invalid PNaCl intrinsic call: ") +
- LLVMObjectAsString(Inst));
+ LLVMObjectAsString(Instr));
}
if (Info)
NewInst = Ice::InstIntrinsicCall::create(Func.get(), NumArgs, Dest,
@@ -573,10 +573,10 @@
// Not an intrinsic call.
if (NewInst == nullptr) {
NewInst = Ice::InstCall::create(Func.get(), NumArgs, Dest, CallTarget,
- Inst->isTailCall());
+ Instr->isTailCall());
}
for (unsigned i = 0; i < NumArgs; ++i) {
- NewInst->addArg(convertOperand(Inst, i));
+ NewInst->addArg(convertOperand(Instr, i));
}
if (Info) {
validateIntrinsicCall(NewInst, Info);
@@ -584,24 +584,24 @@
return NewInst;
}
- Ice::Inst *convertAllocaInstruction(const AllocaInst *Inst) {
+ Ice::Inst *convertAllocaInstruction(const AllocaInst *Instr) {
// PNaCl bitcode only contains allocas of byte-granular objects.
- Ice::Operand *ByteCount = convertValue(Inst->getArraySize());
- uint32_t Align = Inst->getAlignment();
- Ice::Variable *Dest = mapValueToIceVar(Inst, Ice::getPointerType());
+ Ice::Operand *ByteCount = convertValue(Instr->getArraySize());
+ uint32_t Align = Instr->getAlignment();
+ Ice::Variable *Dest = mapValueToIceVar(Instr, Ice::getPointerType());
return Ice::InstAlloca::create(Func.get(), Dest, ByteCount, Align);
}
- Ice::Inst *convertUnreachableInstruction(const UnreachableInst * /*Inst*/) {
+ Ice::Inst *convertUnreachableInstruction(const UnreachableInst * /*Instr*/) {
return Ice::InstUnreachable::create(Func.get());
}
Ice::CfgNode *convertBasicBlock(const BasicBlock *BB) {
Ice::CfgNode *Node = mapBasicBlockToNode(BB);
for (const Instruction &II : *BB) {
- Ice::Inst *Inst = convertInstruction(&II);
- Node->appendInst(Inst);
+ Ice::Inst *Instr = convertInstruction(&II);
+ Node->appendInst(Instr);
}
return Node;
}
diff --git a/src/IceInst.h b/src/IceInst.h
index c1d5bcc..9daf8e2 100644
--- a/src/IceInst.h
+++ b/src/IceInst.h
@@ -258,7 +258,7 @@
bool getKnownFrameOffset() const { return KnownFrameOffset; }
void setKnownFrameOffset() { KnownFrameOffset = true; }
void dump(const Cfg *Func) const override;
- static bool classof(const Inst *Inst) { return Inst->getKind() == Alloca; }
+ static bool classof(const Inst *Instr) { return Instr->getKind() == Alloca; }
private:
InstAlloca(Cfg *Func, Variable *Dest, Operand *ByteCount,
@@ -295,8 +295,8 @@
static const char *getOpName(OpKind Op);
bool isCommutative() const;
void dump(const Cfg *Func) const override;
- static bool classof(const Inst *Inst) {
- return Inst->getKind() == Arithmetic;
+ static bool classof(const Inst *Instr) {
+ return Instr->getKind() == Arithmetic;
}
private:
@@ -322,7 +322,7 @@
}
bool isVarAssign() const override;
void dump(const Cfg *Func) const override;
- static bool classof(const Inst *Inst) { return Inst->getKind() == Assign; }
+ static bool classof(const Inst *Instr) { return Instr->getKind() == Assign; }
private:
InstAssign(Cfg *Func, Variable *Dest, Operand *Source);
@@ -362,7 +362,7 @@
bool isUnconditionalBranch() const override { return isUnconditional(); }
bool repointEdges(CfgNode *OldNode, CfgNode *NewNode) override;
void dump(const Cfg *Func) const override;
- static bool classof(const Inst *Inst) { return Inst->getKind() == Br; }
+ static bool classof(const Inst *Instr) { return Instr->getKind() == Br; }
private:
/// Conditional branch
@@ -401,7 +401,7 @@
bool isTailcall() const { return HasTailCall; }
bool isTargetHelperCall() const { return IsTargetHelperCall; }
void dump(const Cfg *Func) const override;
- static bool classof(const Inst *Inst) { return Inst->getKind() == Call; }
+ static bool classof(const Inst *Instr) { return Instr->getKind() == Call; }
Type getReturnType() const;
protected:
@@ -442,7 +442,7 @@
}
OpKind getCastKind() const { return CastKind; }
void dump(const Cfg *Func) const override;
- static bool classof(const Inst *Inst) { return Inst->getKind() == Cast; }
+ static bool classof(const Inst *Instr) { return Instr->getKind() == Cast; }
private:
InstCast(Cfg *Func, OpKind CastKind, Variable *Dest, Operand *Source);
@@ -464,8 +464,8 @@
}
void dump(const Cfg *Func) const override;
- static bool classof(const Inst *Inst) {
- return Inst->getKind() == ExtractElement;
+ static bool classof(const Inst *Instr) {
+ return Instr->getKind() == ExtractElement;
}
private:
@@ -495,7 +495,7 @@
}
FCond getCondition() const { return Condition; }
void dump(const Cfg *Func) const override;
- static bool classof(const Inst *Inst) { return Inst->getKind() == Fcmp; }
+ static bool classof(const Inst *Instr) { return Instr->getKind() == Fcmp; }
private:
InstFcmp(Cfg *Func, FCond Condition, Variable *Dest, Operand *Source1,
@@ -526,7 +526,7 @@
}
ICond getCondition() const { return Condition; }
void dump(const Cfg *Func) const override;
- static bool classof(const Inst *Inst) { return Inst->getKind() == Icmp; }
+ static bool classof(const Inst *Instr) { return Instr->getKind() == Icmp; }
private:
InstIcmp(Cfg *Func, ICond Condition, Variable *Dest, Operand *Source1,
@@ -549,8 +549,8 @@
}
void dump(const Cfg *Func) const override;
- static bool classof(const Inst *Inst) {
- return Inst->getKind() == InsertElement;
+ static bool classof(const Inst *Instr) {
+ return Instr->getKind() == InsertElement;
}
private:
@@ -572,8 +572,8 @@
return new (Func->allocate<InstIntrinsicCall>())
InstIntrinsicCall(Func, NumArgs, Dest, CallTarget, Info);
}
- static bool classof(const Inst *Inst) {
- return Inst->getKind() == IntrinsicCall;
+ static bool classof(const Inst *Instr) {
+ return Instr->getKind() == IntrinsicCall;
}
Intrinsics::IntrinsicInfo getIntrinsicInfo() const { return Info; }
@@ -603,7 +603,7 @@
}
Operand *getSourceAddress() const { return getSrc(0); }
void dump(const Cfg *Func) const override;
- static bool classof(const Inst *Inst) { return Inst->getKind() == Load; }
+ static bool classof(const Inst *Instr) { return Instr->getKind() == Load; }
private:
InstLoad(Cfg *Func, Variable *Dest, Operand *SourceAddr);
@@ -627,7 +627,7 @@
Liveness *Liveness);
Inst *lower(Cfg *Func);
void dump(const Cfg *Func) const override;
- static bool classof(const Inst *Inst) { return Inst->getKind() == Phi; }
+ static bool classof(const Inst *Instr) { return Instr->getKind() == Phi; }
private:
InstPhi(Cfg *Func, SizeT MaxSrcs, Variable *Dest);
@@ -661,7 +661,7 @@
}
NodeList getTerminatorEdges() const override { return NodeList(); }
void dump(const Cfg *Func) const override;
- static bool classof(const Inst *Inst) { return Inst->getKind() == Ret; }
+ static bool classof(const Inst *Instr) { return Instr->getKind() == Ret; }
private:
InstRet(Cfg *Func, Operand *RetValue);
@@ -683,7 +683,7 @@
Operand *getTrueOperand() const { return getSrc(1); }
Operand *getFalseOperand() const { return getSrc(2); }
void dump(const Cfg *Func) const override;
- static bool classof(const Inst *Inst) { return Inst->getKind() == Select; }
+ static bool classof(const Inst *Instr) { return Instr->getKind() == Select; }
private:
InstSelect(Cfg *Func, Variable *Dest, Operand *Condition, Operand *Source1,
@@ -709,7 +709,7 @@
Variable *getRmwBeacon() const;
void setRmwBeacon(Variable *Beacon);
void dump(const Cfg *Func) const override;
- static bool classof(const Inst *Inst) { return Inst->getKind() == Store; }
+ static bool classof(const Inst *Instr) { return Instr->getKind() == Store; }
private:
InstStore(Cfg *Func, Operand *Data, Operand *Addr);
@@ -742,7 +742,7 @@
NodeList getTerminatorEdges() const override;
bool repointEdges(CfgNode *OldNode, CfgNode *NewNode) override;
void dump(const Cfg *Func) const override;
- static bool classof(const Inst *Inst) { return Inst->getKind() == Switch; }
+ static bool classof(const Inst *Instr) { return Instr->getKind() == Switch; }
private:
InstSwitch(Cfg *Func, SizeT NumCases, Operand *Source, CfgNode *LabelDefault);
@@ -770,8 +770,8 @@
}
NodeList getTerminatorEdges() const override { return NodeList(); }
void dump(const Cfg *Func) const override;
- static bool classof(const Inst *Inst) {
- return Inst->getKind() == Unreachable;
+ static bool classof(const Inst *Instr) {
+ return Instr->getKind() == Unreachable;
}
private:
@@ -795,8 +795,8 @@
void emitIAS(const Cfg * /* Func */) const override {}
void dump(const Cfg *Func) const override;
Option getOption() const { return BundleOption; }
- static bool classof(const Inst *Inst) {
- return Inst->getKind() == BundleLock;
+ static bool classof(const Inst *Instr) {
+ return Instr->getKind() == BundleLock;
}
private:
@@ -817,8 +817,8 @@
void emit(const Cfg *Func) const override;
void emitIAS(const Cfg * /* Func */) const override {}
void dump(const Cfg *Func) const override;
- static bool classof(const Inst *Inst) {
- return Inst->getKind() == BundleUnlock;
+ static bool classof(const Inst *Instr) {
+ return Instr->getKind() == BundleUnlock;
}
private:
@@ -849,7 +849,7 @@
void emit(const Cfg *Func) const override;
void emitIAS(const Cfg * /* Func */) const override {}
void dump(const Cfg *Func) const override;
- static bool classof(const Inst *Inst) { return Inst->getKind() == FakeDef; }
+ static bool classof(const Inst *Instr) { return Instr->getKind() == FakeDef; }
private:
InstFakeDef(Cfg *Func, Variable *Dest, Variable *Src);
@@ -874,7 +874,7 @@
void emit(const Cfg *Func) const override;
void emitIAS(const Cfg * /* Func */) const override {}
void dump(const Cfg *Func) const override;
- static bool classof(const Inst *Inst) { return Inst->getKind() == FakeUse; }
+ static bool classof(const Inst *Instr) { return Instr->getKind() == FakeUse; }
private:
InstFakeUse(Cfg *Func, Variable *Src, uint32_t Weight);
@@ -902,7 +902,9 @@
void emit(const Cfg *Func) const override;
void emitIAS(const Cfg * /* Func */) const override {}
void dump(const Cfg *Func) const override;
- static bool classof(const Inst *Inst) { return Inst->getKind() == FakeKill; }
+ static bool classof(const Inst *Instr) {
+ return Instr->getKind() == FakeKill;
+ }
private:
InstFakeKill(Cfg *Func, const Inst *Linked);
@@ -936,7 +938,9 @@
return Targets[I];
}
void dump(const Cfg *Func) const override;
- static bool classof(const Inst *Inst) { return Inst->getKind() == JumpTable; }
+ static bool classof(const Inst *Instr) {
+ return Instr->getKind() == JumpTable;
+ }
static IceString makeName(const IceString &FuncName, SizeT Id) {
return ".L" + FuncName + "$jumptable$__" + std::to_string(Id);
@@ -964,7 +968,7 @@
public:
uint32_t getEmitInstCount() const override { return 1; }
void dump(const Cfg *Func) const override;
- static bool classof(const Inst *Inst) { return Inst->getKind() >= Target; }
+ static bool classof(const Inst *Instr) { return Instr->getKind() >= Target; }
protected:
InstTarget(Cfg *Func, InstKind Kind, SizeT MaxSrcs, Variable *Dest)
diff --git a/src/IceInstARM32.cpp b/src/IceInstARM32.cpp
index 9265515..6b9c5a0 100644
--- a/src/IceInstARM32.cpp
+++ b/src/IceInstARM32.cpp
@@ -135,106 +135,107 @@
void InstARM32::emitIAS(const Cfg *Func) const { emitUsingTextFixup(Func); }
void InstARM32Pred::emitUnaryopGPR(const char *Opcode,
- const InstARM32Pred *Inst, const Cfg *Func,
+ const InstARM32Pred *Instr, const Cfg *Func,
bool NeedsWidthSuffix) {
Ostream &Str = Func->getContext()->getStrEmit();
- assert(Inst->getSrcSize() == 1);
- Type SrcTy = Inst->getSrc(0)->getType();
+ assert(Instr->getSrcSize() == 1);
+ Type SrcTy = Instr->getSrc(0)->getType();
Str << "\t" << Opcode;
if (NeedsWidthSuffix)
Str << getWidthString(SrcTy);
- Str << Inst->getPredicate() << "\t";
- Inst->getDest()->emit(Func);
+ Str << Instr->getPredicate() << "\t";
+ Instr->getDest()->emit(Func);
Str << ", ";
- Inst->getSrc(0)->emit(Func);
+ Instr->getSrc(0)->emit(Func);
}
-void InstARM32Pred::emitUnaryopFP(const char *Opcode, const InstARM32Pred *Inst,
- const Cfg *Func) {
+void InstARM32Pred::emitUnaryopFP(const char *Opcode,
+ const InstARM32Pred *Instr, const Cfg *Func) {
Ostream &Str = Func->getContext()->getStrEmit();
- assert(Inst->getSrcSize() == 1);
- Type SrcTy = Inst->getSrc(0)->getType();
- Str << "\t" << Opcode << Inst->getPredicate() << getVecWidthString(SrcTy)
+ assert(Instr->getSrcSize() == 1);
+ Type SrcTy = Instr->getSrc(0)->getType();
+ Str << "\t" << Opcode << Instr->getPredicate() << getVecWidthString(SrcTy)
<< "\t";
- Inst->getDest()->emit(Func);
+ Instr->getDest()->emit(Func);
Str << ", ";
- Inst->getSrc(0)->emit(Func);
+ Instr->getSrc(0)->emit(Func);
}
-void InstARM32Pred::emitTwoAddr(const char *Opcode, const InstARM32Pred *Inst,
+void InstARM32Pred::emitTwoAddr(const char *Opcode, const InstARM32Pred *Instr,
const Cfg *Func) {
if (!BuildDefs::dump())
return;
Ostream &Str = Func->getContext()->getStrEmit();
- assert(Inst->getSrcSize() == 2);
- Variable *Dest = Inst->getDest();
- assert(Dest == Inst->getSrc(0));
- Str << "\t" << Opcode << Inst->getPredicate() << "\t";
+ assert(Instr->getSrcSize() == 2);
+ Variable *Dest = Instr->getDest();
+ assert(Dest == Instr->getSrc(0));
+ Str << "\t" << Opcode << Instr->getPredicate() << "\t";
Dest->emit(Func);
Str << ", ";
- Inst->getSrc(1)->emit(Func);
+ Instr->getSrc(1)->emit(Func);
}
-void InstARM32Pred::emitThreeAddr(const char *Opcode, const InstARM32Pred *Inst,
- const Cfg *Func, bool SetFlags) {
+void InstARM32Pred::emitThreeAddr(const char *Opcode,
+ const InstARM32Pred *Instr, const Cfg *Func,
+ bool SetFlags) {
if (!BuildDefs::dump())
return;
Ostream &Str = Func->getContext()->getStrEmit();
- assert(Inst->getSrcSize() == 2);
- Str << "\t" << Opcode << (SetFlags ? "s" : "") << Inst->getPredicate()
+ assert(Instr->getSrcSize() == 2);
+ Str << "\t" << Opcode << (SetFlags ? "s" : "") << Instr->getPredicate()
<< "\t";
- Inst->getDest()->emit(Func);
+ Instr->getDest()->emit(Func);
Str << ", ";
- Inst->getSrc(0)->emit(Func);
+ Instr->getSrc(0)->emit(Func);
Str << ", ";
- Inst->getSrc(1)->emit(Func);
+ Instr->getSrc(1)->emit(Func);
}
-void InstARM32::emitThreeAddrFP(const char *Opcode, const InstARM32 *Inst,
+void InstARM32::emitThreeAddrFP(const char *Opcode, const InstARM32 *Instr,
const Cfg *Func) {
if (!BuildDefs::dump())
return;
Ostream &Str = Func->getContext()->getStrEmit();
- assert(Inst->getSrcSize() == 2);
- Str << "\t" << Opcode << getVecWidthString(Inst->getDest()->getType())
+ assert(Instr->getSrcSize() == 2);
+ Str << "\t" << Opcode << getVecWidthString(Instr->getDest()->getType())
<< "\t";
- Inst->getDest()->emit(Func);
+ Instr->getDest()->emit(Func);
Str << ", ";
- Inst->getSrc(0)->emit(Func);
+ Instr->getSrc(0)->emit(Func);
Str << ", ";
- Inst->getSrc(1)->emit(Func);
+ Instr->getSrc(1)->emit(Func);
}
-void InstARM32::emitFourAddrFP(const char *Opcode, const InstARM32 *Inst,
+void InstARM32::emitFourAddrFP(const char *Opcode, const InstARM32 *Instr,
const Cfg *Func) {
if (!BuildDefs::dump())
return;
Ostream &Str = Func->getContext()->getStrEmit();
- assert(Inst->getSrcSize() == 3);
- assert(Inst->getSrc(0) == Inst->getDest());
- Str << "\t" << Opcode << getVecWidthString(Inst->getDest()->getType())
+ assert(Instr->getSrcSize() == 3);
+ assert(Instr->getSrc(0) == Instr->getDest());
+ Str << "\t" << Opcode << getVecWidthString(Instr->getDest()->getType())
<< "\t";
- Inst->getDest()->emit(Func);
+ Instr->getDest()->emit(Func);
Str << ", ";
- Inst->getSrc(1)->emit(Func);
+ Instr->getSrc(1)->emit(Func);
Str << ", ";
- Inst->getSrc(2)->emit(Func);
+ Instr->getSrc(2)->emit(Func);
}
-void InstARM32Pred::emitFourAddr(const char *Opcode, const InstARM32Pred *Inst,
+void InstARM32Pred::emitFourAddr(const char *Opcode, const InstARM32Pred *Instr,
const Cfg *Func) {
if (!BuildDefs::dump())
return;
Ostream &Str = Func->getContext()->getStrEmit();
- assert(Inst->getSrcSize() == 3);
- Str << "\t" << Opcode << Inst->getPredicate() << "\t";
- Inst->getDest()->emit(Func);
+ assert(Instr->getSrcSize() == 3);
+ Str << "\t" << Opcode << Instr->getPredicate() << "\t";
+ Instr->getDest()->emit(Func);
Str << ", ";
- Inst->getSrc(0)->emit(Func);
+ Instr->getSrc(0)->emit(Func);
Str << ", ";
- Inst->getSrc(1)->emit(Func);
+ Instr->getSrc(1)->emit(Func);
Str << ", ";
- Inst->getSrc(2)->emit(Func);
+ Instr->getSrc(2)->emit(Func);
}
template <InstARM32::InstKindARM32 K>
@@ -268,16 +269,16 @@
emitUsingTextFixup(Func);
}
-void InstARM32Pred::emitCmpLike(const char *Opcode, const InstARM32Pred *Inst,
+void InstARM32Pred::emitCmpLike(const char *Opcode, const InstARM32Pred *Instr,
const Cfg *Func) {
if (!BuildDefs::dump())
return;
Ostream &Str = Func->getContext()->getStrEmit();
- assert(Inst->getSrcSize() == 2);
- Str << "\t" << Opcode << Inst->getPredicate() << "\t";
- Inst->getSrc(0)->emit(Func);
+ assert(Instr->getSrcSize() == 2);
+ Str << "\t" << Opcode << Instr->getPredicate() << "\t";
+ Instr->getSrc(0)->emit(Func);
Str << ", ";
- Inst->getSrc(1)->emit(Func);
+ Instr->getSrc(1)->emit(Func);
}
OperandARM32Mem::OperandARM32Mem(Cfg * /* Func */, Type Ty, Variable *Base,
diff --git a/src/IceInstARM32.h b/src/IceInstARM32.h
index 17bed4a..bce1aca 100644
--- a/src/IceInstARM32.h
+++ b/src/IceInstARM32.h
@@ -449,9 +449,9 @@
void startNextInst(const Cfg *Func) const;
/// Shared emit routines for common forms of instructions.
- static void emitThreeAddrFP(const char *Opcode, const InstARM32 *Inst,
+ static void emitThreeAddrFP(const char *Opcode, const InstARM32 *Instr,
const Cfg *Func);
- static void emitFourAddrFP(const char *Opcode, const InstARM32 *Inst,
+ static void emitFourAddrFP(const char *Opcode, const InstARM32 *Instr,
const Cfg *Func);
void dump(const Cfg *Func) const override;
@@ -462,8 +462,8 @@
InstARM32(Cfg *Func, InstKindARM32 Kind, SizeT Maxsrcs, Variable *Dest)
: InstTarget(Func, static_cast<InstKind>(Kind), Maxsrcs, Dest) {}
- static bool isClassof(const Inst *Inst, InstKindARM32 MyKind) {
- return Inst->getKind() == static_cast<InstKind>(MyKind);
+ static bool isClassof(const Inst *Instr, InstKindARM32 MyKind) {
+ return Instr->getKind() == static_cast<InstKind>(MyKind);
}
// Generates text of assembly instruction using method emit(), and then adds
@@ -489,17 +489,17 @@
void dumpOpcodePred(Ostream &Str, const char *Opcode, Type Ty) const;
/// Shared emit routines for common forms of instructions.
- static void emitUnaryopGPR(const char *Opcode, const InstARM32Pred *Inst,
+ static void emitUnaryopGPR(const char *Opcode, const InstARM32Pred *Instr,
const Cfg *Func, bool NeedsWidthSuffix);
- static void emitUnaryopFP(const char *Opcode, const InstARM32Pred *Inst,
+ static void emitUnaryopFP(const char *Opcode, const InstARM32Pred *Instr,
const Cfg *Func);
- static void emitTwoAddr(const char *Opcode, const InstARM32Pred *Inst,
+ static void emitTwoAddr(const char *Opcode, const InstARM32Pred *Instr,
const Cfg *Func);
- static void emitThreeAddr(const char *Opcode, const InstARM32Pred *Inst,
+ static void emitThreeAddr(const char *Opcode, const InstARM32Pred *Instr,
const Cfg *Func, bool SetFlags);
- static void emitFourAddr(const char *Opcode, const InstARM32Pred *Inst,
+ static void emitFourAddr(const char *Opcode, const InstARM32Pred *Instr,
const Cfg *Func);
- static void emitCmpLike(const char *Opcode, const InstARM32Pred *Inst,
+ static void emitCmpLike(const char *Opcode, const InstARM32Pred *Instr,
const Cfg *Func);
protected:
@@ -541,7 +541,7 @@
Str << " ";
dumpSources(Func);
}
- static bool classof(const Inst *Inst) { return isClassof(Inst, K); }
+ static bool classof(const Inst *Instr) { return isClassof(Instr, K); }
private:
InstARM32UnaryopGPR(Cfg *Func, Variable *Dest, Operand *Src,
@@ -582,7 +582,7 @@
Str << " ";
dumpSources(Func);
}
- static bool classof(const Inst *Inst) { return isClassof(Inst, K); }
+ static bool classof(const Inst *Instr) { return isClassof(Instr, K); }
private:
InstARM32UnaryopFP(Cfg *Func, Variable *Dest, Operand *Src,
@@ -624,7 +624,7 @@
Str << " ";
dumpSources(Func);
}
- static bool classof(const Inst *Inst) { return isClassof(Inst, K); }
+ static bool classof(const Inst *Instr) { return isClassof(Instr, K); }
private:
InstARM32TwoAddrGPR(Cfg *Func, Variable *Dest, Operand *Src,
@@ -662,7 +662,7 @@
Str << ", ";
dumpSources(Func);
}
- static bool classof(const Inst *Inst) { return isClassof(Inst, K); }
+ static bool classof(const Inst *Instr) { return isClassof(Instr, K); }
private:
InstARM32LoadBase(Cfg *Func, Variable *Dest, Operand *Source,
@@ -708,7 +708,7 @@
Str << (SetFlags ? ".s " : " ");
dumpSources(Func);
}
- static bool classof(const Inst *Inst) { return isClassof(Inst, K); }
+ static bool classof(const Inst *Instr) { return isClassof(Instr, K); }
private:
InstARM32ThreeAddrGPR(Cfg *Func, Variable *Dest, Variable *Src0,
@@ -756,7 +756,7 @@
Str << Opcode << "." << getDest()->getType() << " ";
dumpSources(Func);
}
- static bool classof(const Inst *Inst) { return isClassof(Inst, K); }
+ static bool classof(const Inst *Instr) { return isClassof(Instr, K); }
private:
InstARM32ThreeAddrFP(Cfg *Func, Variable *Dest, Variable *Src0,
@@ -800,7 +800,7 @@
Str << " ";
dumpSources(Func);
}
- static bool classof(const Inst *Inst) { return isClassof(Inst, K); }
+ static bool classof(const Inst *Instr) { return isClassof(Instr, K); }
private:
InstARM32FourAddrGPR(Cfg *Func, Variable *Dest, Variable *Src0,
@@ -850,7 +850,7 @@
Str << ", ";
dumpSources(Func);
}
- static bool classof(const Inst *Inst) { return isClassof(Inst, K); }
+ static bool classof(const Inst *Instr) { return isClassof(Instr, K); }
private:
InstARM32FourAddrFP(Cfg *Func, Variable *Dest, Variable *Src0, Variable *Src1)
@@ -890,7 +890,7 @@
Str << " ";
dumpSources(Func);
}
- static bool classof(const Inst *Inst) { return isClassof(Inst, K); }
+ static bool classof(const Inst *Instr) { return isClassof(Instr, K); }
private:
InstARM32CmpLike(Cfg *Func, Variable *Src0, Operand *Src1,
@@ -1038,7 +1038,7 @@
void emit(const Cfg *Func) const override;
void emitIAS(const Cfg *Func) const override;
void dump(const Cfg *Func) const override;
- static bool classof(const Inst *Inst) { return isClassof(Inst, Br); }
+ static bool classof(const Inst *Instr) { return isClassof(Instr, Br); }
private:
InstARM32Br(Cfg *Func, const CfgNode *TargetTrue, const CfgNode *TargetFalse,
@@ -1066,7 +1066,7 @@
void emit(const Cfg *Func) const override;
void emitIAS(const Cfg *Func) const override;
void dump(const Cfg *Func) const override;
- static bool classof(const Inst *Inst) { return isClassof(Inst, Call); }
+ static bool classof(const Inst *Instr) { return isClassof(Instr, Call); }
private:
InstARM32Call(Cfg *Func, Variable *Dest, Operand *CallTarget);
@@ -1115,7 +1115,7 @@
static InstARM32Pop *create(Cfg *Func, const VarList &Dests) {
return new (Func->allocate<InstARM32Pop>()) InstARM32Pop(Func, Dests);
}
- static bool classof(const Inst *Inst) { return isClassof(Inst, Pop); }
+ static bool classof(const Inst *Instr) { return isClassof(Instr, Pop); }
private:
InstARM32Pop(Cfg *Func, const VarList &Dests);
@@ -1144,7 +1144,7 @@
static InstARM32Push *create(Cfg *Func, const VarList &Srcs) {
return new (Func->allocate<InstARM32Push>()) InstARM32Push(Func, Srcs);
}
- static bool classof(const Inst *Inst) { return isClassof(Inst, Push); }
+ static bool classof(const Inst *Instr) { return isClassof(Instr, Push); }
private:
InstARM32Push(Cfg *Func, const VarList &Srcs);
@@ -1182,7 +1182,7 @@
void emit(const Cfg *Func) const override;
void emitIAS(const Cfg *Func) const override;
void dump(const Cfg *Func) const override;
- static bool classof(const Inst *Inst) { return isClassof(Inst, Ret); }
+ static bool classof(const Inst *Instr) { return isClassof(Instr, Ret); }
private:
InstARM32Ret(Cfg *Func, Variable *LR, Variable *Source);
@@ -1205,7 +1205,7 @@
void emit(const Cfg *Func) const override;
void emitIAS(const Cfg *Func) const override;
void dump(const Cfg *Func) const override;
- static bool classof(const Inst *Inst) { return isClassof(Inst, Str); }
+ static bool classof(const Inst *Instr) { return isClassof(Instr, Str); }
private:
InstARM32Str(Cfg *Func, Variable *Value, OperandARM32Mem *Mem,
@@ -1231,7 +1231,7 @@
void emit(const Cfg *Func) const override;
void emitIAS(const Cfg *Func) const override;
void dump(const Cfg *Func) const override;
- static bool classof(const Inst *Inst) { return isClassof(Inst, Strex); }
+ static bool classof(const Inst *Instr) { return isClassof(Instr, Strex); }
private:
InstARM32Strex(Cfg *Func, Variable *Dest, Variable *Value,
@@ -1250,7 +1250,7 @@
void emit(const Cfg *Func) const override;
void emitIAS(const Cfg *Func) const override;
void dump(const Cfg *Func) const override;
- static bool classof(const Inst *Inst) { return isClassof(Inst, Trap); }
+ static bool classof(const Inst *Instr) { return isClassof(Instr, Trap); }
private:
explicit InstARM32Trap(Cfg *Func);
@@ -1273,7 +1273,7 @@
void emit(const Cfg *Func) const override;
void emitIAS(const Cfg *Func) const override;
void dump(const Cfg *Func) const override;
- static bool classof(const Inst *Inst) { return isClassof(Inst, Umull); }
+ static bool classof(const Inst *Instr) { return isClassof(Instr, Umull); }
private:
InstARM32Umull(Cfg *Func, Variable *DestLo, Variable *DestHi, Variable *Src0,
@@ -1298,7 +1298,7 @@
void emit(const Cfg *Func) const override;
void emitIAS(const Cfg *Func) const override;
void dump(const Cfg *Func) const override;
- static bool classof(const Inst *Inst) { return isClassof(Inst, Vcvt); }
+ static bool classof(const Inst *Instr) { return isClassof(Instr, Vcvt); }
private:
InstARM32Vcvt(Cfg *Func, Variable *Dest, Variable *Src, VcvtVariant Variant,
@@ -1328,7 +1328,7 @@
void emit(const Cfg *Func) const override;
void emitIAS(const Cfg *Func) const override;
void dump(const Cfg *Func) const override;
- static bool classof(const Inst *Inst) { return isClassof(Inst, Mov); }
+ static bool classof(const Inst *Instr) { return isClassof(Instr, Mov); }
bool isMultiDest() const { return DestHi != nullptr; }
@@ -1369,7 +1369,7 @@
void emit(const Cfg *Func) const override;
void emitIAS(const Cfg *Func) const override;
void dump(const Cfg *Func) const override;
- static bool classof(const Inst *Inst) { return isClassof(Inst, Vcmp); }
+ static bool classof(const Inst *Instr) { return isClassof(Instr, Vcmp); }
private:
InstARM32Vcmp(Cfg *Func, Variable *Src0, Operand *Src1,
@@ -1389,7 +1389,7 @@
void emit(const Cfg *Func) const override;
void emitIAS(const Cfg *Func) const override;
void dump(const Cfg *Func) const override;
- static bool classof(const Inst *Inst) { return isClassof(Inst, Vmrs); }
+ static bool classof(const Inst *Instr) { return isClassof(Instr, Vmrs); }
private:
InstARM32Vmrs(Cfg *Func, CondARM32::Cond Predicate);
@@ -1409,7 +1409,7 @@
void emit(const Cfg *Func) const override;
void emitIAS(const Cfg *Func) const override;
void dump(const Cfg *Func) const override;
- static bool classof(const Inst *Inst) { return isClassof(Inst, Vabs); }
+ static bool classof(const Inst *Instr) { return isClassof(Instr, Vabs); }
private:
InstARM32Vabs(Cfg *Func, Variable *Dest, Variable *Src,
@@ -1428,7 +1428,7 @@
void emit(const Cfg *Func) const override;
void emitIAS(const Cfg *Func) const override;
void dump(const Cfg *Func) const override;
- static bool classof(const Inst *Inst) { return isClassof(Inst, Dmb); }
+ static bool classof(const Inst *Instr) { return isClassof(Instr, Dmb); }
private:
explicit InstARM32Dmb(Cfg *Func);
diff --git a/src/IceInstX86Base.h b/src/IceInstX86Base.h
index 3e63cb8..5cfdfa6 100644
--- a/src/IceInstX86Base.h
+++ b/src/IceInstX86Base.h
@@ -201,8 +201,8 @@
InstX86Base(Cfg *Func, InstKindX86 Kind, SizeT Maxsrcs, Variable *Dest)
: InstTarget(Func, static_cast<InstKind>(Kind), Maxsrcs, Dest) {}
- static bool isClassof(const Inst *Inst, InstKindX86 MyKind) {
- return Inst->getKind() == static_cast<InstKind>(MyKind);
+ static bool isClassof(const Inst *Instr, InstKindX86 MyKind) {
+ return Instr->getKind() == static_cast<InstKind>(MyKind);
}
// Most instructions that operate on vector arguments require vector memory
// operands to be fully aligned (16-byte alignment for PNaCl vector types).
@@ -256,8 +256,8 @@
return llvm::cast<Variable>(this->getSrc(2));
}
void dump(const Cfg *Func) const override;
- static bool classof(const Inst *Inst) {
- return InstX86Base::isClassof(Inst, InstX86Base::FakeRMW);
+ static bool classof(const Inst *Instr) {
+ return InstX86Base::isClassof(Instr, InstX86Base::FakeRMW);
}
private:
@@ -278,8 +278,8 @@
void emit(const Cfg *Func) const override;
void emitIAS(const Cfg *Func) const override;
void dump(const Cfg *Func) const override;
- static bool classof(const Inst *Inst) {
- return InstX86Base::isClassof(Inst, InstX86Base::GetIP);
+ static bool classof(const Inst *Instr) {
+ return InstX86Base::isClassof(Instr, InstX86Base::GetIP);
}
private:
@@ -412,8 +412,8 @@
void emit(const Cfg *Func) const override;
void emitIAS(const Cfg *Func) const override;
void dump(const Cfg *Func) const override;
- static bool classof(const Inst *Inst) {
- return InstX86Base::isClassof(Inst, InstX86Base::Br);
+ static bool classof(const Inst *Instr) {
+ return InstX86Base::isClassof(Instr, InstX86Base::Br);
}
private:
@@ -443,8 +443,8 @@
void emit(const Cfg *Func) const override;
void emitIAS(const Cfg *Func) const override;
void dump(const Cfg *Func) const override;
- static bool classof(const Inst *Inst) {
- return InstX86Base::isClassof(Inst, InstX86Base::Jmp);
+ static bool classof(const Inst *Instr) {
+ return InstX86Base::isClassof(Instr, InstX86Base::Jmp);
}
private:
@@ -466,8 +466,8 @@
void emit(const Cfg *Func) const override;
void emitIAS(const Cfg *Func) const override;
void dump(const Cfg *Func) const override;
- static bool classof(const Inst *Inst) {
- return InstX86Base::isClassof(Inst, InstX86Base::Call);
+ static bool classof(const Inst *Instr) {
+ return InstX86Base::isClassof(Instr, InstX86Base::Call);
}
private:
@@ -517,10 +517,10 @@
const Operand *Src,
const XmmEmitterMovOps Emitter);
- static void emitVariableBlendInst(const char *Opcode, const Inst *Inst,
+ static void emitVariableBlendInst(const char *Opcode, const Inst *Instr,
const Cfg *Func);
- static void emitIASVariableBlendInst(const Inst *Inst, const Cfg *Func,
+ static void emitIASVariableBlendInst(const Inst *Instr, const Cfg *Func,
const XmmEmitterRegOp &Emitter);
static void emitIASXmmShift(const Cfg *Func, Type Ty, const Variable *Var,
@@ -567,8 +567,8 @@
Str << " = " << Opcode << "." << this->getDest()->getType() << " ";
this->dumpSources(Func);
}
- static bool classof(const Inst *Inst) {
- return InstX86Base::isClassof(Inst, InstX86Base::K);
+ static bool classof(const Inst *Instr) {
+ return InstX86Base::isClassof(Instr, InstX86Base::K);
}
protected:
@@ -626,8 +626,8 @@
Str << " = " << Opcode << "." << this->getSrc(0)->getType() << " ";
this->dumpSources(Func);
}
- static bool classof(const Inst *Inst) {
- return InstX86Base::isClassof(Inst, InstX86Base::K);
+ static bool classof(const Inst *Instr) {
+ return InstX86Base::isClassof(Instr, InstX86Base::K);
}
protected:
@@ -672,8 +672,8 @@
Str << " = " << Opcode << "." << this->getDest()->getType() << " ";
this->dumpSources(Func);
}
- static bool classof(const Inst *Inst) {
- return InstX86Base::isClassof(Inst, InstX86Base::K);
+ static bool classof(const Inst *Instr) {
+ return InstX86Base::isClassof(Instr, InstX86Base::K);
}
protected:
@@ -714,8 +714,8 @@
Str << " = " << Opcode << "." << this->getDest()->getType() << " ";
this->dumpSources(Func);
}
- static bool classof(const Inst *Inst) {
- return InstX86Base::isClassof(Inst, InstX86Base::K);
+ static bool classof(const Inst *Instr) {
+ return InstX86Base::isClassof(Instr, InstX86Base::K);
}
protected:
@@ -759,8 +759,8 @@
Str << " = " << Opcode << "." << this->getDest()->getType() << " ";
this->dumpSources(Func);
}
- static bool classof(const Inst *Inst) {
- return InstX86Base::isClassof(Inst, InstX86Base::K);
+ static bool classof(const Inst *Instr) {
+ return InstX86Base::isClassof(Instr, InstX86Base::K);
}
protected:
@@ -800,8 +800,8 @@
Str << Opcode << "." << this->getSrc(0)->getType() << " ";
this->dumpSources(Func);
}
- static bool classof(const Inst *Inst) {
- return InstX86Base::isClassof(Inst, InstX86Base::K);
+ static bool classof(const Inst *Instr) {
+ return InstX86Base::isClassof(Instr, InstX86Base::K);
}
protected:
@@ -864,8 +864,8 @@
Str << " = " << Opcode << "." << this->getDest()->getType() << " ";
this->dumpSources(Func);
}
- static bool classof(const Inst *Inst) {
- return InstX86Base::isClassof(Inst, InstX86Base::K);
+ static bool classof(const Inst *Instr) {
+ return InstX86Base::isClassof(Instr, InstX86Base::K);
}
protected:
@@ -918,8 +918,8 @@
Str << " = " << Opcode << "." << this->getDest()->getType() << " ";
this->dumpSources(Func);
}
- static bool classof(const Inst *Inst) {
- return InstX86Base::isClassof(Inst, InstX86Base::K);
+ static bool classof(const Inst *Instr) {
+ return InstX86Base::isClassof(Instr, InstX86Base::K);
}
protected:
@@ -962,8 +962,8 @@
Str << " = " << Opcode << "." << this->getDest()->getType() << " ";
this->dumpSources(Func);
}
- static bool classof(const Inst *Inst) {
- return InstX86Base::isClassof(Inst, InstX86Base::K);
+ static bool classof(const Inst *Instr) {
+ return InstX86Base::isClassof(Instr, InstX86Base::K);
}
protected:
@@ -1009,8 +1009,8 @@
Str << " = " << Opcode << "." << this->getDest()->getType() << " ";
this->dumpSources(Func);
}
- static bool classof(const Inst *Inst) {
- return InstX86Base::isClassof(Inst, InstX86Base::K);
+ static bool classof(const Inst *Instr) {
+ return InstX86Base::isClassof(Instr, InstX86Base::K);
}
protected:
@@ -1066,8 +1066,8 @@
Str << ", ";
this->dumpSources(Func);
}
- static bool classof(const Inst *Inst) {
- return InstX86Base::isClassof(Inst, InstX86Base::K);
+ static bool classof(const Inst *Instr) {
+ return InstX86Base::isClassof(Instr, InstX86Base::K);
}
protected:
@@ -2187,8 +2187,8 @@
void emit(const Cfg *Func) const override;
void emitIAS(const Cfg *Func) const override;
void dump(const Cfg *Func) const override;
- static bool classof(const Inst *Inst) {
- return InstX86Base::isClassof(Inst, InstX86Base::Mul);
+ static bool classof(const Inst *Instr) {
+ return InstX86Base::isClassof(Instr, InstX86Base::Mul);
}
private:
@@ -2210,8 +2210,8 @@
void emit(const Cfg *Func) const override;
void emitIAS(const Cfg *Func) const override;
void dump(const Cfg *Func) const override;
- static bool classof(const Inst *Inst) {
- return InstX86Base::isClassof(Inst, InstX86Base::Shld);
+ static bool classof(const Inst *Instr) {
+ return InstX86Base::isClassof(Instr, InstX86Base::Shld);
}
private:
@@ -2233,8 +2233,8 @@
void emit(const Cfg *Func) const override;
void emitIAS(const Cfg *Func) const override;
void dump(const Cfg *Func) const override;
- static bool classof(const Inst *Inst) {
- return InstX86Base::isClassof(Inst, InstX86Base::Shrd);
+ static bool classof(const Inst *Instr) {
+ return InstX86Base::isClassof(Instr, InstX86Base::Shrd);
}
private:
@@ -2256,8 +2256,8 @@
void emit(const Cfg *Func) const override;
void emitIAS(const Cfg *Func) const override;
void dump(const Cfg *Func) const override;
- static bool classof(const Inst *Inst) {
- return InstX86Base::isClassof(Inst, InstX86Base::Cmov);
+ static bool classof(const Inst *Instr) {
+ return InstX86Base::isClassof(Instr, InstX86Base::Cmov);
}
private:
@@ -2281,8 +2281,8 @@
void emit(const Cfg *Func) const override;
void emitIAS(const Cfg *Func) const override;
void dump(const Cfg *Func) const override;
- static bool classof(const Inst *Inst) {
- return InstX86Base::isClassof(Inst, InstX86Base::Cmpps);
+ static bool classof(const Inst *Instr) {
+ return InstX86Base::isClassof(Instr, InstX86Base::Cmpps);
}
private:
@@ -2310,8 +2310,8 @@
void emit(const Cfg *Func) const override;
void emitIAS(const Cfg *Func) const override;
void dump(const Cfg *Func) const override;
- static bool classof(const Inst *Inst) {
- return InstX86Base::isClassof(Inst, InstX86Base::Cmpxchg);
+ static bool classof(const Inst *Instr) {
+ return InstX86Base::isClassof(Instr, InstX86Base::Cmpxchg);
}
private:
@@ -2339,8 +2339,8 @@
void emit(const Cfg *Func) const override;
void emitIAS(const Cfg *Func) const override;
void dump(const Cfg *Func) const override;
- static bool classof(const Inst *Inst) {
- return InstX86Base::isClassof(Inst, InstX86Base::Cmpxchg8b);
+ static bool classof(const Inst *Instr) {
+ return InstX86Base::isClassof(Instr, InstX86Base::Cmpxchg8b);
}
private:
@@ -2367,8 +2367,8 @@
void emit(const Cfg *Func) const override;
void emitIAS(const Cfg *Func) const override;
void dump(const Cfg *Func) const override;
- static bool classof(const Inst *Inst) {
- return InstX86Base::isClassof(Inst, InstX86Base::Cvt);
+ static bool classof(const Inst *Instr) {
+ return InstX86Base::isClassof(Instr, InstX86Base::Cvt);
}
bool isTruncating() const { return Variant == Tss2si || Variant == Tps2dq; }
@@ -2390,8 +2390,8 @@
void emit(const Cfg *Func) const override;
void emitIAS(const Cfg *Func) const override;
void dump(const Cfg *Func) const override;
- static bool classof(const Inst *Inst) {
- return InstX86Base::isClassof(Inst, InstX86Base::Icmp);
+ static bool classof(const Inst *Instr) {
+ return InstX86Base::isClassof(Instr, InstX86Base::Icmp);
}
private:
@@ -2412,8 +2412,8 @@
void emit(const Cfg *Func) const override;
void emitIAS(const Cfg *Func) const override;
void dump(const Cfg *Func) const override;
- static bool classof(const Inst *Inst) {
- return InstX86Base::isClassof(Inst, InstX86Base::Ucomiss);
+ static bool classof(const Inst *Instr) {
+ return InstX86Base::isClassof(Instr, InstX86Base::Ucomiss);
}
private:
@@ -2433,8 +2433,8 @@
void emit(const Cfg *Func) const override;
void emitIAS(const Cfg *Func) const override;
void dump(const Cfg *Func) const override;
- static bool classof(const Inst *Inst) {
- return InstX86Base::isClassof(Inst, InstX86Base::UD2);
+ static bool classof(const Inst *Instr) {
+ return InstX86Base::isClassof(Instr, InstX86Base::UD2);
}
private:
@@ -2455,8 +2455,8 @@
void emit(const Cfg *Func) const override;
void emitIAS(const Cfg *Func) const override;
void dump(const Cfg *Func) const override;
- static bool classof(const Inst *Inst) {
- return InstX86Base::isClassof(Inst, InstX86Base::Test);
+ static bool classof(const Inst *Instr) {
+ return InstX86Base::isClassof(Instr, InstX86Base::Test);
}
private:
@@ -2476,8 +2476,8 @@
void emit(const Cfg *Func) const override;
void emitIAS(const Cfg *Func) const override;
void dump(const Cfg *Func) const override;
- static bool classof(const Inst *Inst) {
- return InstX86Base::isClassof(Inst, InstX86Base::Mfence);
+ static bool classof(const Inst *Instr) {
+ return InstX86Base::isClassof(Instr, InstX86Base::Mfence);
}
private:
@@ -2500,8 +2500,8 @@
void emit(const Cfg *Func) const override;
void emitIAS(const Cfg *Func) const override;
void dump(const Cfg *Func) const override;
- static bool classof(const Inst *Inst) {
- return InstX86Base::isClassof(Inst, InstX86Base::Store);
+ static bool classof(const Inst *Instr) {
+ return InstX86Base::isClassof(Instr, InstX86Base::Store);
}
private:
@@ -2526,8 +2526,8 @@
void emit(const Cfg *Func) const override;
void emitIAS(const Cfg *Func) const override;
void dump(const Cfg *Func) const override;
- static bool classof(const Inst *Inst) {
- return InstX86Base::isClassof(Inst, InstX86Base::StoreP);
+ static bool classof(const Inst *Instr) {
+ return InstX86Base::isClassof(Instr, InstX86Base::StoreP);
}
private:
@@ -2548,8 +2548,8 @@
void emit(const Cfg *Func) const override;
void emitIAS(const Cfg *Func) const override;
void dump(const Cfg *Func) const override;
- static bool classof(const Inst *Inst) {
- return InstX86Base::isClassof(Inst, InstX86Base::StoreQ);
+ static bool classof(const Inst *Instr) {
+ return InstX86Base::isClassof(Instr, InstX86Base::StoreQ);
}
private:
@@ -2572,8 +2572,8 @@
void emit(const Cfg *Func) const override;
void emitIAS(const Cfg *Func) const override;
void dump(const Cfg *Func) const override;
- static bool classof(const Inst *Inst) {
- return InstX86Base::isClassof(Inst, InstX86Base::Nop);
+ static bool classof(const Inst *Instr) {
+ return InstX86Base::isClassof(Instr, InstX86Base::Nop);
}
private:
@@ -2595,8 +2595,8 @@
void emit(const Cfg *Func) const override;
void emitIAS(const Cfg *Func) const override;
void dump(const Cfg *Func) const override;
- static bool classof(const Inst *Inst) {
- return InstX86Base::isClassof(Inst, InstX86Base::Fld);
+ static bool classof(const Inst *Instr) {
+ return InstX86Base::isClassof(Instr, InstX86Base::Fld);
}
private:
@@ -2616,8 +2616,8 @@
void emit(const Cfg *Func) const override;
void emitIAS(const Cfg *Func) const override;
void dump(const Cfg *Func) const override;
- static bool classof(const Inst *Inst) {
- return InstX86Base::isClassof(Inst, InstX86Base::Fstp);
+ static bool classof(const Inst *Instr) {
+ return InstX86Base::isClassof(Instr, InstX86Base::Fstp);
}
private:
@@ -2636,8 +2636,8 @@
void emit(const Cfg *Func) const override;
void emitIAS(const Cfg *Func) const override;
void dump(const Cfg *Func) const override;
- static bool classof(const Inst *Inst) {
- return InstX86Base::isClassof(Inst, InstX86Base::Pop);
+ static bool classof(const Inst *Instr) {
+ return InstX86Base::isClassof(Instr, InstX86Base::Pop);
}
private:
@@ -2659,8 +2659,8 @@
void emit(const Cfg *Func) const override;
void emitIAS(const Cfg *Func) const override;
void dump(const Cfg *Func) const override;
- static bool classof(const Inst *Inst) {
- return InstX86Base::isClassof(Inst, InstX86Base::Push);
+ static bool classof(const Inst *Instr) {
+ return InstX86Base::isClassof(Instr, InstX86Base::Push);
}
private:
@@ -2686,8 +2686,8 @@
void emit(const Cfg *Func) const override;
void emitIAS(const Cfg *Func) const override;
void dump(const Cfg *Func) const override;
- static bool classof(const Inst *Inst) {
- return InstX86Base::isClassof(Inst, InstX86Base::Ret);
+ static bool classof(const Inst *Instr) {
+ return InstX86Base::isClassof(Instr, InstX86Base::Ret);
}
private:
@@ -2708,8 +2708,8 @@
void emit(const Cfg *Func) const override;
void emitIAS(const Cfg *Func) const override;
void dump(const Cfg *Func) const override;
- static bool classof(const Inst *Inst) {
- return InstX86Base::isClassof(Inst, InstX86Base::Setcc);
+ static bool classof(const Inst *Instr) {
+ return InstX86Base::isClassof(Instr, InstX86Base::Setcc);
}
private:
@@ -2739,8 +2739,8 @@
void emit(const Cfg *Func) const override;
void emitIAS(const Cfg *Func) const override;
void dump(const Cfg *Func) const override;
- static bool classof(const Inst *Inst) {
- return InstX86Base::isClassof(Inst, InstX86Base::Xadd);
+ static bool classof(const Inst *Instr) {
+ return InstX86Base::isClassof(Instr, InstX86Base::Xadd);
}
private:
@@ -2765,8 +2765,8 @@
void emit(const Cfg *Func) const override;
void emitIAS(const Cfg *Func) const override;
void dump(const Cfg *Func) const override;
- static bool classof(const Inst *Inst) {
- return InstX86Base::isClassof(Inst, InstX86Base::Xchg);
+ static bool classof(const Inst *Instr) {
+ return InstX86Base::isClassof(Instr, InstX86Base::Xchg);
}
private:
@@ -2787,8 +2787,8 @@
void emit(const Cfg *Func) const override;
void emitIAS(const Cfg *Func) const override;
void dump(const Cfg *Func) const override;
- static bool classof(const Inst *Inst) {
- return InstX86Base::isClassof(Inst, InstX86Base::IacaStart);
+ static bool classof(const Inst *Instr) {
+ return InstX86Base::isClassof(Instr, InstX86Base::IacaStart);
}
private:
@@ -2809,8 +2809,8 @@
void emit(const Cfg *Func) const override;
void emitIAS(const Cfg *Func) const override;
void dump(const Cfg *Func) const override;
- static bool classof(const Inst *Inst) {
- return InstX86Base::isClassof(Inst, InstX86Base::IacaEnd);
+ static bool classof(const Inst *Instr) {
+ return InstX86Base::isClassof(Instr, InstX86Base::IacaEnd);
}
private:
diff --git a/src/IceInstX86BaseImpl.h b/src/IceInstX86BaseImpl.h
index f360946..5c55bf3 100644
--- a/src/IceInstX86BaseImpl.h
+++ b/src/IceInstX86BaseImpl.h
@@ -1034,28 +1034,28 @@
// pblendvb and blendvps take xmm0 as a final implicit argument.
template <typename TraitsType>
void InstImpl<TraitsType>::emitVariableBlendInst(const char *Opcode,
- const Inst *Inst,
+ const Inst *Instr,
const Cfg *Func) {
if (!BuildDefs::dump())
return;
Ostream &Str = Func->getContext()->getStrEmit();
- assert(Inst->getSrcSize() == 3);
- assert(llvm::cast<Variable>(Inst->getSrc(2))->getRegNum() ==
+ assert(Instr->getSrcSize() == 3);
+ assert(llvm::cast<Variable>(Instr->getSrc(2))->getRegNum() ==
RegisterSet::Reg_xmm0);
Str << "\t" << Opcode << "\t";
- Inst->getSrc(1)->emit(Func);
+ Instr->getSrc(1)->emit(Func);
Str << ", ";
- Inst->getDest()->emit(Func);
+ Instr->getDest()->emit(Func);
}
template <typename TraitsType>
void InstImpl<TraitsType>::emitIASVariableBlendInst(
- const Inst *Inst, const Cfg *Func, const XmmEmitterRegOp &Emitter) {
- assert(Inst->getSrcSize() == 3);
- assert(llvm::cast<Variable>(Inst->getSrc(2))->getRegNum() ==
+ const Inst *Instr, const Cfg *Func, const XmmEmitterRegOp &Emitter) {
+ assert(Instr->getSrcSize() == 3);
+ assert(llvm::cast<Variable>(Instr->getSrc(2))->getRegNum() ==
RegisterSet::Reg_xmm0);
- const Variable *Dest = Inst->getDest();
- const Operand *Src = Inst->getSrc(1);
+ const Variable *Dest = Instr->getDest();
+ const Operand *Src = Instr->getSrc(1);
emitIASRegOpTyXMM(Func, Dest->getType(), Dest, Src, Emitter);
}
diff --git a/src/IceRegAlloc.cpp b/src/IceRegAlloc.cpp
index 5b72263..ced9af5 100644
--- a/src/IceRegAlloc.cpp
+++ b/src/IceRegAlloc.cpp
@@ -214,26 +214,26 @@
CfgVector<InstNumberT> LREnd(Vars.size(), Inst::NumberSentinel);
DefUseErrorList DefsWithoutUses, UsesBeforeDefs;
for (CfgNode *Node : Func->getNodes()) {
- for (Inst &Inst : Node->getInsts()) {
- if (Inst.isDeleted())
+ for (Inst &Instr : Node->getInsts()) {
+ if (Instr.isDeleted())
continue;
- FOREACH_VAR_IN_INST(Var, Inst) {
+ FOREACH_VAR_IN_INST(Var, Instr) {
if (Var->isRematerializable())
continue;
if (Var->getIgnoreLiveness())
continue;
if (Var->hasReg() || Var->mustHaveReg()) {
SizeT VarNum = Var->getIndex();
- LREnd[VarNum] = Inst.getNumber();
+ LREnd[VarNum] = Instr.getNumber();
if (!Var->getIsArg() && LRBegin[VarNum] == Inst::NumberSentinel)
UsesBeforeDefs.push_back(VarNum);
}
}
- if (const Variable *Var = Inst.getDest()) {
+ if (const Variable *Var = Instr.getDest()) {
if (!Var->isRematerializable() && !Var->getIgnoreLiveness() &&
(Var->hasReg() || Var->mustHaveReg())) {
if (LRBegin[Var->getIndex()] == Inst::NumberSentinel) {
- LRBegin[Var->getIndex()] = Inst.getNumber();
+ LRBegin[Var->getIndex()] = Instr.getNumber();
++NumVars;
}
}
diff --git a/src/IceSwitchLowering.cpp b/src/IceSwitchLowering.cpp
index 7861df2..35749bf 100644
--- a/src/IceSwitchLowering.cpp
+++ b/src/IceSwitchLowering.cpp
@@ -22,14 +22,14 @@
namespace Ice {
CaseClusterArray CaseCluster::clusterizeSwitch(Cfg *Func,
- const InstSwitch *Inst) {
+ const InstSwitch *Instr) {
CaseClusterArray CaseClusters;
// Load the cases
- SizeT NumCases = Inst->getNumCases();
+ SizeT NumCases = Instr->getNumCases();
CaseClusters.reserve(NumCases);
for (SizeT I = 0; I < NumCases; ++I)
- CaseClusters.emplace_back(Inst->getValue(I), Inst->getLabel(I));
+ CaseClusters.emplace_back(Instr->getValue(I), Instr->getLabel(I));
// Sort the cases
std::sort(CaseClusters.begin(), CaseClusters.end(),
@@ -75,7 +75,7 @@
// Replace everything with a jump table
InstJumpTable *JumpTable =
- InstJumpTable::create(Func, TotalRange, Inst->getLabelDefault());
+ InstJumpTable::create(Func, TotalRange, Instr->getLabelDefault());
for (const CaseCluster &Case : CaseClusters) {
// Case.High could be UINT64_MAX which makes the loop awkward. Unwrap the
// last iteration to avoid wrap around problems.
diff --git a/src/IceSwitchLowering.h b/src/IceSwitchLowering.h
index 380626b..5b9f673 100644
--- a/src/IceSwitchLowering.h
+++ b/src/IceSwitchLowering.h
@@ -60,7 +60,7 @@
/// Discover cases which can be clustered together and return the clusters
/// ordered by case value.
- static CaseClusterArray clusterizeSwitch(Cfg *Func, const InstSwitch *Inst);
+ static CaseClusterArray clusterizeSwitch(Cfg *Func, const InstSwitch *Instr);
private:
CaseClusterKind Kind;
diff --git a/src/IceTargetLowering.cpp b/src/IceTargetLowering.cpp
index b41bc69..d53fbab 100644
--- a/src/IceTargetLowering.cpp
+++ b/src/IceTargetLowering.cpp
@@ -70,9 +70,9 @@
availabilityReset();
}
-void LoweringContext::insert(Inst *Inst) {
- getNode()->getInsts().insert(Next, Inst);
- LastInserted = Inst;
+void LoweringContext::insert(Inst *Instr) {
+ getNode()->getInsts().insert(Next, Instr);
+ LastInserted = Instr;
}
void LoweringContext::skipDeleted(InstList::iterator &I) const {
@@ -350,76 +350,76 @@
// should delete any additional instructions it consumes.
void TargetLowering::lower() {
assert(!Context.atEnd());
- Inst *Inst = Context.getCur();
- Inst->deleteIfDead();
- if (!Inst->isDeleted() && !llvm::isa<InstFakeDef>(Inst) &&
- !llvm::isa<InstFakeUse>(Inst)) {
+ Inst *Instr = Context.getCur();
+ Instr->deleteIfDead();
+ if (!Instr->isDeleted() && !llvm::isa<InstFakeDef>(Instr) &&
+ !llvm::isa<InstFakeUse>(Instr)) {
// Mark the current instruction as deleted before lowering, otherwise the
// Dest variable will likely get marked as non-SSA. See
// Variable::setDefinition(). However, just pass-through FakeDef and
// FakeUse instructions that might have been inserted prior to lowering.
- Inst->setDeleted();
- switch (Inst->getKind()) {
+ Instr->setDeleted();
+ switch (Instr->getKind()) {
case Inst::Alloca:
- lowerAlloca(llvm::cast<InstAlloca>(Inst));
+ lowerAlloca(llvm::cast<InstAlloca>(Instr));
break;
case Inst::Arithmetic:
- lowerArithmetic(llvm::cast<InstArithmetic>(Inst));
+ lowerArithmetic(llvm::cast<InstArithmetic>(Instr));
break;
case Inst::Assign:
- lowerAssign(llvm::cast<InstAssign>(Inst));
+ lowerAssign(llvm::cast<InstAssign>(Instr));
break;
case Inst::Br:
- lowerBr(llvm::cast<InstBr>(Inst));
+ lowerBr(llvm::cast<InstBr>(Instr));
break;
case Inst::Call:
- lowerCall(llvm::cast<InstCall>(Inst));
+ lowerCall(llvm::cast<InstCall>(Instr));
break;
case Inst::Cast:
- lowerCast(llvm::cast<InstCast>(Inst));
+ lowerCast(llvm::cast<InstCast>(Instr));
break;
case Inst::ExtractElement:
- lowerExtractElement(llvm::cast<InstExtractElement>(Inst));
+ lowerExtractElement(llvm::cast<InstExtractElement>(Instr));
break;
case Inst::Fcmp:
- lowerFcmp(llvm::cast<InstFcmp>(Inst));
+ lowerFcmp(llvm::cast<InstFcmp>(Instr));
break;
case Inst::Icmp:
- lowerIcmp(llvm::cast<InstIcmp>(Inst));
+ lowerIcmp(llvm::cast<InstIcmp>(Instr));
break;
case Inst::InsertElement:
- lowerInsertElement(llvm::cast<InstInsertElement>(Inst));
+ lowerInsertElement(llvm::cast<InstInsertElement>(Instr));
break;
case Inst::IntrinsicCall: {
- auto *Call = llvm::cast<InstIntrinsicCall>(Inst);
+ auto *Call = llvm::cast<InstIntrinsicCall>(Instr);
if (Call->getIntrinsicInfo().ReturnsTwice)
setCallsReturnsTwice(true);
lowerIntrinsicCall(Call);
break;
}
case Inst::Load:
- lowerLoad(llvm::cast<InstLoad>(Inst));
+ lowerLoad(llvm::cast<InstLoad>(Instr));
break;
case Inst::Phi:
- lowerPhi(llvm::cast<InstPhi>(Inst));
+ lowerPhi(llvm::cast<InstPhi>(Instr));
break;
case Inst::Ret:
- lowerRet(llvm::cast<InstRet>(Inst));
+ lowerRet(llvm::cast<InstRet>(Instr));
break;
case Inst::Select:
- lowerSelect(llvm::cast<InstSelect>(Inst));
+ lowerSelect(llvm::cast<InstSelect>(Instr));
break;
case Inst::Store:
- lowerStore(llvm::cast<InstStore>(Inst));
+ lowerStore(llvm::cast<InstStore>(Instr));
break;
case Inst::Switch:
- lowerSwitch(llvm::cast<InstSwitch>(Inst));
+ lowerSwitch(llvm::cast<InstSwitch>(Instr));
break;
case Inst::Unreachable:
- lowerUnreachable(llvm::cast<InstUnreachable>(Inst));
+ lowerUnreachable(llvm::cast<InstUnreachable>(Instr));
break;
default:
- lowerOther(Inst);
+ lowerOther(Instr);
break;
}
@@ -482,15 +482,16 @@
// Find (non-SSA) instructions where the Dest variable appears in some source
// operand, and set the IsDestRedefined flag to keep liveness analysis
// consistent.
- for (auto Inst = Context.getCur(), E = Context.getNext(); Inst != E; ++Inst) {
- if (Inst->isDeleted())
+ for (auto Instr = Context.getCur(), E = Context.getNext(); Instr != E;
+ ++Instr) {
+ if (Instr->isDeleted())
continue;
- Variable *Dest = Inst->getDest();
+ Variable *Dest = Instr->getDest();
if (Dest == nullptr)
continue;
- FOREACH_VAR_IN_INST(Var, *Inst) {
+ FOREACH_VAR_IN_INST(Var, *Instr) {
if (Var == Dest) {
- Inst->setDestRedefined();
+ Instr->setDestRedefined();
break;
}
}
@@ -537,12 +538,12 @@
const VariablesMetadata *VMetadata = Func->getVMetadata();
llvm::BitVector IsVarReferenced(Func->getNumVariables());
for (CfgNode *Node : Func->getNodes()) {
- for (Inst &Inst : Node->getInsts()) {
- if (Inst.isDeleted())
+ for (Inst &Instr : Node->getInsts()) {
+ if (Instr.isDeleted())
continue;
- if (const Variable *Var = Inst.getDest())
+ if (const Variable *Var = Instr.getDest())
IsVarReferenced[Var->getIndex()] = true;
- FOREACH_VAR_IN_INST(Var, Inst) {
+ FOREACH_VAR_IN_INST(Var, Instr) {
IsVarReferenced[Var->getIndex()] = true;
}
}
diff --git a/src/IceTargetLowering.h b/src/IceTargetLowering.h
index d406fb5..1a0f0b7 100644
--- a/src/IceTargetLowering.h
+++ b/src/IceTargetLowering.h
@@ -90,7 +90,7 @@
InstList::iterator getCur() const { return Cur; }
InstList::iterator getNext() const { return Next; }
InstList::iterator getEnd() const { return End; }
- void insert(Inst *Inst);
+ void insert(Inst *Instr);
template <typename Inst, typename... Args> Inst *insert(Args &&... A) {
auto *New = Inst::create(Node->getCfg(), std::forward<Args>(A)...);
insert(New);
@@ -365,24 +365,24 @@
size_t TypeToRegisterSetSize,
std::function<IceString(int32_t)> getRegName,
std::function<IceString(RegClass)> getRegClassName);
- virtual void lowerAlloca(const InstAlloca *Inst) = 0;
- virtual void lowerArithmetic(const InstArithmetic *Inst) = 0;
- virtual void lowerAssign(const InstAssign *Inst) = 0;
- virtual void lowerBr(const InstBr *Inst) = 0;
- virtual void lowerCall(const InstCall *Inst) = 0;
- virtual void lowerCast(const InstCast *Inst) = 0;
- virtual void lowerFcmp(const InstFcmp *Inst) = 0;
- virtual void lowerExtractElement(const InstExtractElement *Inst) = 0;
- virtual void lowerIcmp(const InstIcmp *Inst) = 0;
- virtual void lowerInsertElement(const InstInsertElement *Inst) = 0;
- virtual void lowerIntrinsicCall(const InstIntrinsicCall *Inst) = 0;
- virtual void lowerLoad(const InstLoad *Inst) = 0;
- virtual void lowerPhi(const InstPhi *Inst) = 0;
- virtual void lowerRet(const InstRet *Inst) = 0;
- virtual void lowerSelect(const InstSelect *Inst) = 0;
- virtual void lowerStore(const InstStore *Inst) = 0;
- virtual void lowerSwitch(const InstSwitch *Inst) = 0;
- virtual void lowerUnreachable(const InstUnreachable *Inst) = 0;
+ virtual void lowerAlloca(const InstAlloca *Instr) = 0;
+ virtual void lowerArithmetic(const InstArithmetic *Instr) = 0;
+ virtual void lowerAssign(const InstAssign *Instr) = 0;
+ virtual void lowerBr(const InstBr *Instr) = 0;
+ virtual void lowerCall(const InstCall *Instr) = 0;
+ virtual void lowerCast(const InstCast *Instr) = 0;
+ virtual void lowerFcmp(const InstFcmp *Instr) = 0;
+ virtual void lowerExtractElement(const InstExtractElement *Instr) = 0;
+ virtual void lowerIcmp(const InstIcmp *Instr) = 0;
+ virtual void lowerInsertElement(const InstInsertElement *Instr) = 0;
+ virtual void lowerIntrinsicCall(const InstIntrinsicCall *Instr) = 0;
+ virtual void lowerLoad(const InstLoad *Instr) = 0;
+ virtual void lowerPhi(const InstPhi *Instr) = 0;
+ virtual void lowerRet(const InstRet *Instr) = 0;
+ virtual void lowerSelect(const InstSelect *Instr) = 0;
+ virtual void lowerStore(const InstStore *Instr) = 0;
+ virtual void lowerSwitch(const InstSwitch *Instr) = 0;
+ virtual void lowerUnreachable(const InstUnreachable *Instr) = 0;
virtual void lowerOther(const Inst *Instr);
virtual void genTargetHelperCallFor(Inst *Instr) = 0;
diff --git a/src/IceTargetLoweringARM32.cpp b/src/IceTargetLoweringARM32.cpp
index 815c41f..0aea5ea 100644
--- a/src/IceTargetLoweringARM32.cpp
+++ b/src/IceTargetLoweringARM32.cpp
@@ -1924,7 +1924,7 @@
return Registers;
}
-void TargetARM32::lowerAlloca(const InstAlloca *Inst) {
+void TargetARM32::lowerAlloca(const InstAlloca *Instr) {
// Conservatively require the stack to be aligned. Some stack adjustment
// operations implemented below assume that the stack is aligned before the
// alloca. All the alloca code ensures that the stack alignment is preserved
@@ -1934,7 +1934,7 @@
// For default align=0, set it to the real value 1, to avoid any
// bit-manipulation problems below.
- const uint32_t AlignmentParam = std::max(1u, Inst->getAlignInBytes());
+ const uint32_t AlignmentParam = std::max(1u, Instr->getAlignInBytes());
// LLVM enforces power of 2 alignment.
assert(llvm::isPowerOf2_32(AlignmentParam));
@@ -1944,7 +1944,7 @@
std::max(AlignmentParam, ARM32_STACK_ALIGNMENT_BYTES);
const bool OverAligned = Alignment > ARM32_STACK_ALIGNMENT_BYTES;
const bool OptM1 = Ctx->getFlags().getOptLevel() == Opt_m1;
- const bool AllocaWithKnownOffset = Inst->getKnownFrameOffset();
+ const bool AllocaWithKnownOffset = Instr->getKnownFrameOffset();
const bool UseFramePointer =
hasFramePointer() || OverAligned || !AllocaWithKnownOffset || OptM1;
@@ -1956,8 +1956,8 @@
Sandboxer(this).align_sp(Alignment);
}
- Variable *Dest = Inst->getDest();
- Operand *TotalSize = Inst->getSizeInBytes();
+ Variable *Dest = Instr->getDest();
+ Operand *TotalSize = Instr->getSizeInBytes();
if (const auto *ConstantTotalSize =
llvm::dyn_cast<ConstantInteger32>(TotalSize)) {
@@ -2062,19 +2062,19 @@
}
TargetARM32::SafeBoolChain
-TargetARM32::lowerInt1Arithmetic(const InstArithmetic *Inst) {
- Variable *Dest = Inst->getDest();
+TargetARM32::lowerInt1Arithmetic(const InstArithmetic *Instr) {
+ Variable *Dest = Instr->getDest();
assert(Dest->getType() == IceType_i1);
- // So folding didn't work for Inst. Not a problem: We just need to
+ // So folding didn't work for Instr. Not a problem: We just need to
// materialize the Sources, and perform the operation. We create regular
// Variables (and not infinite-weight ones) because this call might recurse a
// lot, and we might end up with tons of infinite weight temporaries.
- assert(Inst->getSrcSize() == 2);
+ assert(Instr->getSrcSize() == 2);
Variable *Src0 = Func->makeVariable(IceType_i1);
- SafeBoolChain Src0Safe = lowerInt1(Src0, Inst->getSrc(0));
+ SafeBoolChain Src0Safe = lowerInt1(Src0, Instr->getSrc(0));
- Operand *Src1 = Inst->getSrc(1);
+ Operand *Src1 = Instr->getSrc(1);
SafeBoolChain Src1Safe = SBC_Yes;
if (!llvm::isa<Constant>(Src1)) {
@@ -2086,7 +2086,7 @@
Variable *T = makeReg(IceType_i1);
Src0 = legalizeToReg(Src0);
Operand *Src1RF = legalize(Src1, Legal_Reg | Legal_Flex);
- switch (Inst->getOp()) {
+ switch (Instr->getOp()) {
default:
// If this Unreachable is ever executed, add the offending operation to
// the list of valid consumers.
@@ -3175,15 +3175,15 @@
}
}
-void TargetARM32::lowerAssign(const InstAssign *Inst) {
- Variable *Dest = Inst->getDest();
+void TargetARM32::lowerAssign(const InstAssign *Instr) {
+ Variable *Dest = Instr->getDest();
if (Dest->isRematerializable()) {
Context.insert<InstFakeDef>(Dest);
return;
}
- Operand *Src0 = Inst->getSrc(0);
+ Operand *Src0 = Instr->getSrc(0);
assert(Dest->getType() == Src0->getType());
if (Dest->getType() == IceType_i64) {
Src0 = legalizeUndef(Src0);
@@ -3544,17 +3544,17 @@
}
} // end of anonymous namespace
-void TargetARM32::lowerCast(const InstCast *Inst) {
- InstCast::OpKind CastKind = Inst->getCastKind();
- Variable *Dest = Inst->getDest();
- Operand *Src0 = legalizeUndef(Inst->getSrc(0));
+void TargetARM32::lowerCast(const InstCast *Instr) {
+ InstCast::OpKind CastKind = Instr->getCastKind();
+ Variable *Dest = Instr->getDest();
+ Operand *Src0 = legalizeUndef(Instr->getSrc(0));
switch (CastKind) {
default:
Func->setError("Cast type not supported");
return;
case InstCast::Sext: {
if (isVectorType(Dest->getType())) {
- UnimplementedLoweringError(this, Inst);
+ UnimplementedLoweringError(this, Instr);
} else if (Dest->getType() == IceType_i64) {
// t1=sxtb src; t2= mov t1 asr #31; dst.lo=t1; dst.hi=t2
Constant *ShiftAmt = Ctx->getConstantInt32(31);
@@ -3599,7 +3599,7 @@
}
case InstCast::Zext: {
if (isVectorType(Dest->getType())) {
- UnimplementedLoweringError(this, Inst);
+ UnimplementedLoweringError(this, Instr);
} else if (Dest->getType() == IceType_i64) {
// t1=uxtb src; dst.lo=t1; dst.hi=0
Operand *_0 =
@@ -3652,7 +3652,7 @@
}
case InstCast::Trunc: {
if (isVectorType(Dest->getType())) {
- UnimplementedLoweringError(this, Inst);
+ UnimplementedLoweringError(this, Instr);
} else {
if (Src0->getType() == IceType_i64)
Src0 = loOperand(Src0);
@@ -3672,7 +3672,7 @@
// fpext: dest.f64 = fptrunc src0.fp32
const bool IsTrunc = CastKind == InstCast::Fptrunc;
if (isVectorType(Dest->getType())) {
- UnimplementedLoweringError(this, Inst);
+ UnimplementedLoweringError(this, Instr);
break;
}
assert(Dest->getType() == (IsTrunc ? IceType_f32 : IceType_f64));
@@ -3686,7 +3686,7 @@
case InstCast::Fptosi:
case InstCast::Fptoui: {
if (isVectorType(Dest->getType())) {
- UnimplementedLoweringError(this, Inst);
+ UnimplementedLoweringError(this, Instr);
break;
}
@@ -3722,7 +3722,7 @@
case InstCast::Sitofp:
case InstCast::Uitofp: {
if (isVectorType(Dest->getType())) {
- UnimplementedLoweringError(this, Inst);
+ UnimplementedLoweringError(this, Instr);
break;
}
const bool SourceIsSigned = CastKind == InstCast::Sitofp;
@@ -3759,7 +3759,7 @@
break;
}
case InstCast::Bitcast: {
- Operand *Src0 = Inst->getSrc(0);
+ Operand *Src0 = Instr->getSrc(0);
if (Dest->getType() == Src0->getType()) {
auto *Assign = InstAssign::create(Func, Dest, Src0);
lowerAssign(Assign);
@@ -3771,13 +3771,13 @@
case IceType_void:
llvm::report_fatal_error("Unexpected bitcast.");
case IceType_i1:
- UnimplementedLoweringError(this, Inst);
+ UnimplementedLoweringError(this, Instr);
break;
case IceType_i8:
- UnimplementedLoweringError(this, Inst);
+ UnimplementedLoweringError(this, Instr);
break;
case IceType_i16:
- UnimplementedLoweringError(this, Inst);
+ UnimplementedLoweringError(this, Instr);
break;
case IceType_i32:
case IceType_f32: {
@@ -3824,7 +3824,7 @@
case IceType_v16i8:
case IceType_v4f32:
case IceType_v4i32: {
- UnimplementedLoweringError(this, Inst);
+ UnimplementedLoweringError(this, Instr);
break;
}
}
@@ -3833,8 +3833,8 @@
}
}
-void TargetARM32::lowerExtractElement(const InstExtractElement *Inst) {
- UnimplementedLoweringError(this, Inst);
+void TargetARM32::lowerExtractElement(const InstExtractElement *Instr) {
+ UnimplementedLoweringError(this, Instr);
}
namespace {
@@ -4155,14 +4155,14 @@
return CondWhenTrue(getIcmp32Mapping(Condition));
}
-TargetARM32::CondWhenTrue TargetARM32::lowerIcmpCond(const InstIcmp *Inst) {
- assert(Inst->getSrc(0)->getType() != IceType_i1);
- assert(Inst->getSrc(1)->getType() != IceType_i1);
+TargetARM32::CondWhenTrue TargetARM32::lowerIcmpCond(const InstIcmp *Instr) {
+ assert(Instr->getSrc(0)->getType() != IceType_i1);
+ assert(Instr->getSrc(1)->getType() != IceType_i1);
- Operand *Src0 = legalizeUndef(Inst->getSrc(0));
- Operand *Src1 = legalizeUndef(Inst->getSrc(1));
+ Operand *Src0 = legalizeUndef(Instr->getSrc(0));
+ Operand *Src1 = legalizeUndef(Instr->getSrc(1));
- const InstIcmp::ICond Condition = Inst->getCondition();
+ const InstIcmp::ICond Condition = Instr->getCondition();
// a=icmp cond b, c ==>
// GCC does:
// <u/s>xtb tb, b
@@ -4205,11 +4205,11 @@
}
}
-void TargetARM32::lowerIcmp(const InstIcmp *Inst) {
- Variable *Dest = Inst->getDest();
+void TargetARM32::lowerIcmp(const InstIcmp *Instr) {
+ Variable *Dest = Instr->getDest();
if (isVectorType(Dest->getType())) {
- UnimplementedLoweringError(this, Inst);
+ UnimplementedLoweringError(this, Instr);
return;
}
@@ -4219,7 +4219,7 @@
Variable *T = makeReg(IceType_i1);
_mov(T, _0);
- CondWhenTrue Cond = lowerIcmpCond(Inst);
+ CondWhenTrue Cond = lowerIcmpCond(Instr);
_mov_redefined(T, _1, Cond.WhenTrue0);
_mov(Dest, T);
@@ -4228,8 +4228,8 @@
return;
}
-void TargetARM32::lowerInsertElement(const InstInsertElement *Inst) {
- UnimplementedLoweringError(this, Inst);
+void TargetARM32::lowerInsertElement(const InstInsertElement *Instr) {
+ UnimplementedLoweringError(this, Instr);
}
namespace {
@@ -4938,8 +4938,8 @@
return Optimized;
}
-bool isAddOrSub(const Inst *Inst, InstArithmetic::OpKind *Kind) {
- if (const auto *Arith = llvm::dyn_cast<InstArithmetic>(Inst)) {
+bool isAddOrSub(const Inst *Instr, InstArithmetic::OpKind *Kind) {
+ if (const auto *Arith = llvm::dyn_cast<InstArithmetic>(Instr)) {
switch (Arith->getOp()) {
default:
return false;
@@ -5316,14 +5316,14 @@
}
}
-void TargetARM32::lowerPhi(const InstPhi * /*Inst*/) {
+void TargetARM32::lowerPhi(const InstPhi * /*Instr*/) {
Func->setError("Phi found in regular instruction list");
}
-void TargetARM32::lowerRet(const InstRet *Inst) {
+void TargetARM32::lowerRet(const InstRet *Instr) {
Variable *Reg = nullptr;
- if (Inst->hasRetValue()) {
- Operand *Src0 = Inst->getRetValue();
+ if (Instr->hasRetValue()) {
+ Operand *Src0 = Instr->getRetValue();
Type Ty = Src0->getType();
if (Ty == IceType_i64) {
Src0 = legalizeUndef(Src0);
@@ -5360,24 +5360,24 @@
Context.insert<InstFakeUse>(SP);
}
-void TargetARM32::lowerSelect(const InstSelect *Inst) {
- Variable *Dest = Inst->getDest();
+void TargetARM32::lowerSelect(const InstSelect *Instr) {
+ Variable *Dest = Instr->getDest();
Type DestTy = Dest->getType();
- Operand *SrcT = Inst->getTrueOperand();
- Operand *SrcF = Inst->getFalseOperand();
- Operand *Condition = Inst->getCondition();
+ Operand *SrcT = Instr->getTrueOperand();
+ Operand *SrcF = Instr->getFalseOperand();
+ Operand *Condition = Instr->getCondition();
if (isVectorType(DestTy)) {
- UnimplementedLoweringError(this, Inst);
+ UnimplementedLoweringError(this, Instr);
return;
}
lowerInt1ForSelect(Dest, Condition, legalizeUndef(SrcT), legalizeUndef(SrcF));
}
-void TargetARM32::lowerStore(const InstStore *Inst) {
- Operand *Value = Inst->getData();
- Operand *Addr = Inst->getAddr();
+void TargetARM32::lowerStore(const InstStore *Instr) {
+ Operand *Value = Instr->getData();
+ Operand *Addr = Instr->getAddr();
OperandARM32Mem *NewAddr = formMemoryOperand(Addr, Value->getType());
Type Ty = NewAddr->getType();
@@ -5405,25 +5405,25 @@
}
}
-void TargetARM32::lowerSwitch(const InstSwitch *Inst) {
+void TargetARM32::lowerSwitch(const InstSwitch *Instr) {
// This implements the most naive possible lowering.
// cmp a,val[0]; jeq label[0]; cmp a,val[1]; jeq label[1]; ... jmp default
- Operand *Src0 = Inst->getComparison();
- SizeT NumCases = Inst->getNumCases();
+ Operand *Src0 = Instr->getComparison();
+ SizeT NumCases = Instr->getNumCases();
if (Src0->getType() == IceType_i64) {
Src0 = legalizeUndef(Src0);
Variable *Src0Lo = legalizeToReg(loOperand(Src0));
Variable *Src0Hi = legalizeToReg(hiOperand(Src0));
for (SizeT I = 0; I < NumCases; ++I) {
- Operand *ValueLo = Ctx->getConstantInt32(Inst->getValue(I));
- Operand *ValueHi = Ctx->getConstantInt32(Inst->getValue(I) >> 32);
+ Operand *ValueLo = Ctx->getConstantInt32(Instr->getValue(I));
+ Operand *ValueHi = Ctx->getConstantInt32(Instr->getValue(I) >> 32);
ValueLo = legalize(ValueLo, Legal_Reg | Legal_Flex);
ValueHi = legalize(ValueHi, Legal_Reg | Legal_Flex);
_cmp(Src0Lo, ValueLo);
_cmp(Src0Hi, ValueHi, CondARM32::EQ);
- _br(Inst->getLabel(I), CondARM32::EQ);
+ _br(Instr->getLabel(I), CondARM32::EQ);
}
- _br(Inst->getLabelDefault());
+ _br(Instr->getLabelDefault());
return;
}
@@ -5441,15 +5441,15 @@
}
for (SizeT I = 0; I < NumCases; ++I) {
- Operand *Value = Ctx->getConstantInt32(Inst->getValue(I) << ShiftAmt);
+ Operand *Value = Ctx->getConstantInt32(Instr->getValue(I) << ShiftAmt);
Value = legalize(Value, Legal_Reg | Legal_Flex);
_cmp(Src0Var, Value);
- _br(Inst->getLabel(I), CondARM32::EQ);
+ _br(Instr->getLabel(I), CondARM32::EQ);
}
- _br(Inst->getLabelDefault());
+ _br(Instr->getLabelDefault());
}
-void TargetARM32::lowerUnreachable(const InstUnreachable * /*Inst*/) {
+void TargetARM32::lowerUnreachable(const InstUnreachable * /*Instr*/) {
_trap();
}
diff --git a/src/IceTargetLoweringARM32.h b/src/IceTargetLoweringARM32.h
index af55141..c5654be 100644
--- a/src/IceTargetLoweringARM32.h
+++ b/src/IceTargetLoweringARM32.h
@@ -188,16 +188,16 @@
SBC_Yes,
};
- void lowerAlloca(const InstAlloca *Inst) override;
- SafeBoolChain lowerInt1Arithmetic(const InstArithmetic *Inst);
+ void lowerAlloca(const InstAlloca *Instr) override;
+ SafeBoolChain lowerInt1Arithmetic(const InstArithmetic *Instr);
void lowerInt64Arithmetic(InstArithmetic::OpKind Op, Variable *Dest,
Operand *Src0, Operand *Src1);
- void lowerArithmetic(const InstArithmetic *Inst) override;
- 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 lowerArithmetic(const InstArithmetic *Instr) 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;
/// CondWhenTrue is a helper type returned by every method in the lowering
/// that emits code to set the condition codes.
@@ -240,15 +240,15 @@
void lowerIcmp(const InstIcmp *Instr) override;
void lowerAtomicRMW(Variable *Dest, uint32_t Operation, Operand *Ptr,
Operand *Val);
- 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 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 genTargetHelperCallFor(Inst *Instr) override;
@@ -1086,9 +1086,9 @@
void postambleCtpop64(const InstCall *Instr);
void preambleDivRem(const InstCall *Instr);
- std::unordered_map<Operand *, void (TargetARM32::*)(const InstCall *Inst)>
+ std::unordered_map<Operand *, void (TargetARM32::*)(const InstCall *Instr)>
ARM32HelpersPreamble;
- std::unordered_map<Operand *, void (TargetARM32::*)(const InstCall *Inst)>
+ std::unordered_map<Operand *, void (TargetARM32::*)(const InstCall *Instr)>
ARM32HelpersPostamble;
class ComputationTracker {
diff --git a/src/IceTargetLoweringX86Base.h b/src/IceTargetLoweringX86Base.h
index 90db8c0..bda5077 100644
--- a/src/IceTargetLoweringX86Base.h
+++ b/src/IceTargetLoweringX86Base.h
@@ -241,26 +241,26 @@
dispatchToConcrete(&Traits::ConcreteTarget::initSandbox);
}
- void lowerAlloca(const InstAlloca *Inst) override;
+ void lowerAlloca(const InstAlloca *Instr) override;
void lowerArguments() override;
- void lowerArithmetic(const InstArithmetic *Inst) override;
- 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 lowerArithmetic(const InstArithmetic *Instr) 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 *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 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 lowerOther(const Inst *Instr) override;
void lowerRMW(const InstX86FakeRMW *RMW);
void prelowerPhis() override;
@@ -1053,7 +1053,7 @@
/// Emit the code for instructions with a vector type.
void lowerIcmpVector(const InstIcmp *Icmp);
void lowerFcmpVector(const InstFcmp *Icmp);
- void lowerSelectVector(const InstSelect *Inst);
+ void lowerSelectVector(const InstSelect *Instr);
/// Helpers for select lowering.
void lowerSelectMove(Variable *Dest, BrCond Cond, Operand *SrcT,
diff --git a/src/IceTargetLoweringX86BaseImpl.h b/src/IceTargetLoweringX86BaseImpl.h
index 88c0fa9..984c66d 100644
--- a/src/IceTargetLoweringX86BaseImpl.h
+++ b/src/IceTargetLoweringX86BaseImpl.h
@@ -1379,7 +1379,7 @@
}
template <typename TraitsType>
-void TargetX86Base<TraitsType>::lowerAlloca(const InstAlloca *Inst) {
+void TargetX86Base<TraitsType>::lowerAlloca(const InstAlloca *Instr) {
// Conservatively require the stack to be aligned. Some stack adjustment
// operations implemented below assume that the stack is aligned before the
// alloca. All the alloca code ensures that the stack alignment is preserved
@@ -1389,7 +1389,7 @@
// For default align=0, set it to the real value 1, to avoid any
// bit-manipulation problems below.
- const uint32_t AlignmentParam = std::max(1u, Inst->getAlignInBytes());
+ const uint32_t AlignmentParam = std::max(1u, Instr->getAlignInBytes());
// LLVM enforces power of 2 alignment.
assert(llvm::isPowerOf2_32(AlignmentParam));
@@ -1399,7 +1399,7 @@
std::max(AlignmentParam, Traits::X86_STACK_ALIGNMENT_BYTES);
const bool OverAligned = Alignment > Traits::X86_STACK_ALIGNMENT_BYTES;
const bool OptM1 = Ctx->getFlags().getOptLevel() == Opt_m1;
- const bool AllocaWithKnownOffset = Inst->getKnownFrameOffset();
+ const bool AllocaWithKnownOffset = Instr->getKnownFrameOffset();
const bool UseFramePointer =
hasFramePointer() || OverAligned || !AllocaWithKnownOffset || OptM1;
@@ -1411,8 +1411,8 @@
_and(esp, Ctx->getConstantInt32(-Alignment));
}
- Variable *Dest = Inst->getDest();
- Operand *TotalSize = legalize(Inst->getSizeInBytes());
+ Variable *Dest = Instr->getDest();
+ Operand *TotalSize = legalize(Instr->getSizeInBytes());
if (const auto *ConstantTotalSize =
llvm::dyn_cast<ConstantInteger32>(TotalSize)) {
@@ -1832,16 +1832,16 @@
}
template <typename TraitsType>
-void TargetX86Base<TraitsType>::lowerArithmetic(const InstArithmetic *Inst) {
- Variable *Dest = Inst->getDest();
+void TargetX86Base<TraitsType>::lowerArithmetic(const InstArithmetic *Instr) {
+ Variable *Dest = Instr->getDest();
if (Dest->isRematerializable()) {
Context.insert<InstFakeDef>(Dest);
return;
}
Type Ty = Dest->getType();
- Operand *Src0 = legalize(Inst->getSrc(0));
- Operand *Src1 = legalize(Inst->getSrc(1));
- if (Inst->isCommutative()) {
+ Operand *Src0 = legalize(Instr->getSrc(0));
+ Operand *Src1 = legalize(Instr->getSrc(1));
+ if (Instr->isCommutative()) {
uint32_t SwapCount = 0;
if (!llvm::isa<Variable>(Src0) && llvm::isa<Variable>(Src1)) {
std::swap(Src0, Src1);
@@ -1853,7 +1853,7 @@
}
// Improve two-address code patterns by avoiding a copy to the dest
// register when one of the source operands ends its lifetime here.
- if (!Inst->isLastUse(Src0) && Inst->isLastUse(Src1)) {
+ if (!Instr->isLastUse(Src0) && Instr->isLastUse(Src1)) {
std::swap(Src0, Src1);
++SwapCount;
}
@@ -1867,7 +1867,7 @@
// instructions will fail liveness analysis under -Om1 setting. And,
// actually these arguments do not need to be processed with loOperand()
// and hiOperand() to be used.
- switch (Inst->getOp()) {
+ switch (Instr->getOp()) {
case InstArithmetic::Udiv:
case InstArithmetic::Sdiv:
case InstArithmetic::Urem:
@@ -1885,7 +1885,7 @@
Operand *Src1Lo = loOperand(Src1);
Operand *Src1Hi = hiOperand(Src1);
Variable *T_Lo = nullptr, *T_Hi = nullptr;
- switch (Inst->getOp()) {
+ switch (Instr->getOp()) {
case InstArithmetic::_num:
llvm_unreachable("Unknown arithmetic operator");
break;
@@ -1962,7 +1962,7 @@
case InstArithmetic::Shl:
case InstArithmetic::Lshr:
case InstArithmetic::Ashr:
- lowerShift64(Inst->getOp(), Src0Lo, Src0Hi, Src1Lo, DestLo, DestHi);
+ lowerShift64(Instr->getOp(), Src0Lo, Src0Hi, Src1Lo, DestLo, DestHi);
break;
case InstArithmetic::Fadd:
case InstArithmetic::Fsub:
@@ -1986,7 +1986,7 @@
// https://code.google.com/p/nativeclient/issues/detail?id=3899
if (llvm::isa<X86OperandMem>(Src1))
Src1 = legalizeToReg(Src1);
- switch (Inst->getOp()) {
+ switch (Instr->getOp()) {
case InstArithmetic::_num:
llvm_unreachable("Unknown arithmetic operator");
break;
@@ -2114,7 +2114,7 @@
}
Variable *T_edx = nullptr;
Variable *T = nullptr;
- switch (Inst->getOp()) {
+ switch (Instr->getOp()) {
case InstArithmetic::_num:
llvm_unreachable("Unknown arithmetic operator");
break;
@@ -2404,13 +2404,13 @@
}
template <typename TraitsType>
-void TargetX86Base<TraitsType>::lowerAssign(const InstAssign *Inst) {
- Variable *Dest = Inst->getDest();
+void TargetX86Base<TraitsType>::lowerAssign(const InstAssign *Instr) {
+ Variable *Dest = Instr->getDest();
if (Dest->isRematerializable()) {
Context.insert<InstFakeDef>(Dest);
return;
}
- Operand *Src = Inst->getSrc(0);
+ Operand *Src = Instr->getSrc(0);
assert(Dest->getType() == Src->getType());
lowerMove(Dest, Src, false);
}
@@ -2648,10 +2648,10 @@
}
template <typename TraitsType>
-void TargetX86Base<TraitsType>::lowerCast(const InstCast *Inst) {
+void TargetX86Base<TraitsType>::lowerCast(const InstCast *Instr) {
// a = cast(b) ==> t=cast(b); a=t; (link t->b, link a->t, no overlap)
- InstCast::OpKind CastKind = Inst->getCastKind();
- Variable *Dest = Inst->getDest();
+ InstCast::OpKind CastKind = Instr->getCastKind();
+ Variable *Dest = Instr->getDest();
Type DestTy = Dest->getType();
switch (CastKind) {
default:
@@ -2664,7 +2664,7 @@
// consider computing the strength-reduced result at translation time, but
// we're unlikely to see something like that in the bitcode that the
// optimizer wouldn't have already taken care of.
- Operand *Src0RM = legalize(Inst->getSrc(0), Legal_Reg | Legal_Mem);
+ Operand *Src0RM = legalize(Instr->getSrc(0), Legal_Reg | Legal_Mem);
if (isVectorType(DestTy)) {
if (DestTy == IceType_v16i8) {
// onemask = materialize(1,1,...); dst = (src & onemask) > 0
@@ -2736,7 +2736,7 @@
break;
}
case InstCast::Zext: {
- Operand *Src0RM = legalize(Inst->getSrc(0), Legal_Reg | Legal_Mem);
+ Operand *Src0RM = legalize(Instr->getSrc(0), Legal_Reg | Legal_Mem);
if (isVectorType(DestTy)) {
// onemask = materialize(1,1,...); dest = onemask & src
Variable *OneMask = makeVectorOfOnes(DestTy);
@@ -2783,7 +2783,7 @@
case InstCast::Trunc: {
if (isVectorType(DestTy)) {
// onemask = materialize(1,1,...); dst = src & onemask
- Operand *Src0RM = legalize(Inst->getSrc(0), Legal_Reg | Legal_Mem);
+ Operand *Src0RM = legalize(Instr->getSrc(0), Legal_Reg | Legal_Mem);
Type Src0Ty = Src0RM->getType();
Variable *OneMask = makeVectorOfOnes(Src0Ty);
Variable *T = makeReg(DestTy);
@@ -2792,7 +2792,7 @@
_movp(Dest, T);
} else if (DestTy == IceType_i1 || DestTy == IceType_i8) {
// Make sure we truncate from and into valid registers.
- Operand *Src0 = legalizeUndef(Inst->getSrc(0));
+ Operand *Src0 = legalizeUndef(Instr->getSrc(0));
if (!Traits::Is64Bit && Src0->getType() == IceType_i64)
Src0 = loOperand(Src0);
Operand *Src0RM = legalize(Src0, Legal_Reg | Legal_Mem);
@@ -2801,7 +2801,7 @@
_and(T, Ctx->getConstantInt1(1));
_mov(Dest, T);
} else {
- Operand *Src0 = legalizeUndef(Inst->getSrc(0));
+ Operand *Src0 = legalizeUndef(Instr->getSrc(0));
if (!Traits::Is64Bit && Src0->getType() == IceType_i64)
Src0 = loOperand(Src0);
Operand *Src0RM = legalize(Src0, Legal_Reg | Legal_Mem);
@@ -2814,7 +2814,7 @@
}
case InstCast::Fptrunc:
case InstCast::Fpext: {
- Operand *Src0RM = legalize(Inst->getSrc(0), Legal_Reg | Legal_Mem);
+ Operand *Src0RM = legalize(Instr->getSrc(0), Legal_Reg | Legal_Mem);
// t1 = cvt Src0RM; Dest = t1
Variable *T = makeReg(DestTy);
_cvt(T, Src0RM, Traits::Insts::Cvt::Float2float);
@@ -2824,8 +2824,8 @@
case InstCast::Fptosi:
if (isVectorType(DestTy)) {
assert(DestTy == IceType_v4i32 &&
- Inst->getSrc(0)->getType() == IceType_v4f32);
- Operand *Src0RM = legalize(Inst->getSrc(0), Legal_Reg | Legal_Mem);
+ Instr->getSrc(0)->getType() == IceType_v4f32);
+ Operand *Src0RM = legalize(Instr->getSrc(0), Legal_Reg | Legal_Mem);
if (llvm::isa<X86OperandMem>(Src0RM))
Src0RM = legalizeToReg(Src0RM);
Variable *T = makeReg(DestTy);
@@ -2834,7 +2834,7 @@
} else if (!Traits::Is64Bit && DestTy == IceType_i64) {
llvm::report_fatal_error("Helper call was expected");
} else {
- Operand *Src0RM = legalize(Inst->getSrc(0), Legal_Reg | Legal_Mem);
+ Operand *Src0RM = legalize(Instr->getSrc(0), Legal_Reg | Legal_Mem);
// t1.i32 = cvt Src0RM; t2.dest_type = t1; Dest = t2.dest_type
Variable *T_1 = nullptr;
if (Traits::Is64Bit && DestTy == IceType_i64) {
@@ -2864,7 +2864,7 @@
(!Traits::Is64Bit && DestTy == IceType_i32)) {
llvm::report_fatal_error("Helper call was expected");
} else {
- Operand *Src0RM = legalize(Inst->getSrc(0), Legal_Reg | Legal_Mem);
+ Operand *Src0RM = legalize(Instr->getSrc(0), Legal_Reg | Legal_Mem);
// t1.i32 = cvt Src0RM; t2.dest_type = t1; Dest = t2.dest_type
assert(DestTy != IceType_i64);
Variable *T_1 = nullptr;
@@ -2890,17 +2890,17 @@
case InstCast::Sitofp:
if (isVectorType(DestTy)) {
assert(DestTy == IceType_v4f32 &&
- Inst->getSrc(0)->getType() == IceType_v4i32);
- Operand *Src0RM = legalize(Inst->getSrc(0), Legal_Reg | Legal_Mem);
+ Instr->getSrc(0)->getType() == IceType_v4i32);
+ Operand *Src0RM = legalize(Instr->getSrc(0), Legal_Reg | Legal_Mem);
if (llvm::isa<X86OperandMem>(Src0RM))
Src0RM = legalizeToReg(Src0RM);
Variable *T = makeReg(DestTy);
_cvt(T, Src0RM, Traits::Insts::Cvt::Dq2ps);
_movp(Dest, T);
- } else if (!Traits::Is64Bit && Inst->getSrc(0)->getType() == IceType_i64) {
+ } else if (!Traits::Is64Bit && Instr->getSrc(0)->getType() == IceType_i64) {
llvm::report_fatal_error("Helper call was expected");
} else {
- Operand *Src0RM = legalize(Inst->getSrc(0), Legal_Reg | Legal_Mem);
+ Operand *Src0RM = legalize(Instr->getSrc(0), Legal_Reg | Legal_Mem);
// Sign-extend the operand.
// t1.i32 = movsx Src0RM; t2 = Cvt t1.i32; Dest = t2
Variable *T_1 = nullptr;
@@ -2920,7 +2920,7 @@
}
break;
case InstCast::Uitofp: {
- Operand *Src0 = Inst->getSrc(0);
+ Operand *Src0 = Instr->getSrc(0);
if (isVectorType(Src0->getType())) {
llvm::report_fatal_error("Helper call was expected");
} else if (Src0->getType() == IceType_i64 ||
@@ -2949,7 +2949,7 @@
break;
}
case InstCast::Bitcast: {
- Operand *Src0 = Inst->getSrc(0);
+ Operand *Src0 = Instr->getSrc(0);
if (DestTy == Src0->getType()) {
auto *Assign = InstAssign::create(Func, Dest, Src0);
lowerAssign(Assign);
@@ -3092,10 +3092,10 @@
template <typename TraitsType>
void TargetX86Base<TraitsType>::lowerExtractElement(
- const InstExtractElement *Inst) {
- Operand *SourceVectNotLegalized = Inst->getSrc(0);
+ const InstExtractElement *Instr) {
+ Operand *SourceVectNotLegalized = Instr->getSrc(0);
ConstantInteger32 *ElementIndex =
- llvm::dyn_cast<ConstantInteger32>(Inst->getSrc(1));
+ llvm::dyn_cast<ConstantInteger32>(Instr->getSrc(1));
// Only constant indices are allowed in PNaCl IR.
assert(ElementIndex);
@@ -3168,7 +3168,7 @@
}
// Copy the element to the destination.
- Variable *Dest = Inst->getDest();
+ Variable *Dest = Instr->getDest();
_mov(Dest, ExtractedElementR);
}
@@ -3751,11 +3751,11 @@
template <typename TraitsType>
void TargetX86Base<TraitsType>::lowerInsertElement(
- const InstInsertElement *Inst) {
- Operand *SourceVectNotLegalized = Inst->getSrc(0);
- Operand *ElementToInsertNotLegalized = Inst->getSrc(1);
+ const InstInsertElement *Instr) {
+ Operand *SourceVectNotLegalized = Instr->getSrc(0);
+ Operand *ElementToInsertNotLegalized = Instr->getSrc(1);
ConstantInteger32 *ElementIndex =
- llvm::dyn_cast<ConstantInteger32>(Inst->getSrc(2));
+ llvm::dyn_cast<ConstantInteger32>(Instr->getSrc(2));
// Only constant indices are allowed in PNaCl IR.
assert(ElementIndex);
unsigned Index = ElementIndex->getValue();
@@ -3800,7 +3800,7 @@
}
_pinsr(T, ElementRM, Ctx->getConstantInt32(Index));
}
- _movp(Inst->getDest(), T);
+ _movp(Instr->getDest(), T);
} else if (Ty == IceType_v4i32 || Ty == IceType_v4f32 || Ty == IceType_v4i1) {
// Use shufps or movss.
Variable *ElementR = nullptr;
@@ -3821,7 +3821,7 @@
Variable *T = makeReg(Ty);
_movp(T, SourceVectRM);
_movss(T, ElementR);
- _movp(Inst->getDest(), T);
+ _movp(Instr->getDest(), T);
return;
}
@@ -3855,13 +3855,13 @@
if (Index == 1) {
_shufps(ElementR, SourceVectRM, Mask1Constant);
_shufps(ElementR, SourceVectRM, Mask2Constant);
- _movp(Inst->getDest(), ElementR);
+ _movp(Instr->getDest(), ElementR);
} else {
Variable *T = makeReg(Ty);
_movp(T, SourceVectRM);
_shufps(ElementR, T, Mask1Constant);
_shufps(T, ElementR, Mask2Constant);
- _movp(Inst->getDest(), T);
+ _movp(Instr->getDest(), T);
}
} else {
assert(Ty == IceType_v16i8 || Ty == IceType_v16i1);
@@ -3881,7 +3881,7 @@
Variable *T = makeReg(Ty);
_movp(T, Slot);
- _movp(Inst->getDest(), T);
+ _movp(Instr->getDest(), T);
}
}
@@ -4999,8 +4999,8 @@
const Cfg *const Func;
const VariablesMetadata *const VMetadata;
- static bool isAdd(const Inst *Inst) {
- if (auto *Arith = llvm::dyn_cast_or_null<const InstArithmetic>(Inst)) {
+ static bool isAdd(const Inst *Instr) {
+ if (auto *Arith = llvm::dyn_cast_or_null<const InstArithmetic>(Instr)) {
return (Arith->getOp() == InstArithmetic::Add);
}
return false;
@@ -5513,11 +5513,11 @@
template <typename TraitsType>
void TargetX86Base<TraitsType>::doAddressOptLoad() {
- Inst *Inst = Context.getCur();
- Operand *Addr = Inst->getSrc(0);
- Variable *Dest = Inst->getDest();
- if (auto *OptAddr = computeAddressOpt(Inst, Dest->getType(), Addr)) {
- Inst->setDeleted();
+ Inst *Instr = Context.getCur();
+ Operand *Addr = Instr->getSrc(0);
+ Variable *Dest = Instr->getDest();
+ if (auto *OptAddr = computeAddressOpt(Instr, Dest->getType(), Addr)) {
+ Instr->setDeleted();
Context.insert<InstLoad>(Dest, OptAddr);
}
}
@@ -5532,15 +5532,15 @@
}
template <typename TraitsType>
-void TargetX86Base<TraitsType>::lowerPhi(const InstPhi * /*Inst*/) {
+void TargetX86Base<TraitsType>::lowerPhi(const InstPhi * /*Instr*/) {
Func->setError("Phi found in regular instruction list");
}
template <typename TraitsType>
-void TargetX86Base<TraitsType>::lowerRet(const InstRet *Inst) {
+void TargetX86Base<TraitsType>::lowerRet(const InstRet *Instr) {
Variable *Reg = nullptr;
- if (Inst->hasRetValue()) {
- Operand *RetValue = legalize(Inst->getRetValue());
+ if (Instr->hasRetValue()) {
+ Operand *RetValue = legalize(Instr->getRetValue());
const Type ReturnType = RetValue->getType();
assert(isVectorType(ReturnType) || isScalarFloatingType(ReturnType) ||
(ReturnType == IceType_i32) || (ReturnType == IceType_i64));
@@ -5723,12 +5723,12 @@
}
template <typename TraitsType>
-void TargetX86Base<TraitsType>::lowerSelectVector(const InstSelect *Inst) {
- Variable *Dest = Inst->getDest();
+void TargetX86Base<TraitsType>::lowerSelectVector(const InstSelect *Instr) {
+ Variable *Dest = Instr->getDest();
Type DestTy = Dest->getType();
- Operand *SrcT = Inst->getTrueOperand();
- Operand *SrcF = Inst->getFalseOperand();
- Operand *Condition = Inst->getCondition();
+ Operand *SrcT = Instr->getTrueOperand();
+ Operand *SrcF = Instr->getFalseOperand();
+ Operand *Condition = Instr->getCondition();
if (!isVectorType(DestTy))
llvm::report_fatal_error("Expected a vector select");
@@ -5791,9 +5791,9 @@
}
template <typename TraitsType>
-void TargetX86Base<TraitsType>::lowerStore(const InstStore *Inst) {
- Operand *Value = Inst->getData();
- Operand *Addr = Inst->getAddr();
+void TargetX86Base<TraitsType>::lowerStore(const InstStore *Instr) {
+ Operand *Value = Instr->getData();
+ Operand *Addr = Instr->getAddr();
X86OperandMem *NewAddr = formMemoryOperand(Addr, Value->getType());
doMockBoundsCheck(NewAddr);
Type Ty = NewAddr->getType();
@@ -5814,14 +5814,14 @@
template <typename TraitsType>
void TargetX86Base<TraitsType>::doAddressOptStore() {
- auto *Inst = llvm::cast<InstStore>(Context.getCur());
- Operand *Addr = Inst->getAddr();
- Operand *Data = Inst->getData();
- if (auto *OptAddr = computeAddressOpt(Inst, Data->getType(), Addr)) {
- Inst->setDeleted();
+ auto *Instr = llvm::cast<InstStore>(Context.getCur());
+ Operand *Addr = Instr->getAddr();
+ Operand *Data = Instr->getData();
+ if (auto *OptAddr = computeAddressOpt(Instr, Data->getType(), Addr)) {
+ Instr->setDeleted();
auto *NewStore = Context.insert<InstStore>(Data, OptAddr);
- if (Inst->getDest())
- NewStore->setRmwBeacon(Inst->getRmwBeacon());
+ if (Instr->getDest())
+ NewStore->setRmwBeacon(Instr->getRmwBeacon());
}
}
@@ -5928,11 +5928,11 @@
}
template <typename TraitsType>
-void TargetX86Base<TraitsType>::lowerSwitch(const InstSwitch *Inst) {
+void TargetX86Base<TraitsType>::lowerSwitch(const InstSwitch *Instr) {
// Group cases together and navigate through them with a binary search
- CaseClusterArray CaseClusters = CaseCluster::clusterizeSwitch(Func, Inst);
- Operand *Src0 = Inst->getComparison();
- CfgNode *DefaultTarget = Inst->getLabelDefault();
+ CaseClusterArray CaseClusters = CaseCluster::clusterizeSwitch(Func, Instr);
+ Operand *Src0 = Instr->getComparison();
+ CfgNode *DefaultTarget = Instr->getLabelDefault();
assert(CaseClusters.size() != 0); // Should always be at least one
@@ -5943,7 +5943,7 @@
if (CaseClusters.back().getHigh() > UINT32_MAX) {
// TODO(ascull): handle 64-bit case properly (currently naive version)
// This might be handled by a higher level lowering of switches.
- SizeT NumCases = Inst->getNumCases();
+ SizeT NumCases = Instr->getNumCases();
if (NumCases >= 2) {
Src0Lo = legalizeToReg(Src0Lo);
Src0Hi = legalizeToReg(Src0Hi);
@@ -5952,16 +5952,16 @@
Src0Hi = legalize(Src0Hi, Legal_Reg | Legal_Mem);
}
for (SizeT I = 0; I < NumCases; ++I) {
- Constant *ValueLo = Ctx->getConstantInt32(Inst->getValue(I));
- Constant *ValueHi = Ctx->getConstantInt32(Inst->getValue(I) >> 32);
+ Constant *ValueLo = Ctx->getConstantInt32(Instr->getValue(I));
+ Constant *ValueHi = Ctx->getConstantInt32(Instr->getValue(I) >> 32);
InstX86Label *Label = InstX86Label::create(Func, this);
_cmp(Src0Lo, ValueLo);
_br(Traits::Cond::Br_ne, Label);
_cmp(Src0Hi, ValueHi);
- _br(Traits::Cond::Br_e, Inst->getLabel(I));
+ _br(Traits::Cond::Br_e, Instr->getLabel(I));
Context.insert(Label);
}
- _br(Inst->getLabelDefault());
+ _br(Instr->getLabelDefault());
return;
} else {
// All the values are 32-bit so just check the operand is too and then
@@ -6123,7 +6123,7 @@
template <typename TraitsType>
void TargetX86Base<TraitsType>::lowerUnreachable(
- const InstUnreachable * /*Inst*/) {
+ const InstUnreachable * /*Instr*/) {
_ud2();
// Add a fake use of esp to make sure esp adjustments after the unreachable
// do not get dead-code eliminated.
diff --git a/src/PNaClTranslator.cpp b/src/PNaClTranslator.cpp
index 97b8c34..ed2a907 100644
--- a/src/PNaClTranslator.cpp
+++ b/src/PNaClTranslator.cpp
@@ -2743,17 +2743,17 @@
Ice::Variable *Dest = (ReturnType == Ice::IceType_void)
? nullptr
: getNextInstVar(ReturnType);
- std::unique_ptr<Ice::InstCall> Inst;
+ std::unique_ptr<Ice::InstCall> Instr;
if (IntrinsicInfo) {
- Inst.reset(Ice::InstIntrinsicCall::create(Func.get(), Params.size(), Dest,
- Callee, IntrinsicInfo->Info));
+ Instr.reset(Ice::InstIntrinsicCall::create(
+ Func.get(), Params.size(), Dest, Callee, IntrinsicInfo->Info));
} else {
- Inst.reset(Ice::InstCall::create(Func.get(), Params.size(), Dest, Callee,
- IsTailCall));
+ Instr.reset(Ice::InstCall::create(Func.get(), Params.size(), Dest, Callee,
+ IsTailCall));
}
for (Ice::Operand *Param : Params)
- Inst->addArg(Param);
- CurrentNode->appendInst(Inst.release());
+ Instr->addArg(Param);
+ CurrentNode->appendInst(Instr.release());
return;
}
case naclbitc::FUNC_CODE_INST_FORWARDTYPEREF: {