When removing a value from GVN's leaders list, don't drop the Next pointer in a corne...
authorOwen Anderson <resistor@mac.com>
Tue, 4 Jan 2011 19:10:54 +0000 (19:10 +0000)
committerOwen Anderson <resistor@mac.com>
Tue, 4 Jan 2011 19:10:54 +0000 (19:10 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122822 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Transforms/Scalar/GVN.cpp

index cf82ebc027f805ae97fb483018d9e7761b6dedb2..c78c4c308cbe92e4af1e037a48f1b883a5d272ee 100644 (file)
@@ -466,6 +466,7 @@ namespace {
           NumberTableEntry* Next = Curr->Next;
           Curr->Val = Next->Val;
           Curr->BB = Next->BB;
+          Curr->Next = Next->Next;
         }
       }
     }
@@ -1693,7 +1694,7 @@ bool GVN::processInstruction(Instruction *I,
     
     return false;
   }
-
+  
   uint32_t NextNum = VN.getNextUnusedValueNumber();
   unsigned Num = VN.lookup_or_add(I);