diff options
author | Chris Lattner <sabre@nondot.org> | 2011-04-28 20:02:57 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2011-04-28 20:02:57 +0000 |
commit | 1e4f44bb8aa363960f6f4018fc1dd11d8c39aae5 (patch) | |
tree | 7b3c26d4fa7284e646486c6e1a08822564045902 /lib/Transforms | |
parent | 81199d2545112fcff5a6e055eb71e2a4950192a7 (diff) |
improve comment.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@130426 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Transforms')
-rw-r--r-- | lib/Transforms/Scalar/GVN.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/lib/Transforms/Scalar/GVN.cpp b/lib/Transforms/Scalar/GVN.cpp index abd76898cd..efecb97de7 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; } |