[LLVMbugs] [Bug 255] [tailduplication] Single basic block loops are very rare

bugzilla-daemon at cs.uiuc.edu bugzilla-daemon at cs.uiuc.edu
Sat Feb 28 22:48:04 PST 2004


sabre at nondot.org changed:

           What    |Removed                     |Added
             Status|NEW                         |RESOLVED
         Resolution|                            |FIXED

------- Additional Comments From sabre at nondot.org  2004-02-29 00:48 -------
This tiny patch fixes the problem:

After applying this, we get:

void %test() {
        br label %no_exit
        %i.0.pn = phi int [ 0, %entry ], [ %inc, %no_exit ]
        %tmp.4 = cast int %i.0.pn to long
        %tmp.5 = getelementptr [1000 x int]* %A, long 0, long %tmp.4
        store int 0, int* %tmp.5
        %inc = add int %i.0.pn, 1
        %tmp.11 = setlt int %inc, 1000
        br bool %tmp.11, label %no_exit, label %return
return:         ; preds = %no_exit
        ret void

As we would expect on the testcase in the bug.

Note that this is really just a bandaid over the problem.  It simply enables
tail-duplication in the one really bad case that it is absolutely essential. 
The real problem is still very present, and should be fixed: namely that taildup
requires a general dominator update mechanism.

In the meantime, at least we won't generate completely brain-dead code and
modulo-sched will have a chance again. :)


------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.

More information about the llvm-bugs mailing list