diff --git a/llvm/lib/CodeGen/CodeGenPrepare.cpp b/llvm/lib/CodeGen/CodeGenPrepare.cpp index 0cc9fb88b4293..12a668507fe65 100644 --- a/llvm/lib/CodeGen/CodeGenPrepare.cpp +++ b/llvm/lib/CodeGen/CodeGenPrepare.cpp @@ -4194,7 +4194,7 @@ class AddressingModeCombiner { /// `CommonValue` may be a placeholder inserted by us. /// If the placeholder is not used, we should remove this dead instruction. void eraseCommonValueIfDead() { - if (CommonValue && CommonValue->getNumUses() == 0) + if (CommonValue && CommonValue->use_empty()) if (Instruction *CommonInst = dyn_cast(CommonValue)) CommonInst->eraseFromParent(); }