[llvm-bugs] [Bug 36738] New: [SCEV] Inconsistent SCEV formation for zext

via llvm-bugs llvm-bugs at lists.llvm.org
Wed Mar 14 11:10:46 PDT 2018


https://bugs.llvm.org/show_bug.cgi?id=36738

            Bug ID: 36738
           Summary: [SCEV] Inconsistent SCEV formation for zext
           Product: libraries
           Version: trunk
          Hardware: All
                OS: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: Global Analyses
          Assignee: unassignedbugs at nondot.org
          Reporter: pankaj.chawla at intel.com
                CC: llvm-bugs at lists.llvm.org

Created attachment 20063
  --> https://bugs.llvm.org/attachment.cgi?id=20063&action=edit
test case

SCEV is behaving inconsistently when forming SCEV for this zext instruction in
the attached test case-
%conv5 = zext i32 %dec to i64

If we request a SCEV for the instruction, it returns-
(zext i32 {{-1,+,1}<nw><%for.body>,+,-1}<nw><%for.body7> to i64)

This can be seen by invoking-
$ opt -analyze -scalar-evolution inconsistent-scev-zext.ll

But when computing the backedge taken count of the containing loop for.body7,
it is able to push zext inside the AddRec and forms the following for the same
instruction-
{(zext i32 {-1,+,1}<%for.body> to i64),+,-1}<nw><%for.body7>

This allows ScalarEvolution to compute a valid backedge taken count for the
loop.

Reference to email discussion regarding the bug-
http://lists.llvm.org/pipermail/llvm-dev/2018-February/121107.html

-- 
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/20180314/158d4c09/attachment.html>


More information about the llvm-bugs mailing list