From: Hal Finkel Date: Mon, 11 Feb 2013 05:29:48 +0000 (+0000) Subject: BBVectorize: isa/cast cleanup in getInstructionTypes X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=3fc1e4aa159ec15058bb26acbec39f6e09990207;p=oota-llvm.git BBVectorize: isa/cast cleanup in getInstructionTypes Profiling suggests that getInstructionTypes is performance-sensitive, this cleans up some double-casting in that function in favor of using dyn_cast. No functionality change intended. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@174857 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Transforms/Vectorize/BBVectorize.cpp b/lib/Transforms/Vectorize/BBVectorize.cpp index 824494dcc77..682e99208dc 100644 --- a/lib/Transforms/Vectorize/BBVectorize.cpp +++ b/lib/Transforms/Vectorize/BBVectorize.cpp @@ -466,18 +466,18 @@ namespace { static inline void getInstructionTypes(Instruction *I, Type *&T1, Type *&T2) { - if (isa(I)) { + if (StoreInst *SI = dyn_cast(I)) { // For stores, it is the value type, not the pointer type that matters // because the value is what will come from a vector register. - Value *IVal = cast(I)->getValueOperand(); + Value *IVal = SI->getValueOperand(); T1 = IVal->getType(); } else { T1 = I->getType(); } - if (I->isCast()) - T2 = cast(I)->getSrcTy(); + if (CastInst *CI = dyn_cast(I)) + T2 = CI->getSrcTy(); else T2 = T1;