diff --git a/llvm/lib/Transforms/Scalar/GVNPRE.cpp b/llvm/lib/Transforms/Scalar/GVNPRE.cpp index 65af1a25ee8f..25cd8165fd09 100644 --- a/llvm/lib/Transforms/Scalar/GVNPRE.cpp +++ b/llvm/lib/Transforms/Scalar/GVNPRE.cpp @@ -630,9 +630,7 @@ Value* GVNPRE::phi_translate(Value* V, BasicBlock* pred, BasicBlock* succ) { return 0; // Unary Operations - if (isa(V)) { - User* U = cast(V); - + if (CastInst* U = dyn_cast(V)) { Value* newOp1 = 0; if (isa(U->getOperand(0))) newOp1 = phi_translate(U->getOperand(0), pred, succ); @@ -817,9 +815,7 @@ void GVNPRE::clean(SmallPtrSet& set, BitVector& presentInSet) { Value* v = worklist[i]; // Handle unary ops - if (isa(v)) { - User* U = cast(v); - + if (CastInst* U = dyn_cast(v)) { bool lhsValid = !isa(U->getOperand(0)); lhsValid |= presentInSet.test(VN.lookup(U->getOperand(0))); if (lhsValid) @@ -892,8 +888,7 @@ void GVNPRE::topo_sort(SmallPtrSet& set, std::vector& vec) { Value* e = stack.back(); // Handle unary ops - if (isa(e)) { - User* U = cast(e); + if (CastInst* U = dyn_cast(e)) { Value* l = find_leader(set, VN.lookup(U->getOperand(0))); if (l != 0 && isa(l) && @@ -1054,8 +1049,7 @@ void GVNPRE::buildsets_availout(BasicBlock::iterator I, currPhis.insert(p); // Handle unary ops - } else if (isa(I)) { - User* U = cast(I); + } else if (CastInst* U = dyn_cast(I)) { Value* leftValue = U->getOperand(0); unsigned num = VN.lookup_or_add(U);