[LLVMbugs] [Bug 9042] New: Improving reuse of registers across loop iterations

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Mon Jan 24 15:49:01 PST 2011


http://llvm.org/bugs/show_bug.cgi?id=9042

           Summary: Improving reuse of registers across loop iterations
           Product: new-bugs
           Version: 2.8
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: new bugs
        AssignedTo: unassignedbugs at nondot.org
        ReportedBy: teoryn at gmail.com
                CC: llvmbugs at cs.uiuc.edu


Created an attachment (id=6043)
 --> (http://llvm.org/bugs/attachment.cgi?id=6043)
Two examples showing partial and no reuse of registers between iterations

Overview:
Certain access patterns are able to reuse more registers between iterations of
the inner loop than llvm now finds.

Steps to Reproduce:
The included .c files show two similar examples (three.c is just one.c unrolled
three times) which could reuse registers across iterations of the loop.
hist.txt shows the steps used to generate the .ll files in question.

Actual Results:
At most one register is reused between iterations of the loop, although in both
cases there is opportunity to reuse two registers.
The opt passes done for *.pre-gvn.ll and *.post-gvn.ll are all the passes shown
in 'opt -O3 -debug-pass=Arguments one.ll' up to (and including for post-gvn)
the -gvn pass, which enables the reuse of one register in one.c (and none in
three.c). This might be the pass which could be modified to meet the expected
results.

Expected Results:
Ideally two registers would be reused across iterations, not just one (in the
case of one.c) or zero (in the case of three.c).

Build Date & Platform:
$ opt --version
Low Level Virtual Machine (http://llvm.org/):
  llvm version 2.8 (Ubuntu 2.8-0ubuntu1)
  Optimized build.
  Built Oct  6 2010 (13:24:23).
  Host: x86_64-pc-linux-gnu
  Host CPU: i686

  Registered Targets:
    (none)
$ clang --version
clang version 2.8 (branches/release_28)
Target: x86_64-pc-linux-gnu
Thread model: posix

-- 
Configure bugmail: http://llvm.org/bugs/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.



More information about the llvm-bugs mailing list