summaryrefslogtreecommitdiff
path: root/lib/Analysis/LoadValueNumbering.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2005-01-29 05:57:01 +0000
committerChris Lattner <sabre@nondot.org>2005-01-29 05:57:01 +0000
commit2652da6af93360e5e5598bc3ca105439a7a8e1a9 (patch)
tree6950992d22085a4f1e6f5ccc001b8cd54f5fada5 /lib/Analysis/LoadValueNumbering.cpp
parent6cfbd626806875214291d44ea4f9064cc1479623 (diff)
downloadllvm-2652da6af93360e5e5598bc3ca105439a7a8e1a9.tar.gz
llvm-2652da6af93360e5e5598bc3ca105439a7a8e1a9.tar.bz2
llvm-2652da6af93360e5e5598bc3ca105439a7a8e1a9.tar.xz
If we see:
%A = alloca int %V = load int* %A value number %V to undef, not 0. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19905 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Analysis/LoadValueNumbering.cpp')
-rw-r--r--lib/Analysis/LoadValueNumbering.cpp7
1 files changed, 3 insertions, 4 deletions
diff --git a/lib/Analysis/LoadValueNumbering.cpp b/lib/Analysis/LoadValueNumbering.cpp
index 67d675f40b..d69f83e8a7 100644
--- a/lib/Analysis/LoadValueNumbering.cpp
+++ b/lib/Analysis/LoadValueNumbering.cpp
@@ -22,7 +22,7 @@
//===----------------------------------------------------------------------===//
#include "llvm/Analysis/LoadValueNumbering.h"
-#include "llvm/Constant.h"
+#include "llvm/Constants.h"
#include "llvm/Function.h"
#include "llvm/Instructions.h"
#include "llvm/Pass.h"
@@ -357,11 +357,10 @@ void LoadVN::getEqualNumberNodes(Value *V,
Instrs.erase(I);
} else if (AllocationInst *AI = dyn_cast<AllocationInst>(I)) {
// If we run into an allocation of the value being loaded, then the
- // contenxt are not initialized. We can return any value, so we will
- // return a zero.
+ // contents are not initialized.
if (Allocations.count(AI)) {
LoadInvalidatedInBBBefore = true;
- RetVals.push_back(Constant::getNullValue(LI->getType()));
+ RetVals.push_back(UndefValue::get(LI->getType()));
break;
}
}