diff options
author | Pekka Jaaskelainen <pekka.jaaskelainen@tut.fi> | 2013-04-23 16:44:43 +0000 |
---|---|---|
committer | Pekka Jaaskelainen <pekka.jaaskelainen@tut.fi> | 2013-04-23 16:44:43 +0000 |
commit | d3c90e132a15fe61450315c5b7bee547b0fb09a8 (patch) | |
tree | f6fa33df327ddaa9ac9062f3f3aa60690e9364ef /llvm/lib | |
parent | 6c70dc7842fdc036de1a49a8f62026f5cd6d0c23 (diff) | |
download | bcm5719-llvm-d3c90e132a15fe61450315c5b7bee547b0fb09a8.tar.gz bcm5719-llvm-d3c90e132a15fe61450315c5b7bee547b0fb09a8.zip |
Call the potentially costly isAnnotatedParallel() only once.
Made the uniform write test's checks a bit stricter.
llvm-svn: 180119
Diffstat (limited to 'llvm/lib')
-rw-r--r-- | llvm/lib/Transforms/Vectorize/LoopVectorize.cpp | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp b/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp index 2e42585e35a..162587c5659 100644 --- a/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp +++ b/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp @@ -2556,6 +2556,8 @@ bool LoopVectorizationLegality::canVectorizeMemory() { PtrRtCheck.Pointers.clear(); PtrRtCheck.Need = false; + const bool IsAnnotatedParallel = TheLoop->isAnnotatedParallel(); + // For each block. for (Loop::block_iterator bb = TheLoop->block_begin(), be = TheLoop->block_end(); bb != be; ++bb) { @@ -2570,7 +2572,7 @@ bool LoopVectorizationLegality::canVectorizeMemory() { if (it->mayReadFromMemory()) { LoadInst *Ld = dyn_cast<LoadInst>(it); if (!Ld) return false; - if (!Ld->isSimple() && !TheLoop->isAnnotatedParallel()) { + if (!Ld->isSimple() && !IsAnnotatedParallel) { DEBUG(dbgs() << "LV: Found a non-simple load.\n"); return false; } @@ -2582,7 +2584,7 @@ bool LoopVectorizationLegality::canVectorizeMemory() { if (it->mayWriteToMemory()) { StoreInst *St = dyn_cast<StoreInst>(it); if (!St) return false; - if (!St->isSimple() && !TheLoop->isAnnotatedParallel()) { + if (!St->isSimple() && !IsAnnotatedParallel) { DEBUG(dbgs() << "LV: Found a non-simple store.\n"); return false; } @@ -2629,7 +2631,7 @@ bool LoopVectorizationLegality::canVectorizeMemory() { ReadWrites.insert(std::make_pair(Ptr, ST)); } - if (TheLoop->isAnnotatedParallel()) { + if (IsAnnotatedParallel) { DEBUG(dbgs() << "LV: A loop annotated parallel, ignore memory dependency " << "checks.\n"); |