diff --git a/include/llvm/CodeGen/MachineModuleInfo.h b/include/llvm/CodeGen/MachineModuleInfo.h
index 2bf7f17..641f261 100644
--- a/include/llvm/CodeGen/MachineModuleInfo.h
+++ b/include/llvm/CodeGen/MachineModuleInfo.h
@@ -250,6 +250,11 @@ public:
   /// because the block may be accessed outside its containing function.
   MCSymbol *getAddrLabelSymbol(const BasicBlock *BB);
 
+  /// MachineBasicBlock is not a value, so we cannot use CallbackVH to know
+  /// when one is deleted. Instead, code that does it is expected to call
+  /// this method.
+  void updateForDeletedMachineBlock(const MachineBasicBlock *BB);
+
   /// getAddrLabelSymbolToEmit - Return the symbol to be used for the specified
   /// basic block when its address is taken.  If other blocks were RAUW'd to
   /// this one, we may have to emit them as well, return the whole set.
diff --git a/lib/CodeGen/MachineModuleInfo.cpp b/lib/CodeGen/MachineModuleInfo.cpp
index 80c4854..d155b92 100644
--- a/lib/CodeGen/MachineModuleInfo.cpp
+++ b/lib/CodeGen/MachineModuleInfo.cpp
@@ -94,6 +94,8 @@ public:
                                      std::vector<MCSymbol*> &Result);
 
   void UpdateForDeletedBlock(BasicBlock *BB);
+  void UpdateForDeletedMachineBlock(const MachineBasicBlock *BB);
+  void UpdateForDeletedBlockImpl(BasicBlock *BB, bool InCodegen);
   void UpdateForRAUWBlock(BasicBlock *Old, BasicBlock *New);
 };
 }
@@ -156,13 +158,32 @@ takeDeletedSymbolsForFunction(Function *F, std::vector<MCSymbol*> &Result) {
   DeletedAddrLabelsNeedingEmission.erase(I);
 }
 
+void
+MMIAddrLabelMap::UpdateForDeletedMachineBlock(const MachineBasicBlock *MBB) {
+  BasicBlock *BB = const_cast<BasicBlock*>(MBB->getBasicBlock());
+  UpdateForDeletedBlockImpl(BB, true);
+}
 
 void MMIAddrLabelMap::UpdateForDeletedBlock(BasicBlock *BB) {
+  UpdateForDeletedBlockImpl(BB, false);
+}
+
+void MMIAddrLabelMap::UpdateForDeletedBlockImpl(BasicBlock *BB,
+                                                bool InCodegen) {
   // If the block got deleted, there is no need for the symbol.  If the symbol
   // was already emitted, we can just forget about it, otherwise we need to
   // queue it up for later emission when the function is output.
   AddrLabelSymEntry Entry = AddrLabelSymbols[BB];
-  AddrLabelSymbols.erase(BB);
+
+  // If it is a machine basic block that got deleted, the IL level one
+  // will survive and we need to keep the entry in AddrLabelSymbols in
+  // case it gets used.
+  // If it is an IL level BB that is being deleted, it cannot possibly be
+  // used again and we must forget about it as the pointer will not be valid
+  // anymore.
+  if (!InCodegen)
+    AddrLabelSymbols.erase(BB);
+
   assert(!Entry.Symbols.isNull() && "Didn't have a symbol, why a callback?");
   BBCallbacks[Entry.Index] = 0;  // Clear the callback.
 
@@ -346,6 +367,13 @@ MCSymbol *MachineModuleInfo::getAddrLabelSymbol(const BasicBlock *BB) {
   return AddrLabelSymbols->getAddrLabelSymbol(const_cast<BasicBlock*>(BB));
 }
 
+void
+MachineModuleInfo::updateForDeletedMachineBlock(const MachineBasicBlock *MBB) {
+  const BasicBlock *BB = MBB->getBasicBlock();
+  getAddrLabelSymbol(BB);
+  AddrLabelSymbols->UpdateForDeletedMachineBlock(MBB);
+}
+
 /// getAddrLabelSymbolToEmit - Return the symbol to be used for the specified
 /// basic block when its address is taken.  If other blocks were RAUW'd to
 /// this one, we may have to emit them as well, return the whole set.
diff --git a/lib/CodeGen/TailDuplication.cpp b/lib/CodeGen/TailDuplication.cpp
index 3a6211a..d63c7d9 100644
--- a/lib/CodeGen/TailDuplication.cpp
+++ b/lib/CodeGen/TailDuplication.cpp
@@ -204,7 +204,7 @@ TailDuplicatePass::TailDuplicateAndUpdate(MachineBasicBlock *MBB,
   // TailBB's immediate successors are now successors of those predecessors
   // which duplicated TailBB. Add the predecessors as sources to the PHI
   // instructions.
-  bool isDead = MBB->pred_empty() && !MBB->hasAddressTaken();
+  bool isDead = MBB->pred_empty();
   if (PreRegAlloc)
     UpdateSuccessorsPHIs(MBB, isDead, TDBBs, Succs);
 
@@ -934,6 +934,9 @@ void TailDuplicatePass::RemoveDeadBlock(MachineBasicBlock *MBB) {
   while (!MBB->succ_empty())
     MBB->removeSuccessor(MBB->succ_end()-1);
 
+  if (MBB->hasAddressTaken())
+    MMI->updateForDeletedMachineBlock(MBB);
+
   // Remove the block.
   MBB->eraseFromParent();
 }
diff --git a/test/CodeGen/X86/pr11202.ll b/test/CodeGen/X86/pr11202.ll
new file mode 100644
index 0000000..f24ae1d
--- /dev/null
+++ b/test/CodeGen/X86/pr11202.ll
@@ -0,0 +1,19 @@
+; RUN: llc < %s -mtriple=x86_64-pc-linux | FileCheck %s
+
+@bb = constant [1 x i8*] [i8* blockaddress(@main, %l2)]
+
+define void @main() {
+entry:
+  br label %l1
+
+l1:                                               ; preds = %l2, %entry
+  %a = zext i1 false to i32
+  br label %l2
+
+l2:                                               ; preds = %l1
+  %b = zext i1 false to i32
+  br label %l1
+}
+
+; CHECK: .Ltmp0:                                 # Address taken block that was later removed
+; CHECK: .quad	.Ltmp0
diff --git a/test/CodeGen/X86/tail-dup-addr.ll b/test/CodeGen/X86/tail-dup-addr.ll
index c5a105c..2f93d34 100644
--- a/test/CodeGen/X86/tail-dup-addr.ll
+++ b/test/CodeGen/X86/tail-dup-addr.ll
@@ -1,9 +1,9 @@
 ; RUN: llc < %s -mtriple=x86_64-apple-darwin | FileCheck %s
 
-; Test that we don't drop a block that has its address taken.
+; Test that we print a dummy label when a bb is removed
 
+; CHECK: Ltmp0:                                  ## Address taken block that was later removed
 ; CHECK: Ltmp1:                                  ## Block address taken
-; CHECK: Ltmp2:                                  ## Block address taken
 
 @a = common global i32 0, align 4
 @p = common global i8* null, align 8
