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

@ -1517,6 +1517,7 @@ bool SCCP::runOnFunction(Function &F) {
for (BasicBlock::iterator BI = BB->begin(), E = BB->end(); BI != E; ) {
Instruction *Inst = BI++;
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))) {