1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-21 20:12:56 +02:00

Don't replace multiple result of calls with undef,

sccp tracks getresult values, not call values in this
case.

llvm-svn: 50202
This commit is contained in:
Chris Lattner 2008-04-24 00:19:54 +00:00
parent 8c6e641cf4
commit 10ffed0ed0

View File

@ -1516,7 +1516,8 @@ bool SCCP::runOnFunction(Function &F) {
//
for (BasicBlock::iterator BI = BB->begin(), E = BB->end(); BI != E; ) {
Instruction *Inst = BI++;
if (Inst->getType() == Type::VoidTy ||
if (Inst->getType() == Type::VoidTy ||
isa<StructType>(Inst->getType()) ||
isa<TerminatorInst>(Inst))
continue;
@ -1692,7 +1693,8 @@ bool IPSCCP::runOnModule(Module &M) {
} else {
for (BasicBlock::iterator BI = BB->begin(), E = BB->end(); BI != E; ) {
Instruction *Inst = BI++;
if (Inst->getType() != Type::VoidTy) {
if (Inst->getType() != Type::VoidTy &&
!isa<StructType>(Inst->getType())) {
LatticeVal &IV = Values[Inst];
if (IV.isConstant() ||
(IV.isUndefined() && !isa<TerminatorInst>(Inst))) {