summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms/Utils/BasicBlockUtils.cpp
diff options
context:
space:
mode:
authorAlina Sbirlea <asbirlea@google.com>2019-06-04 18:45:15 +0000
committerAlina Sbirlea <asbirlea@google.com>2019-06-04 18:45:15 +0000
commitbfceed49cec1ec3f6b846974c96e49e00bd8c36f (patch)
tree421f130c871d80e6f3d09956c5c19293909d4974 /llvm/lib/Transforms/Utils/BasicBlockUtils.cpp
parent7dcd73340ba51943b935064db038e526d4596e6e (diff)
downloadbcm5719-llvm-bfceed49cec1ec3f6b846974c96e49e00bd8c36f.tar.gz
bcm5719-llvm-bfceed49cec1ec3f6b846974c96e49e00bd8c36f.zip
[Utils] Clean another duplicated util method.
Summary: Following the cleanup in D48202, method foldBlockIntoPredecessor has the same behavior. Replace its uses with MergeBlockIntoPredecessor. Remove foldBlockIntoPredecessor. Reviewers: chandlerc, dmgreen Subscribers: jlebar, javed.absar, zzheng, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D62751 llvm-svn: 362538
Diffstat (limited to 'llvm/lib/Transforms/Utils/BasicBlockUtils.cpp')
-rw-r--r--llvm/lib/Transforms/Utils/BasicBlockUtils.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/llvm/lib/Transforms/Utils/BasicBlockUtils.cpp b/llvm/lib/Transforms/Utils/BasicBlockUtils.cpp
index aa7b933022c..842434cca15 100644
--- a/llvm/lib/Transforms/Utils/BasicBlockUtils.cpp
+++ b/llvm/lib/Transforms/Utils/BasicBlockUtils.cpp
@@ -38,6 +38,8 @@
#include "llvm/IR/Value.h"
#include "llvm/IR/ValueHandle.h"
#include "llvm/Support/Casting.h"
+#include "llvm/Support/Debug.h"
+#include "llvm/Support/raw_ostream.h"
#include "llvm/Transforms/Utils/Local.h"
#include <cassert>
#include <cstdint>
@@ -47,6 +49,8 @@
using namespace llvm;
+#define DEBUG_TYPE "basicblock-utils"
+
void llvm::DetatchDeadBlocks(
ArrayRef<BasicBlock *> BBs,
SmallVectorImpl<DominatorTree::UpdateType> *Updates,
@@ -190,6 +194,9 @@ bool llvm::MergeBlockIntoPredecessor(BasicBlock *BB, DomTreeUpdater *DTU,
if (IncValue == &PN)
return false;
+ LLVM_DEBUG(dbgs() << "Merging: " << BB->getName() << " into "
+ << PredBB->getName() << "\n");
+
// Begin by getting rid of unneeded PHIs.
SmallVector<AssertingVH<Value>, 4> IncomingValues;
if (isa<PHINode>(BB->front())) {
OpenPOWER on IntegriCloud