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 769203cb03
commit 12f1e007f7
1 changed files with 4 additions and 2 deletions

View File

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