[PATCH] D26069: Fix uninitialized access in MachineBlockPlacement.

Sam McCall via llvm-commits llvm-commits at lists.llvm.org
Fri Oct 28 05:24:51 PDT 2016


sammccall created this revision.
sammccall added reviewers: bkramer, iteratee.
sammccall added a subscriber: llvm-commits.

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.


https://reviews.llvm.org/D26069

Files:
  lib/CodeGen/MachineBlockPlacement.cpp


Index: lib/CodeGen/MachineBlockPlacement.cpp
===================================================================
--- lib/CodeGen/MachineBlockPlacement.cpp
+++ lib/CodeGen/MachineBlockPlacement.cpp
@@ -1599,6 +1599,7 @@
   collectMustExecuteBBs();
 
   // Build any loop-based chains.
+  PreferredLoopExit = nullptr;
   for (MachineLoop *L : *MLI)
     buildLoopChains(*L);
 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D26069.76179.patch
Type: text/x-patch
Size: 375 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20161028/7de84888/attachment.bin>


More information about the llvm-commits mailing list