forked from OSchip/llvm-project
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:
parent
769203cb03
commit
12f1e007f7
|
@ -1517,6 +1517,7 @@ 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))) {
|
||||||
|
|
Loading…
Reference in New Issue