diff options
author | Evgeny Stupachenko <evstupac@gmail.com> | 2016-04-27 03:04:54 +0000 |
---|---|---|
committer | Evgeny Stupachenko <evstupac@gmail.com> | 2016-04-27 03:04:54 +0000 |
commit | 23ce61b66334b78ce7a0dd48c24fbf407ca12d8b (patch) | |
tree | efea78cc6444d7653d38307f6734f96e4b3f412f /llvm/test/Transforms/LoopUnroll/runtime-loop.ll | |
parent | c67651dd70b740765cdb809aa0c87236a7eedc1a (diff) | |
download | bcm5719-llvm-23ce61b66334b78ce7a0dd48c24fbf407ca12d8b.tar.gz bcm5719-llvm-23ce61b66334b78ce7a0dd48c24fbf407ca12d8b.zip |
The patch fixes PR27392.
Summary:
It is incorrect to compare TripCount (which is BECount + 1)
with extraiters (or Count) to check if we should enter unrolled
loop or not, because TripCount can potentially overflow
(when BECount is max unsigned integer).
While comparing BECount with (Count - 1) is overflow safe and
therefore correct.
Reviewer: hfinkel
Differential Revision: http://reviews.llvm.org/D19256
From: Evgeny Stupachenko <evstupac@gmail.com>
llvm-svn: 267662
Diffstat (limited to 'llvm/test/Transforms/LoopUnroll/runtime-loop.ll')
-rw-r--r-- | llvm/test/Transforms/LoopUnroll/runtime-loop.ll | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/llvm/test/Transforms/LoopUnroll/runtime-loop.ll b/llvm/test/Transforms/LoopUnroll/runtime-loop.ll index efa242762f2..2fc4dbd26c7 100644 --- a/llvm/test/Transforms/LoopUnroll/runtime-loop.ll +++ b/llvm/test/Transforms/LoopUnroll/runtime-loop.ll @@ -6,8 +6,8 @@ target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f3 ; Tests for unrolling loops with run-time trip counts ; EPILOG: %xtraiter = and i32 %n -; EPILOG: %lcmp.mod = icmp ne i32 %xtraiter, %n -; EPILOG: br i1 %lcmp.mod, label %for.body.preheader.new, label %for.end.loopexit.unr-lcssa +; EPILOG: %lcmp.mod = icmp ne i32 %xtraiter, 0 +; EPILOG: br i1 %lcmp.mod, label %for.body.epil.preheader, label %for.end.loopexit ; PROLOG: %xtraiter = and i32 %n ; PROLOG: %lcmp.mod = icmp ne i32 %xtraiter, 0 |