1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-20 19:42:54 +02:00

Fix a crash while promoting a value out of a loop from a global variable

when using ds-aa

llvm-svn: 20802
This commit is contained in:
Chris Lattner 2005-03-24 04:22:04 +00:00
parent 586f97a8b6
commit 120bfecc01
2 changed files with 20 additions and 2 deletions

View File

@ -527,5 +527,14 @@ void BUDataStructures::copyValue(Value *From, Value *To) {
return;
}
assert(!isa<GlobalVariable>(From) && "Do not know how to copy GV's yet!");
if (const Function *F = getFnForValue(To)) {
DSGraph &G = getDSGraph(*F);
G.getScalarMap().copyScalarIfExists(From, To);
return;
}
std::cerr << *From;
std::cerr << *To;
assert(0 && "Do not know how to copy this yet!");
abort();
}

View File

@ -468,5 +468,14 @@ void TDDataStructures::copyValue(Value *From, Value *To) {
return;
}
assert(!isa<GlobalVariable>(From) && "Do not know how to copy GV's yet!");
if (const Function *F = getFnForValue(To)) {
DSGraph &G = getDSGraph(*F);
G.getScalarMap().copyScalarIfExists(From, To);
return;
}
std::cerr << *From;
std::cerr << *To;
assert(0 && "Do not know how to copy this yet!");
abort();
}