[llvm] r285757 - Fix uninitialized access in MachineBlockPlacement.

Sam McCall via llvm-commits llvm-commits at lists.llvm.org
Tue Nov 1 15:02:15 PDT 2016


Author: sammccall
Date: Tue Nov  1 17:02:14 2016
New Revision: 285757

URL: http://llvm.org/viewvc/llvm-project?rev=285757&view=rev
Log:
Fix uninitialized access in MachineBlockPlacement.

Summary:
Currently PreferredLoopExit is set only in buildLoopChains, which is
never called if there are no MachineLoops.

MSan is currently broken by this:
http://lab.llvm.org:8011/builders/sanitizer-x86_64-linux-fast/builds/145/steps/check-llvm%20msan/logs/stdio

This is a naive fix to get things green again. iteratee: you may have a better fix.

This change will also mean PreferredLoopExit will not carry over if
buildCFGChains() is called a second time in runOnMachineFunction, this
appears to be the right thing.

Reviewers: bkramer, iteratee, echristo

Subscribers: llvm-commits

Differential Revision: https://reviews.llvm.org/D26069

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

Modified: llvm/trunk/lib/CodeGen/MachineBlockPlacement.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/MachineBlockPlacement.cpp?rev=285757&r1=285756&r2=285757&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/MachineBlockPlacement.cpp (original)
+++ llvm/trunk/lib/CodeGen/MachineBlockPlacement.cpp Tue Nov  1 17:02:14 2016
@@ -1599,6 +1599,7 @@ void MachineBlockPlacement::buildCFGChai
   collectMustExecuteBBs();
 
   // Build any loop-based chains.
+  PreferredLoopExit = nullptr;
   for (MachineLoop *L : *MLI)
     buildLoopChains(*L);
 




More information about the llvm-commits mailing list