summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2010-11-18 07:38:43 +0000
committerChris Lattner <sabre@nondot.org>2010-11-18 07:38:43 +0000
commit75cfe985342b4242a3f8d98c1d658fc222bb839e (patch)
tree5e6a99e104a927f75c7b44ab1a5d56e466cccccb /llvm/lib/Transforms
parent1e37bbafbb2b22072fb5f9141d1344ec61fede6a (diff)
downloadbcm5719-llvm-75cfe985342b4242a3f8d98c1d658fc222bb839e.tar.gz
bcm5719-llvm-75cfe985342b4242a3f8d98c1d658fc222bb839e.zip
use AA::isNoAlias instead of open coding it. Remove an extraneous noalias check:
there is no need to check to see if the source and dest of a memcpy are noalias, behavior is undefined if not. llvm-svn: 119691
Diffstat (limited to 'llvm/lib/Transforms')
-rw-r--r--llvm/lib/Transforms/Scalar/MemCpyOptimizer.cpp18
1 files changed, 7 insertions, 11 deletions
diff --git a/llvm/lib/Transforms/Scalar/MemCpyOptimizer.cpp b/llvm/lib/Transforms/Scalar/MemCpyOptimizer.cpp
index 39f40a1fb9d..cab8bac0f94 100644
--- a/llvm/lib/Transforms/Scalar/MemCpyOptimizer.cpp
+++ b/llvm/lib/Transforms/Scalar/MemCpyOptimizer.cpp
@@ -689,22 +689,18 @@ bool MemCpyOpt::processMemCpyMemCpyDependence(MemCpyInst *M, MemCpyInst *MDep,
return false;
// Finally, we have to make sure that the dest of the second does not
- // alias the source of the first
+ // alias the source of the first.
AliasAnalysis &AA = getAnalysis<AliasAnalysis>();
- if (AA.alias(M->getRawDest(), MSize, MDep->getRawSource(), DepSize) !=
- AliasAnalysis::NoAlias)
- return false;
- else if (AA.alias(M->getRawDest(), MSize, M->getRawSource(), MSize) !=
- AliasAnalysis::NoAlias)
- return false;
- else if (AA.alias(MDep->getRawDest(), DepSize, MDep->getRawSource(), DepSize)
- != AliasAnalysis::NoAlias)
+ if (!AA.isNoAlias(M->getRawDest(), MSize, MDep->getRawSource(), DepSize) ||
+ !AA.isNoAlias(M->getRawDest(), MSize, M->getRawSource(), MSize))
return false;
// If all checks passed, then we can transform these memcpy's
- const Type *ArgTys[3] = { M->getRawDest()->getType(),
+ const Type *ArgTys[3] = {
+ M->getRawDest()->getType(),
MDep->getRawSource()->getType(),
- M->getLength()->getType() };
+ M->getLength()->getType()
+ };
Function *MemCpyFun =
Intrinsic::getDeclaration(M->getParent()->getParent()->getParent(),
M->getIntrinsicID(), ArgTys, 3);
OpenPOWER on IntegriCloud