[llvm-commits] [llvm] r130426 - /llvm/trunk/lib/Transforms/Scalar/GVN.cpp
Chris Lattner
sabre at nondot.org
Thu Apr 28 13:02:57 PDT 2011
Author: lattner
Date: Thu Apr 28 15:02:57 2011
New Revision: 130426
URL: http://llvm.org/viewvc/llvm-project?rev=130426&view=rev
Log:
improve comment.
Modified:
llvm/trunk/lib/Transforms/Scalar/GVN.cpp
Modified: llvm/trunk/lib/Transforms/Scalar/GVN.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/GVN.cpp?rev=130426&r1=130425&r2=130426&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/Scalar/GVN.cpp (original)
+++ llvm/trunk/lib/Transforms/Scalar/GVN.cpp Thu Apr 28 15:02:57 2011
@@ -969,8 +969,13 @@
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;
}
More information about the llvm-commits
mailing list