mirror of
https://github.com/RPCS3/llvm.git
synced 2025-01-11 06:56:12 +00:00
Fix bug: IPConstantProp/deadarg.ll
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17679 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
1f7893fe05
commit
3e062eacab
@ -113,9 +113,9 @@ bool IPCP::processFunction(Function &F) {
|
|||||||
bool MadeChange = false;
|
bool MadeChange = false;
|
||||||
for (unsigned i = 0, e = ArgumentConstants.size(); i != e; ++i, ++AI)
|
for (unsigned i = 0, e = ArgumentConstants.size(); i != e; ++i, ++AI)
|
||||||
// Do we have a constant argument!?
|
// Do we have a constant argument!?
|
||||||
if (!ArgumentConstants[i].second && !AI->use_empty()) {
|
if (!ArgumentConstants[i].second) {
|
||||||
assert(ArgumentConstants[i].first && "Unknown constant value!");
|
|
||||||
Value *V = ArgumentConstants[i].first;
|
Value *V = ArgumentConstants[i].first;
|
||||||
|
if (V == 0) V = UndefValue::get(AI->getType());
|
||||||
AI->replaceAllUsesWith(V);
|
AI->replaceAllUsesWith(V);
|
||||||
++NumArgumentsProped;
|
++NumArgumentsProped;
|
||||||
MadeChange = true;
|
MadeChange = true;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user