[llvm-commits] [llvm] r85572 - /llvm/trunk/lib/CodeGen/BranchFolding.cpp

Dan Gohman gohman at apple.com
Thu Oct 29 19:13:27 PDT 2009


Author: djg
Date: Thu Oct 29 21:13:27 2009
New Revision: 85572

URL: http://llvm.org/viewvc/llvm-project?rev=85572&view=rev
Log:
Don't delete blocks which have their address taken.

Modified:
    llvm/trunk/lib/CodeGen/BranchFolding.cpp

Modified: llvm/trunk/lib/CodeGen/BranchFolding.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/BranchFolding.cpp?rev=85572&r1=85571&r2=85572&view=diff

==============================================================================
--- llvm/trunk/lib/CodeGen/BranchFolding.cpp (original)
+++ llvm/trunk/lib/CodeGen/BranchFolding.cpp Thu Oct 29 21:13:27 2009
@@ -881,8 +881,9 @@
   
   // If this block is empty, make everyone use its fall-through, not the block
   // explicitly.  Landing pads should not do this since the landing-pad table
-  // points to this block.
-  if (MBB->empty() && !MBB->isLandingPad()) {
+  // points to this block.  Blocks with their addresses taken shouldn't be
+  // optimized away.
+  if (MBB->empty() && !MBB->isLandingPad() && !MBB->hasAddressTaken()) {
     // Dead block?  Leave for cleanup later.
     if (MBB->pred_empty()) return MadeChange;
     





More information about the llvm-commits mailing list