LoopVectorize: Use variable instead of repeated function call
[oota-llvm.git] / lib / Transforms / Vectorize / LoopVectorize.cpp
index 4422079c385892a81e93792ed818df3afbc61a0c..c9275b2371c69f34fedc4d1a5085ec9e42e8eeed 100644 (file)
@@ -2389,10 +2389,11 @@ bool LoopVectorizationLegality::canVectorizeInstrs() {
          ++it) {
 
       if (PHINode *Phi = dyn_cast<PHINode>(it)) {
+        Type *PhiTy = Phi->getType();
         // Check that this PHI type is allowed.
-        if (!Phi->getType()->isIntegerTy() &&
-            !Phi->getType()->isFloatingPointTy() &&
-            !Phi->getType()->isPointerTy()) {
+        if (!PhiTy->isIntegerTy() &&
+            !PhiTy->isFloatingPointTy() &&
+            !PhiTy->isPointerTy()) {
           DEBUG(dbgs() << "LV: Found an non-int non-pointer PHI.\n");
           return false;
         }