summaryrefslogtreecommitdiffstats
path: root/llvm/lib
diff options
context:
space:
mode:
authorSam McCall <sam.mccall@gmail.com>2016-11-01 22:02:14 +0000
committerSam McCall <sam.mccall@gmail.com>2016-11-01 22:02:14 +0000
commit2a36eee4cadaebe39271cff9bef755e158043a9e (patch)
tree4e5196efdaf9141c2f7b1387bf1b411bf14e4e43 /llvm/lib
parenta6319b82cab41666ae3a65299887cec29f12027d (diff)
downloadbcm5719-llvm-2a36eee4cadaebe39271cff9bef755e158043a9e.tar.gz
bcm5719-llvm-2a36eee4cadaebe39271cff9bef755e158043a9e.zip
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 llvm-svn: 285757
Diffstat (limited to 'llvm/lib')
-rw-r--r--llvm/lib/CodeGen/MachineBlockPlacement.cpp1
1 files changed, 1 insertions, 0 deletions
diff --git a/llvm/lib/CodeGen/MachineBlockPlacement.cpp b/llvm/lib/CodeGen/MachineBlockPlacement.cpp
index b131bbcb3ae..7f7c3d38488 100644
--- a/llvm/lib/CodeGen/MachineBlockPlacement.cpp
+++ b/llvm/lib/CodeGen/MachineBlockPlacement.cpp
@@ -1599,6 +1599,7 @@ void MachineBlockPlacement::buildCFGChains() {
collectMustExecuteBBs();
// Build any loop-based chains.
+ PreferredLoopExit = nullptr;
for (MachineLoop *L : *MLI)
buildLoopChains(*L);
OpenPOWER on IntegriCloud