diff --git a/llvm/lib/Transforms/ObjCARC/ObjCARCOpts.cpp b/llvm/lib/Transforms/ObjCARC/ObjCARCOpts.cpp --- a/llvm/lib/Transforms/ObjCARC/ObjCARCOpts.cpp +++ b/llvm/lib/Transforms/ObjCARC/ObjCARCOpts.cpp @@ -676,6 +676,7 @@ // Delete the RV pair, starting with the AutoreleaseRV. AutoreleaseRV->replaceAllUsesWith( cast(AutoreleaseRV)->getArgOperand(0)); + Changed = true; EraseInstruction(AutoreleaseRV); if (Class == ARCInstKind::RetainRV) { // AutoreleaseRV and RetainRV cancel out. Delete the RetainRV. @@ -915,6 +916,7 @@ if (!Inst->getType()->isVoidTy()) Inst->replaceAllUsesWith(Inst->getOperand(0)); Inst->eraseFromParent(); + Changed = true; return; } @@ -2052,6 +2054,7 @@ // Delete objc_loadWeak calls with no users. if (Class == ARCInstKind::LoadWeak && Inst->use_empty()) { Inst->eraseFromParent(); + Changed = true; continue; }