[PATCH] D125281: [CVP] Preserve exact name when converting sext->zext and ashr->lshr.

Craig Topper via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue May 10 09:14:12 PDT 2022


This revision was landed with ongoing or failed builds.
This revision was automatically updated to reflect the committed changes.
Closed by commit rG4b36d9bde7ac: [CVP] Preserve exact name when converting sext->zext and ashr->lshr. (authored by craig.topper).

Changed prior to commit:
  https://reviews.llvm.org/D125281?vs=428241&id=428403#toc

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D125281/new/

https://reviews.llvm.org/D125281

Files:
  llvm/lib/Transforms/Scalar/CorrelatedValuePropagation.cpp


Index: llvm/lib/Transforms/Scalar/CorrelatedValuePropagation.cpp
===================================================================
--- llvm/lib/Transforms/Scalar/CorrelatedValuePropagation.cpp
+++ 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();


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D125281.428403.patch
Type: text/x-patch
Size: 984 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220510/ca66242f/attachment.bin>


More information about the llvm-commits mailing list