diff options
author | Chris Lattner <sabre@nondot.org> | 2005-01-29 05:57:01 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2005-01-29 05:57:01 +0000 |
commit | b25abcb1fa2f1d0bf1bfb080b52b97ca421856a8 (patch) | |
tree | 5fbdfeac55bc7f44e1c7f73188b3fd6a0fcb5dfd /llvm/lib/Analysis/LoadValueNumbering.cpp | |
parent | 2295d0b7deb9da2e8131e005e7da1c337bdaec3d (diff) | |
download | bcm5719-llvm-b25abcb1fa2f1d0bf1bfb080b52b97ca421856a8.tar.gz bcm5719-llvm-b25abcb1fa2f1d0bf1bfb080b52b97ca421856a8.zip |
If we see:
%A = alloca int
%V = load int* %A
value number %V to undef, not 0.
llvm-svn: 19905
Diffstat (limited to 'llvm/lib/Analysis/LoadValueNumbering.cpp')
-rw-r--r-- | llvm/lib/Analysis/LoadValueNumbering.cpp | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/llvm/lib/Analysis/LoadValueNumbering.cpp b/llvm/lib/Analysis/LoadValueNumbering.cpp index 67d675f40bc..d69f83e8a73 100644 --- a/llvm/lib/Analysis/LoadValueNumbering.cpp +++ b/llvm/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; } } |