[llvm-bugs] [Bug 42965] New: ExitValue rewrite in IndVarSimplify may introduce extra spills and instructions at no benefit

via llvm-bugs llvm-bugs at lists.llvm.org
Mon Aug 12 05:23:11 PDT 2019


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

            Bug ID: 42965
           Summary: ExitValue rewrite in IndVarSimplify may introduce
                    extra spills and instructions at no benefit
           Product: libraries
           Version: trunk
          Hardware: PC
                OS: All
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: Loop Optimizer
          Assignee: unassignedbugs at nondot.org
          Reporter: d.maljutin at yandex.ru
                CC: llvm-bugs at lists.llvm.org

Created attachment 22369
  --> https://bugs.llvm.org/attachment.cgi?id=22369&action=edit
C code showing the issue

When there is a chain of calculations on some variable in a loop which is then
used outside, IndVarSimplify may rewrite its exit value to be independent from
loop adding index computations to the loop header.
When the loop body is big enough (e.g. due to unswitching of nested loops),
this increases register pressure and may lead to spills/reloads.
The example can be seen here: https://godbolt.org/z/_wxzut (the code can also
be found in the attachments).

-- 
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/20190812/4ff88536/attachment.html>


More information about the llvm-bugs mailing list