[llvm] [InstCombine] Fold length-one memset with variable fillFold length-one memset with variable fill (PR #217224)

via llvm-commits llvm-commits at lists.llvm.org
Wed Aug 19 02:52:38 PDT 2026


================
@@ -221,6 +221,12 @@ Instruction *InstCombinerImpl::SimplifyAnyMemTransfer(AnyMemTransferInst *MI) {
 }
 
 Instruction *InstCombinerImpl::SimplifyAnyMemSet(AnyMemSetInst *MI) {
+  ConstantInt *LenC = dyn_cast<ConstantInt>(MI->getLength());
+  Value *Fill = MI->getValue();
+
+  if (MI->isVolatile())
+    return nullptr;
----------------
hsnaveen2u wrote:

Thanks for the review.
Done. I restored the original volatile handling and removed the volatile-specific test.

https://github.com/llvm/llvm-project/pull/217224


More information about the llvm-commits mailing list