summaryrefslogtreecommitdiffstats
path: root/llvm/lib
diff options
context:
space:
mode:
authorEric Christopher <echristo@gmail.com>2016-11-01 22:15:50 +0000
committerEric Christopher <echristo@gmail.com>2016-11-01 22:15:50 +0000
commit690f8e587e52dd0eba9b237b1cf1e7f1f0ce3984 (patch)
tree163fb2a863a18e3fbc0b218bdf8062207dd94b45 /llvm/lib
parent2a36eee4cadaebe39271cff9bef755e158043a9e (diff)
downloadbcm5719-llvm-690f8e587e52dd0eba9b237b1cf1e7f1f0ce3984.tar.gz
bcm5719-llvm-690f8e587e52dd0eba9b237b1cf1e7f1f0ce3984.zip
Move the initialization of PreferredLoopExit into runOnMachineFunction to be near the other function specific initializations.
llvm-svn: 285758
Diffstat (limited to 'llvm/lib')
-rw-r--r--llvm/lib/CodeGen/MachineBlockPlacement.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/llvm/lib/CodeGen/MachineBlockPlacement.cpp b/llvm/lib/CodeGen/MachineBlockPlacement.cpp
index 7f7c3d38488..2f43d2c06d5 100644
--- a/llvm/lib/CodeGen/MachineBlockPlacement.cpp
+++ b/llvm/lib/CodeGen/MachineBlockPlacement.cpp
@@ -1479,7 +1479,6 @@ void MachineBlockPlacement::buildLoopChains(MachineLoop &L) {
// If we selected just the header for the loop top, look for a potentially
// profitable exit block in the event that rotating the loop can eliminate
// branches by placing an exit edge at the bottom.
- PreferredLoopExit = nullptr;
if (!RotateLoopWithProfile && LoopTop == L.getHeader())
PreferredLoopExit = findBestLoopExit(L, LoopBlockSet);
@@ -1984,6 +1983,11 @@ bool MachineBlockPlacement::runOnMachineFunction(MachineFunction &MF) {
TII = MF.getSubtarget().getInstrInfo();
TLI = MF.getSubtarget().getTargetLowering();
MDT = &getAnalysis<MachineDominatorTree>();
+
+ // Initialize PreferredLoopExit to nullptr here since it may never be set if
+ // there are no MachineLoops.
+ PreferredLoopExit = nullptr;
+
if (TailDupPlacement) {
unsigned TailDupSize = TailDuplicatePlacementThreshold;
if (MF.getFunction()->optForSize())
OpenPOWER on IntegriCloud