summaryrefslogtreecommitdiff
path: root/lib/Transforms
diff options
context:
space:
mode:
authorDan Gohman <gohman@apple.com>2007-05-04 14:59:09 +0000
committerDan Gohman <gohman@apple.com>2007-05-04 14:59:09 +0000
commite5b01bea7b9b7dce7c24484d2d915b0c118d4d07 (patch)
tree5e88a23e8a888b9e2f8ac6fb5f7b6134b11ec2d0 /lib/Transforms
parent6da91d3c2c138eb1d9739701a1314ba3580df897 (diff)
downloadllvm-e5b01bea7b9b7dce7c24484d2d915b0c118d4d07.tar.gz
llvm-e5b01bea7b9b7dce7c24484d2d915b0c118d4d07.tar.bz2
llvm-e5b01bea7b9b7dce7c24484d2d915b0c118d4d07.tar.xz
Use IntrinsicInst to test for prefetch instructions, which is ever so
slightly nicer than using CallInst with an extra check; thanks Chris. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36743 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Transforms')
-rw-r--r--lib/Transforms/Scalar/LoopStrengthReduce.cpp11
1 files changed, 5 insertions, 6 deletions
diff --git a/lib/Transforms/Scalar/LoopStrengthReduce.cpp b/lib/Transforms/Scalar/LoopStrengthReduce.cpp
index 652b39f4c6..72faa86ff0 100644
--- a/lib/Transforms/Scalar/LoopStrengthReduce.cpp
+++ b/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;
}