projects
/
platform
/
upstream
/
llvm.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
7cc3d31
)
Avoid a confusing assert for silly options: -unroll-runtime -unroll-count=1.
author
Andrew Trick
<atrick@apple.com>
Fri, 16 Dec 2011 02:03:48 +0000
(
02:03
+0000)
committer
Andrew Trick
<atrick@apple.com>
Fri, 16 Dec 2011 02:03:48 +0000
(
02:03
+0000)
No need for an explicit test case for an unsupported combination of options.
llvm-svn: 146721
llvm/lib/Transforms/Utils/LoopUnroll.cpp
patch
|
blob
|
history
diff --git
a/llvm/lib/Transforms/Utils/LoopUnroll.cpp
b/llvm/lib/Transforms/Utils/LoopUnroll.cpp
index
b96f14b
..
512b689
100644
(file)
--- a/
llvm/lib/Transforms/Utils/LoopUnroll.cpp
+++ b/
llvm/lib/Transforms/Utils/LoopUnroll.cpp
@@
-176,6
+176,11
@@
bool llvm::UnrollLoop(Loop *L, unsigned Count, unsigned TripCount,
if (TripCount != 0 && Count > TripCount)
Count = TripCount;
+ // Don't enter the unroll code if there is nothing to do. This way we don't
+ // need to support "partial unrolling by 1".
+ if (TripCount == 0 && Count < 2)
+ return false;
+
assert(Count > 0);
assert(TripMultiple > 0);
assert(TripCount == 0 || TripCount % TripMultiple == 0);