OSDN Git Service

Simplify code. No functionality change.
authorJakub Staszak <kubastaszak@gmail.com>
Sun, 21 Oct 2012 15:29:19 +0000 (15:29 +0000)
committerJakub Staszak <kubastaszak@gmail.com>
Sun, 21 Oct 2012 15:29:19 +0000 (15:29 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@166392 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Transforms/Vectorize/LoopVectorize.cpp

index 1b6011b..7efb003 100644 (file)
@@ -1186,14 +1186,13 @@ bool LoopVectorizationLegality::canVectorizeMemory(BasicBlock &BB) {
 /// marked with the NoAlias attribute.
 bool LoopVectorizationLegality::isIdentifiedSafeObject(Value* Val) {
   assert(Val && "Invalid value");
-  if (dyn_cast<GlobalValue>(Val))
+  if (isa<GlobalValue>(Val))
     return true;
-  if (dyn_cast<AllocaInst>(Val))
+  if (isa<AllocaInst>(Val))
     return true;
-  Argument *A = dyn_cast<Argument>(Val);
-  if (!A)
-    return false;
-  return A->hasNoAliasAttr();
+  if (Argument *A = dyn_cast<Argument>(Val))
+    return A->hasNoAliasAttr();
+  return false;
 }
 
 bool LoopVectorizationLegality::AddReductionVar(PHINode *Phi,