[llvm] r186658 - Fix uninitialized memory read found by MemorySanitizer: always set output parameter of ConvergingScheduler::SchedBoundary::getOtherResourceCount

Alexey Samsonov samsonov at google.com
Fri Jul 19 01:55:18 PDT 2013


Author: samsonov
Date: Fri Jul 19 03:55:18 2013
New Revision: 186658

URL: http://llvm.org/viewvc/llvm-project?rev=186658&view=rev
Log:
Fix uninitialized memory read found by MemorySanitizer: always set output parameter of ConvergingScheduler::SchedBoundary::getOtherResourceCount

Modified:
    llvm/trunk/lib/CodeGen/MachineScheduler.cpp

Modified: llvm/trunk/lib/CodeGen/MachineScheduler.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/MachineScheduler.cpp?rev=186658&r1=186657&r2=186658&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/MachineScheduler.cpp (original)
+++ llvm/trunk/lib/CodeGen/MachineScheduler.cpp Fri Jul 19 03:55:18 2013
@@ -1593,6 +1593,7 @@ findMaxLatency(ArrayRef<SUnit*> ReadySUs
 // resource index, or zero if the zone is issue limited.
 unsigned ConvergingScheduler::SchedBoundary::
 getOtherResourceCount(unsigned &OtherCritIdx) {
+  OtherCritIdx = 0;
   if (!SchedModel->hasInstrSchedModel())
     return 0;
 
@@ -1600,7 +1601,6 @@ getOtherResourceCount(unsigned &OtherCri
     + (RetiredMOps * SchedModel->getMicroOpFactor());
   DEBUG(dbgs() << "  " << Available.getName() << " + Remain MOps: "
         << OtherCritCount / SchedModel->getMicroOpFactor() << '\n');
-  OtherCritIdx = 0;
   for (unsigned PIdx = 1, PEnd = SchedModel->getNumProcResourceKinds();
        PIdx != PEnd; ++PIdx) {
     unsigned OtherCount = getResourceCount(PIdx) + Rem->RemainingCounts[PIdx];





More information about the llvm-commits mailing list