[LLVMbugs] [Bug 1101] NEW: ScalarEvolution can't find iteration count without tail duplication

bugzilla-daemon at cs.uiuc.edu bugzilla-daemon at cs.uiuc.edu
Tue Jan 9 16:28:05 PST 2007


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

           Summary: ScalarEvolution can't find iteration count without tail
                    duplication
           Product: new-bugs
           Version: unspecified
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P2
         Component: new bugs
        AssignedTo: unassignedbugs at nondot.org
        ReportedBy: wjiang at cs.ucla.edu
                CC: rspencer at x10sys.com


Hi, the TOT llvm can't find the iteration count without tail duplication, I 
guess it's caused by the following code in 

ScalaEvoluation.cpp:
  // Currently we check for this by checking to see if the Exit branch goes to
  // the loop header.  If so, we know it will always execute the same number of
  // times as the loop.  More extensive analysis could be done to handle more
  // cases here.
 if (ExitBr->getSuccessor(0) != L->getHeader() &&
      ExitBr->getSuccessor(1) != L->getHeader())
    return UnknownValue;

I need to disable tail duplication because it changes a while loop to a do-
while loop by moving the exiting branch to the end of the loop body. 

I attached two files: (1) foo.bc : a simple loop without tail duplication
(2) foo.taildup.bc: a simple loop with tail duplication. I ran "opt -indvar" on 
these two files, llvm failed to find trip count on the first example; but if I 
comment those three lines, it works fine and report the correct iteration 
count. Based on my understanding, those checking are not necessary since 
scalarevoluation works normally even the checking fails. 

Thanks.



------- 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