[llvm-bugs] [Bug 4914] llvm doesn't do range analysis on induction variable
via llvm-bugs
llvm-bugs at lists.llvm.org
Fri Nov 22 13:48:53 PST 2019
https://bugs.llvm.org/show_bug.cgi?id=4914
Florian Hahn <florian_hahn at apple.com> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |florian_hahn at apple.com
Status|NEW |RESOLVED
Resolution|--- |FIXED
--- Comment #10 from Florian Hahn <florian_hahn at apple.com> ---
It looks like all 3 points are done by LLVM now (https://godbolt.org/z/4VfEXx).
With -S -emit-llvm -O3 -fno-vectorize -g0 -mllvm -unroll-max-count=1, we
generate the following loop body, with just a single compare:
1: ; preds = %1, %0
%2 = phi i32 [ 0, %0 ], [ %7, %1 ]
%3 = phi i32 [ 0, %0 ], [ %8, %1 ]
%4 = icmp ult i32 %3, 255
%5 = select i1 %4, i32 %3, i32 255
%6 = add i32 %2, 255
%7 = add i32 %6, %5
%8 = add nuw nsw i32 %3, 1
%9 = icmp eq i32 %8, 1000000000
br i1 %9, label %10, label %1
Arguably, we still could still try to sink the add 255 out of the loop.
--
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20191122/53325459/attachment-0001.html>
More information about the llvm-bugs
mailing list