[llvm-commits] CVS: llvm/lib/Transforms/Scalar/LoopStrengthReduce.cpp

Dan Gohman djg at cray.com
Fri May 4 07:59:27 PDT 2007



Changes in directory llvm/lib/Transforms/Scalar:

LoopStrengthReduce.cpp updated: 1.135 -> 1.136
---
Log message:

Use IntrinsicInst to test for prefetch instructions, which is ever so
slightly nicer than using CallInst with an extra check; thanks Chris.


---
Diffs of the changes:  (+5 -6)

 LoopStrengthReduce.cpp |   11 +++++------
 1 files changed, 5 insertions(+), 6 deletions(-)


Index: llvm/lib/Transforms/Scalar/LoopStrengthReduce.cpp
diff -u llvm/lib/Transforms/Scalar/LoopStrengthReduce.cpp:1.135 llvm/lib/Transforms/Scalar/LoopStrengthReduce.cpp:1.136
--- llvm/lib/Transforms/Scalar/LoopStrengthReduce.cpp:1.135	Thu May  3 18:20:33 2007
+++ llvm/lib/Transforms/Scalar/LoopStrengthReduce.cpp	Fri May  4 09:59:09 2007
@@ -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 @@
       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;
       }
       






More information about the llvm-commits mailing list