diff --git a/llvm/lib/Transforms/Scalar/CorrelatedValuePropagation.cpp b/llvm/lib/Transforms/Scalar/CorrelatedValuePropagation.cpp --- a/llvm/lib/Transforms/Scalar/CorrelatedValuePropagation.cpp +++ b/llvm/lib/Transforms/Scalar/CorrelatedValuePropagation.cpp @@ -961,7 +961,8 @@ ++NumAShrsConverted; auto *BO = BinaryOperator::CreateLShr(SDI->getOperand(0), SDI->getOperand(1), - SDI->getName(), SDI); + "", SDI); + BO->takeName(SDI); BO->setDebugLoc(SDI->getDebugLoc()); BO->setIsExact(SDI->isExact()); SDI->replaceAllUsesWith(BO); @@ -980,8 +981,8 @@ return false; ++NumSExt; - auto *ZExt = - CastInst::CreateZExtOrBitCast(Base, SDI->getType(), SDI->getName(), SDI); + auto *ZExt = CastInst::CreateZExtOrBitCast(Base, SDI->getType(), "", SDI); + ZExt->takeName(SDI); ZExt->setDebugLoc(SDI->getDebugLoc()); SDI->replaceAllUsesWith(ZExt); SDI->eraseFromParent();