diff options
Diffstat (limited to 'lib/Target/SparcV9')
-rw-r--r-- | lib/Target/SparcV9/InstrSched/SchedGraph.cpp | 5 | ||||
-rw-r--r-- | lib/Target/SparcV9/InstrSelection/InstrForest.cpp | 7 | ||||
-rw-r--r-- | lib/Target/SparcV9/SparcV9InstrSelection.cpp | 3 |
3 files changed, 8 insertions, 7 deletions
diff --git a/lib/Target/SparcV9/InstrSched/SchedGraph.cpp b/lib/Target/SparcV9/InstrSched/SchedGraph.cpp index 852c4f2..fd09e9e 100644 --- a/lib/Target/SparcV9/InstrSched/SchedGraph.cpp +++ b/lib/Target/SparcV9/InstrSched/SchedGraph.cpp @@ -21,6 +21,7 @@ #include "llvm/Target/MachineInstrInfo.h" #include "llvm/Target/MachineRegInfo.h" #include "llvm/Support/StringExtras.h" +#include "llvm/iOther.h" #include <algorithm> @@ -540,7 +541,7 @@ SchedGraph::addSSAEdge(SchedGraphNode* node, // Phi instructions are the only ones that produce a value but don't get // any non-dummy machine instructions. Return here as an optimization. // - if (defVMInstr->isPHINode()) + if (isa<PHINode>(defVMInstr)) return; // Now add the graph edge for the appropriate machine instruction(s). @@ -642,7 +643,7 @@ void SchedGraph::addNonSSAEdgesForValue(const Instruction* instr, const TargetMachine& target) { - if (instr->isPHINode()) + if (isa<PHINode>(instr)) return; MachineCodeForVMInstr& mvec = instr->getMachineInstrVec(); diff --git a/lib/Target/SparcV9/InstrSelection/InstrForest.cpp b/lib/Target/SparcV9/InstrSelection/InstrForest.cpp index f5a5247..199ed65 100644 --- a/lib/Target/SparcV9/InstrSelection/InstrForest.cpp +++ b/lib/Target/SparcV9/InstrSelection/InstrForest.cpp @@ -26,6 +26,7 @@ #include "llvm/Method.h" #include "llvm/iTerminators.h" #include "llvm/iMemory.h" +#include "llvm/iOther.h" #include "llvm/ConstPoolVals.h" #include "llvm/BasicBlock.h" #include "llvm/CodeGen/MachineInstr.h" @@ -57,11 +58,11 @@ InstructionNode::InstructionNode(Instruction* I) // Distinguish special cases of some instructions such as Ret and Br // - if (opLabel == Instruction::Ret && ((ReturnInst*)I)->getReturnValue()) + if (opLabel == Instruction::Ret && cast<ReturnInst>(I)->getReturnValue()) { opLabel = RetValueOp; // ret(value) operation } - else if (opLabel == Instruction::Br && ! ((BranchInst*)I)->isUnconditional()) + else if (opLabel ==Instruction::Br && !cast<BranchInst>(I)->isUnconditional()) { opLabel = BrCondOp; // br(cond) operation } @@ -302,7 +303,7 @@ InstrForest::buildTreeForInstruction(Instruction *instr) InstrTreeNode* opTreeNode; if (isa<Instruction>(operand) && operand->use_size() == 1 && cast<Instruction>(operand)->getParent() == instr->getParent() && - ! instr->isPHINode() && + !isa<PHINode>(instr) && instr->getOpcode() != Instruction::Call) { // Recursively create a treeNode for it. diff --git a/lib/Target/SparcV9/SparcV9InstrSelection.cpp b/lib/Target/SparcV9/SparcV9InstrSelection.cpp index b1b5e01..e4ae8a8 100644 --- a/lib/Target/SparcV9/SparcV9InstrSelection.cpp +++ b/lib/Target/SparcV9/SparcV9InstrSelection.cpp @@ -2010,9 +2010,8 @@ GetInstructionsByRule(InstructionNode* subtreeRoot, // Also, mark the operands of the Call as implicit operands // of the machine instruction. { - CallInst* callInstr = (CallInst*) subtreeRoot->getInstruction(); + CallInst *callInstr = cast<CallInst>(subtreeRoot->getInstruction()); Method* callee = callInstr->getCalledMethod(); - assert(callInstr->getOpcode() == Instruction::Call); Instruction* jmpAddrReg = new TmpInstruction(Instruction::UserOp1, callee, NULL); |