mirror of
https://github.com/RPCSX/llvm.git
synced 2024-11-26 05:00:26 +00:00
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
This commit is contained in:
parent
6cfbd62680
commit
2652da6af9
@ -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;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user