diff options
author | Hal Finkel <hfinkel@anl.gov> | 2013-02-11 05:29:48 +0000 |
---|---|---|
committer | Hal Finkel <hfinkel@anl.gov> | 2013-02-11 05:29:48 +0000 |
commit | dd4bc6659349b274371f03b90a81f0a88c0d11a6 (patch) | |
tree | ad2c6e2f96f83cd1cb12bb404bc3a0fbeb7b5635 /llvm/lib/Transforms | |
parent | c1cc166948e3a11b0ee2e8f3090ad7abb1430285 (diff) | |
download | bcm5719-llvm-dd4bc6659349b274371f03b90a81f0a88c0d11a6.tar.gz bcm5719-llvm-dd4bc6659349b274371f03b90a81f0a88c0d11a6.zip |
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.
llvm-svn: 174857
Diffstat (limited to 'llvm/lib/Transforms')
-rw-r--r-- | llvm/lib/Transforms/Vectorize/BBVectorize.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/llvm/lib/Transforms/Vectorize/BBVectorize.cpp b/llvm/lib/Transforms/Vectorize/BBVectorize.cpp index 824494dcc77..682e99208dc 100644 --- a/llvm/lib/Transforms/Vectorize/BBVectorize.cpp +++ b/llvm/lib/Transforms/Vectorize/BBVectorize.cpp @@ -466,18 +466,18 @@ namespace { static inline void getInstructionTypes(Instruction *I, Type *&T1, Type *&T2) { - if (isa<StoreInst>(I)) { + if (StoreInst *SI = dyn_cast<StoreInst>(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<StoreInst>(I)->getValueOperand(); + Value *IVal = SI->getValueOperand(); T1 = IVal->getType(); } else { T1 = I->getType(); } - if (I->isCast()) - T2 = cast<CastInst>(I)->getSrcTy(); + if (CastInst *CI = dyn_cast<CastInst>(I)) + T2 = CI->getSrcTy(); else T2 = T1; |