From: Benjamin Kramer Date: Sat, 20 Apr 2013 10:36:17 +0000 (+0000) Subject: VecUtils: Clean up uses of dyn_cast. X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=d760c08b34d0a194c047b62a93f984ce1da57204;p=oota-llvm.git VecUtils: Clean up uses of dyn_cast. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@179936 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Transforms/Vectorize/VecUtils.cpp b/lib/Transforms/Vectorize/VecUtils.cpp index ad9ccf2bbc2..03dd5c73266 100644 --- a/lib/Transforms/Vectorize/VecUtils.cpp +++ b/lib/Transforms/Vectorize/VecUtils.cpp @@ -557,7 +557,7 @@ Value *BoUpSLP::vectorizeTree_rec(ArrayRef VL, int VF) { bool AllConst = true; bool AllSameScalar = true; for (unsigned i = 0, e = VF; i < e; ++i) { - AllConst &= !!dyn_cast(VL[i]); + AllConst &= isa(VL[i]); AllSameScalar &= (VL[0] == VL[i]); // The instruction must be in the same BB, and it must be vectorizable. Instruction *I = dyn_cast(VL[i]); @@ -609,13 +609,13 @@ Value *BoUpSLP::vectorizeTree_rec(ArrayRef VL, int VF) { Value *RHS = vectorizeTree_rec(RHSVL, VF); Value *LHS = vectorizeTree_rec(LHSVL, VF); IRBuilder<> Builder(GetLastInstr(VL, VF)); - BinaryOperator *BinOp = dyn_cast(VL0); + BinaryOperator *BinOp = cast(VL0); Value *V = Builder.CreateBinOp(BinOp->getOpcode(), RHS,LHS); VectorizedValues[VL0] = V; return V; } case Instruction::Load: { - LoadInst *LI = dyn_cast(VL0); + LoadInst *LI = cast(VL0); unsigned Alignment = LI->getAlignment(); // Check if all of the loads are consecutive. @@ -632,7 +632,7 @@ Value *BoUpSLP::vectorizeTree_rec(ArrayRef VL, int VF) { return LI; } case Instruction::Store: { - StoreInst *SI = dyn_cast(VL0); + StoreInst *SI = cast(VL0); unsigned Alignment = SI->getAlignment(); ValueList ValueOp;