From: Chris Lattner Date: Thu, 28 Apr 2011 20:02:57 +0000 (+0000) Subject: improve comment. X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=1e4f44bb8aa363960f6f4018fc1dd11d8c39aae5;p=oota-llvm.git improve comment. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@130426 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Transforms/Scalar/GVN.cpp b/lib/Transforms/Scalar/GVN.cpp index abd76898cd3..efecb97de77 100644 --- a/lib/Transforms/Scalar/GVN.cpp +++ b/lib/Transforms/Scalar/GVN.cpp @@ -969,8 +969,13 @@ static Value *GetLoadValueForLoad(LoadInst *SrcVal, unsigned Offset, NewLoadSize*8-SrcVal->getType()->getPrimitiveSizeInBits()); RV = Builder.CreateTrunc(RV, SrcVal->getType()); SrcVal->replaceAllUsesWith(RV); + + // We would like to use gvn.markInstructionForDeletion here, but we can't + // because the load is already memoized into the leader map table that GVN + // tracks. It is potentially possible to remove the load from the table, + // but then there all of the operations based on it would need to be + // rehashed. Just leave the dead load around. gvn.getMemDep().removeInstruction(SrcVal); - //gvn.markInstructionForDeletion(SrcVal); SrcVal = NewLoad; }