mirror of
https://github.com/RPCS3/llvm.git
synced 2025-03-03 08:07:51 +00:00
Fix bug where use still existed in dead code
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5824 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
c65b104309
commit
085c801dee
@ -168,6 +168,8 @@ void PromoteMem2Reg::run() {
|
||||
//
|
||||
while (!I->use_empty()) {
|
||||
Instruction *U = cast<Instruction>(I->use_back());
|
||||
if (!U->use_empty()) // If uses remain in dead code segment...
|
||||
U->replaceAllUsesWith(Constant::getNullValue(U->getType()));
|
||||
U->getParent()->getInstList().erase(U);
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user