[LLVMbugs] [Bug 5110] New: LiveIntervals::getApproximateInstructionCount() some times return 0 (zero)!

bugzilla-daemon at cs.uiuc.edu bugzilla-daemon at cs.uiuc.edu
Wed Sep 30 09:34:20 PDT 2009


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

           Summary: LiveIntervals::getApproximateInstructionCount() some
                    times return 0 (zero)!
           Product: libraries
           Version: 2.6
          Platform: PC
        OS/Version: Windows NT
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Core LLVM classes
        AssignedTo: unassignedbugs at nondot.org
        ReportedBy: DevOmem at web.de
                CC: llvmbugs at cs.uiuc.edu


LiveIntervals::getApproximateInstructionCount()  some times return 0 (zero) and
causes division by zero.

Solution so far looks like this

unsigned getApproximateInstructionCount(LiveInterval& I) 
{
   double IntervalPercentage = getScaledIntervalSize(I) / 1000.0;
   unsigned result = (unsigned)(IntervalPercentage * FunctionSize);
   if(result<=0) result = 1;
   return result;
   //return (unsigned)(IntervalPercentage * FunctionSize);
}


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