[llvm] [InstCombine] Retain debug information on store to null instruction (PR #86105)

via llvm-commits llvm-commits at lists.llvm.org
Thu Mar 21 07:50:01 PDT 2024


llvmbot wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-debuginfo

Author: Abinaya Saravanan (quic-asaravan)

<details>
<summary>Changes</summary>

Call InsertNewInstWith() instead of InsertNewInstBefore() when creating "store to null" instruction

---
Full diff: https://github.com/llvm/llvm-project/pull/86105.diff


1 Files Affected:

- (modified) llvm/lib/Transforms/InstCombine/InstCombineInternal.h (+1-1) 


``````````diff
diff --git a/llvm/lib/Transforms/InstCombine/InstCombineInternal.h b/llvm/lib/Transforms/InstCombine/InstCombineInternal.h
index b9ad3a74007929..c998c727eba48b 100644
--- a/llvm/lib/Transforms/InstCombine/InstCombineInternal.h
+++ b/llvm/lib/Transforms/InstCombine/InstCombineInternal.h
@@ -461,7 +461,7 @@ class LLVM_LIBRARY_VISIBILITY InstCombinerImpl final
     auto *SI = new StoreInst(ConstantInt::getTrue(Ctx),
                              PoisonValue::get(PointerType::getUnqual(Ctx)),
                              /*isVolatile*/ false, Align(1));
-    InsertNewInstBefore(SI, InsertAt->getIterator());
+    InsertNewInstWith(SI, InsertAt->getIterator());
   }
 
   /// Combiner aware instruction erasure.

``````````

</details>


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


More information about the llvm-commits mailing list