[llvm-commits] [llvm] r132290 - /llvm/trunk/lib/Transforms/IPO/GlobalOpt.cpp
Nick Lewycky
nicholas at mxc.ca
Sun May 29 12:33:36 PDT 2011
Author: nicholas
Date: Sun May 29 14:33:36 2011
New Revision: 132290
URL: http://llvm.org/viewvc/llvm-project?rev=132290&view=rev
Log:
Don't crash owhen ComputeLoadResult can't compute the result of the load.
Modified:
llvm/trunk/lib/Transforms/IPO/GlobalOpt.cpp
Modified: llvm/trunk/lib/Transforms/IPO/GlobalOpt.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/IPO/GlobalOpt.cpp?rev=132290&r1=132289&r2=132290&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/IPO/GlobalOpt.cpp (original)
+++ llvm/trunk/lib/Transforms/IPO/GlobalOpt.cpp Sun May 29 14:33:36 2011
@@ -2444,7 +2444,7 @@
Constant *Val = getVal(Values, MSI->getValue());
Constant *DestVal = ComputeLoadResult(getVal(Values, Ptr),
MutatedMemory);
- if (Val->isNullValue() && DestVal->isNullValue()) {
+ if (Val->isNullValue() && DestVal && DestVal->isNullValue()) {
// This memset is a no-op.
++CurInst;
continue;
More information about the llvm-commits
mailing list