diff options
| author | Dan Gohman <gohman@apple.com> | 2007-05-04 14:59:09 +0000 |
|---|---|---|
| committer | Dan Gohman <gohman@apple.com> | 2007-05-04 14:59:09 +0000 |
| commit | 2bcbd5b7ca8a364491a4b1b9bc7dca0b18e04a6f (patch) | |
| tree | 1a5c0f7bd1d20f37c7e7e408253f0938da7acef1 /llvm | |
| parent | 430e80d6700e609454d8370b695ac0447500edde (diff) | |
| download | bcm5719-llvm-2bcbd5b7ca8a364491a4b1b9bc7dca0b18e04a6f.tar.gz bcm5719-llvm-2bcbd5b7ca8a364491a4b1b9bc7dca0b18e04a6f.zip | |
Use IntrinsicInst to test for prefetch instructions, which is ever so
slightly nicer than using CallInst with an extra check; thanks Chris.
llvm-svn: 36743
Diffstat (limited to 'llvm')
| -rw-r--r-- | llvm/lib/Transforms/Scalar/LoopStrengthReduce.cpp | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/llvm/lib/Transforms/Scalar/LoopStrengthReduce.cpp b/llvm/lib/Transforms/Scalar/LoopStrengthReduce.cpp index 652b39f4c64..72faa86ff04 100644 --- a/llvm/lib/Transforms/Scalar/LoopStrengthReduce.cpp +++ b/llvm/lib/Transforms/Scalar/LoopStrengthReduce.cpp @@ -19,7 +19,7 @@ #include "llvm/Transforms/Scalar.h" #include "llvm/Constants.h" #include "llvm/Instructions.h" -#include "llvm/Intrinsics.h" +#include "llvm/IntrinsicInst.h" #include "llvm/Type.h" #include "llvm/DerivedTypes.h" #include "llvm/Analysis/Dominators.h" @@ -1043,12 +1043,11 @@ void LoopStrengthReduce::StrengthReduceStridedIVUsers(const SCEVHandle &Stride, if (StoreInst *SI = dyn_cast<StoreInst>(UsersToProcess[i].Inst)) { if (SI->getOperand(1) == UsersToProcess[i].OperandValToReplace) isAddress = true; - } else if (CallInst *CI = dyn_cast<CallInst>(UsersToProcess[i].Inst)) { + } else if (IntrinsicInst *II = + dyn_cast<IntrinsicInst>(UsersToProcess[i].Inst)) { // Addressing modes can also be folded into prefetches. - Function *CalledFunc = CI->getCalledFunction(); - if (CalledFunc != NULL && - CalledFunc->getIntrinsicID() == Intrinsic::prefetch && - CI->getOperand(1) == UsersToProcess[i].OperandValToReplace) + if (II->getIntrinsicID() == Intrinsic::prefetch && + II->getOperand(1) == UsersToProcess[i].OperandValToReplace) isAddress = true; } |

