[llvm-commits] [llvm] r94112 - /llvm/trunk/lib/Transforms/InstCombine/InstCombineLoadStoreAlloca.cpp

Victor Hernandez vhernandez at apple.com
Thu Jan 21 15:07:16 PST 2010


Author: hernande
Date: Thu Jan 21 17:07:15 2010
New Revision: 94112

URL: http://llvm.org/viewvc/llvm-project?rev=94112&view=rev
Log:
No need to look through bitcasts for DbgInfoIntrinsic

Modified:
    llvm/trunk/lib/Transforms/InstCombine/InstCombineLoadStoreAlloca.cpp

Modified: llvm/trunk/lib/Transforms/InstCombine/InstCombineLoadStoreAlloca.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/InstCombine/InstCombineLoadStoreAlloca.cpp?rev=94112&r1=94111&r2=94112&view=diff

==============================================================================
--- llvm/trunk/lib/Transforms/InstCombine/InstCombineLoadStoreAlloca.cpp (original)
+++ llvm/trunk/lib/Transforms/InstCombine/InstCombineLoadStoreAlloca.cpp Thu Jan 21 17:07:15 2010
@@ -406,12 +406,8 @@
   for (unsigned ScanInsts = 6; BBI != SI.getParent()->begin() && ScanInsts;
        --ScanInsts) {
     --BBI;
-    // Don't count debug info directives, lest they affect codegen,
-    // and we skip pointer-to-pointer bitcasts, which are NOPs.
-    // It is necessary for correctness to skip those that feed into a
-    // llvm.dbg.declare, as these are not present when debugging is off.
-    if (isa<DbgInfoIntrinsic>(BBI) ||
-        (isa<BitCastInst>(BBI) && isa<PointerType>(BBI->getType()))) {
+    // Don't count debug info directives, lest they affect codegen
+    if (isa<DbgInfoIntrinsic>(BBI)) {
       ScanInsts++;
       continue;
     }    
@@ -475,14 +471,12 @@
 
   
   // If this store is the last instruction in the basic block (possibly
-  // excepting debug info instructions and the pointer bitcasts that feed
-  // into them), and if the block ends with an unconditional branch, try
-  // to move it to the successor block.
+  // excepting debug info instructions), and if the block ends with an
+  // unconditional branch, try to move it to the successor block.
   BBI = &SI; 
   do {
     ++BBI;
-  } while (isa<DbgInfoIntrinsic>(BBI) ||
-           (isa<BitCastInst>(BBI) && isa<PointerType>(BBI->getType())));
+  } while (isa<DbgInfoIntrinsic>(BBI));
   if (BranchInst *BI = dyn_cast<BranchInst>(BBI))
     if (BI->isUnconditional())
       if (SimplifyStoreAtEndOfBlock(SI))
@@ -542,8 +536,7 @@
   if (OtherBr->isUnconditional()) {
     --BBI;
     // Skip over debugging info.
-    while (isa<DbgInfoIntrinsic>(BBI) ||
-           (isa<BitCastInst>(BBI) && isa<PointerType>(BBI->getType()))) {
+    while (isa<DbgInfoIntrinsic>(BBI)) {
       if (BBI==OtherBB->begin())
         return false;
       --BBI;





More information about the llvm-commits mailing list