[llvm-commits] [llvm] r67194 - in /llvm/trunk/lib/Transforms: Scalar/ScalarReplAggregates.cpp Utils/Local.cpp

Zhou Sheng zhousheng00 at gmail.com
Wed Mar 18 03:13:26 PDT 2009


Author: sheng
Date: Wed Mar 18 05:13:08 2009
New Revision: 67194

URL: http://llvm.org/viewvc/llvm-project?rev=67194&view=rev
Log:
Revert my previous change on Local.cpp, instead, fix the bug on scalarrepl.
If the instruction has no users, it is also not only used by debug info 
and should not be deleted.

Modified:
    llvm/trunk/lib/Transforms/Scalar/ScalarReplAggregates.cpp
    llvm/trunk/lib/Transforms/Utils/Local.cpp

Modified: llvm/trunk/lib/Transforms/Scalar/ScalarReplAggregates.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/ScalarReplAggregates.cpp?rev=67194&r1=67193&r2=67194&view=diff

==============================================================================
--- llvm/trunk/lib/Transforms/Scalar/ScalarReplAggregates.cpp (original)
+++ llvm/trunk/lib/Transforms/Scalar/ScalarReplAggregates.cpp Wed Mar 18 05:13:08 2009
@@ -1223,7 +1223,7 @@
       CleanupGEP(GEPI);
     else if (Instruction *I = dyn_cast<Instruction>(U)) {
       SmallVector<DbgInfoIntrinsic *, 2> DbgInUses;
-      if (OnlyUsedByDbgInfoIntrinsics(I, &DbgInUses)) {
+      if (!I->use_empty() && OnlyUsedByDbgInfoIntrinsics(I, &DbgInUses)) {
         // Safe to remove debug info uses.
         while (!DbgInUses.empty()) {
           DbgInfoIntrinsic *DI = DbgInUses.back(); DbgInUses.pop_back();

Modified: llvm/trunk/lib/Transforms/Utils/Local.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Utils/Local.cpp?rev=67194&r1=67193&r2=67194&view=diff

==============================================================================
--- llvm/trunk/lib/Transforms/Utils/Local.cpp (original)
+++ llvm/trunk/lib/Transforms/Utils/Local.cpp Wed Mar 18 05:13:08 2009
@@ -262,9 +262,6 @@
   if (DbgInUses)
     DbgInUses->clear();
 
-  if (I->use_empty())
-    return false;
-
   for (Value::use_iterator UI = I->use_begin(), UE = I->use_end(); UI != UE; 
        ++UI) {
     if (DbgInfoIntrinsic *DI = dyn_cast<DbgInfoIntrinsic>(*UI)) {





More information about the llvm-commits mailing list