[PATCH] D136752: Take memset_inline into account in analyzeLoadFromClobberingMemInst

Guillaume Chatelet via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Oct 26 02:50:34 PDT 2022


This revision was landed with ongoing or failed builds.
This revision was automatically updated to reflect the committed changes.
Closed by commit rG1a726cfa8366: Take memset_inline into account in analyzeLoadFromClobberingMemInst (authored by gchatelet).

Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D136752

Files:
  llvm/lib/Transforms/Utils/VNCoercion.cpp


Index: llvm/lib/Transforms/Utils/VNCoercion.cpp
===================================================================
--- llvm/lib/Transforms/Utils/VNCoercion.cpp
+++ llvm/lib/Transforms/Utils/VNCoercion.cpp
@@ -356,9 +356,9 @@
 
   // If this is memset, we just need to see if the offset is valid in the size
   // of the memset..
-  if (MI->getIntrinsicID() == Intrinsic::memset) {
+  if (const auto *memset_inst = dyn_cast<MemSetInst>(MI)) {
     if (DL.isNonIntegralPointerType(LoadTy->getScalarType())) {
-      auto *CI = dyn_cast<ConstantInt>(cast<MemSetInst>(MI)->getValue());
+      auto *CI = dyn_cast<ConstantInt>(memset_inst->getValue());
       if (!CI || !CI->isZero())
         return -1;
     }


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D136752.470761.patch
Type: text/x-patch
Size: 709 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20221026/be8e5865/attachment.bin>


More information about the llvm-commits mailing list