diff options
Diffstat (limited to 'lib/CodeGen')
-rw-r--r-- | lib/CodeGen/InstrSched/SchedGraph.cpp | 5 | ||||
-rw-r--r-- | lib/CodeGen/InstrSelection/InstrForest.cpp | 7 |
2 files changed, 7 insertions, 5 deletions
diff --git a/lib/CodeGen/InstrSched/SchedGraph.cpp b/lib/CodeGen/InstrSched/SchedGraph.cpp index 852c4f2686..fd09e9e777 100644 --- a/lib/CodeGen/InstrSched/SchedGraph.cpp +++ b/lib/CodeGen/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/CodeGen/InstrSelection/InstrForest.cpp b/lib/CodeGen/InstrSelection/InstrForest.cpp index f5a524707b..199ed6569b 100644 --- a/lib/CodeGen/InstrSelection/InstrForest.cpp +++ b/lib/CodeGen/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. |