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: [email protected]
        ReportedBy: [email protected]
                CC: [email protected]


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.
_______________________________________________
LLVMbugs mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/llvmbugs

Reply via email to