new StoreInst(ConstantInt::getTrue(*Context),
UndefValue::get(Type::getInt1PtrTy(*Context)),
OldCall);
- if (!OldCall->use_empty())
- OldCall->replaceAllUsesWith(UndefValue::get(OldCall->getType()));
+ OldCall->replaceAllUsesWith(UndefValue::get(OldCall->getType()));
if (isa<CallInst>(OldCall)) // Not worth removing an invoke here.
return EraseInstFromFunction(*OldCall);
return 0;
UndefValue::get(Type::getInt1PtrTy(*Context)),
CS.getInstruction());
- if (!CS.getInstruction()->use_empty())
- CS.getInstruction()->
- replaceAllUsesWith(UndefValue::get(CS.getInstruction()->getType()));
+ CS.getInstruction()->
+ replaceAllUsesWith(UndefValue::get(CS.getInstruction()->getType()));
if (InvokeInst *II = dyn_cast<InvokeInst>(CS.getInstruction())) {
// Don't break the CFG, insert a dummy cond branch.
}
}
-
+
if (!Caller->use_empty())
Caller->replaceAllUsesWith(NV);
setCallingConv(cast<CallInst>(Caller)->getCallingConv());
cast<CallInst>(NewCaller)->setAttributes(NewPAL);
}
- if (Caller->getType() != Type::getVoidTy(*Context) && !Caller->use_empty())
+ if (Caller->getType() != Type::getVoidTy(*Context))
Caller->replaceAllUsesWith(NewCaller);
Caller->eraseFromParent();
Worklist.Remove(Caller);
++NumDeadInst;
MadeIRChange = true;
}
- if (!I->use_empty())
- I->replaceAllUsesWith(UndefValue::get(I->getType()));
+ I->replaceAllUsesWith(UndefValue::get(I->getType()));
I->eraseFromParent();
}
}
if (!isExitBlockDominatedByBlockInLoop(ExitBlocks[0], I.getParent())) {
// Instruction is not used, just delete it.
CurAST->deleteValue(&I);
- if (!I.use_empty()) // If I has users in unreachable blocks, eliminate.
- I.replaceAllUsesWith(UndefValue::get(I.getType()));
+ // If I has users in unreachable blocks, eliminate.
+ I.replaceAllUsesWith(UndefValue::get(I.getType()));
I.eraseFromParent();
} else {
// Move the instruction to the start of the exit block, after any PHI
} else if (ExitBlocks.empty()) {
// The instruction is actually dead if there ARE NO exit blocks.
CurAST->deleteValue(&I);
- if (!I.use_empty()) // If I has users in unreachable blocks, eliminate.
- I.replaceAllUsesWith(UndefValue::get(I.getType()));
+ // If I has users in unreachable blocks, eliminate.
+ I.replaceAllUsesWith(UndefValue::get(I.getType()));
I.eraseFromParent();
} else {
// Otherwise, if we have multiple exits, use the PromoteMem2Reg function to
// Anything that uses the instructions in this basic block should have their
// uses replaced with undefs.
- if (!I->use_empty())
- I->replaceAllUsesWith(UndefValue::get(I->getType()));
+ I->replaceAllUsesWith(UndefValue::get(I->getType()));
}
// If this is the edge to the header block for a loop, remove the loop and