[PATCH] D30632: [LoopUnrolling] Fix loop size check for peeling
Max Kazantsev via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Mon Mar 6 19:30:11 PST 2017
mkazantsev updated this revision to Diff 90784.
https://reviews.llvm.org/D30632
Files:
lib/Transforms/Utils/LoopUnrollPeel.cpp
Index: lib/Transforms/Utils/LoopUnrollPeel.cpp
===================================================================
--- lib/Transforms/Utils/LoopUnrollPeel.cpp
+++ lib/Transforms/Utils/LoopUnrollPeel.cpp
@@ -75,7 +75,9 @@
// its only back edge. If there is such Phi, peeling 1 iteration from the
// loop is profitable, because starting from 2nd iteration we will have an
// invariant instead of this Phi.
- if (auto *BackEdge = L->getLoopLatch()) {
+ if (LoopSize <= UP.Threshold) {
+ BasicBlock *BackEdge = L->getLoopLatch();
+ assert(BackEdge && "Loop is not in simplified form?");
BasicBlock *Header = L->getHeader();
// Iterate over Phis to find one with invariant input on back edge.
bool FoundCandidate = false;
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D30632.90784.patch
Type: text/x-patch
Size: 749 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170307/d1ef7fee/attachment.bin>
More information about the llvm-commits
mailing list