[llvm] [InstCombine] fix hwasan mistake in "remove dead loads" (PR #145057)

via llvm-commits llvm-commits at lists.llvm.org
Fri Jun 20 08:50:23 PDT 2025


llvmbot wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-llvm-transforms

Author: Jameson Nash (vtjnash)

<details>
<summary>Changes</summary>

Detected by CI after #<!-- -->143958.

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


1 Files Affected:

- (modified) llvm/lib/Transforms/InstCombine/InstructionCombining.cpp (+2-1) 


``````````diff
diff --git a/llvm/lib/Transforms/InstCombine/InstructionCombining.cpp b/llvm/lib/Transforms/InstCombine/InstructionCombining.cpp
index bcc73090277aa..74878bad61e2b 100644
--- a/llvm/lib/Transforms/InstCombine/InstructionCombining.cpp
+++ b/llvm/lib/Transforms/InstCombine/InstructionCombining.cpp
@@ -3490,8 +3490,9 @@ Instruction *InstCombinerImpl::visitAllocSite(Instruction &MI) {
           replaceInstUsesWith(*I, Result);
           eraseInstFromFunction(*I);
           Users[i] = nullptr; // Skip examining in the next loop.
+          continue;
         }
-        if (auto *MTI = dyn_cast<MemTransferInst>(I)) {
+        else if (auto *MTI = dyn_cast<MemTransferInst>(I)) {
           if (KnowInitZero && isRefSet(*Removable)) {
             IRBuilderBase::InsertPointGuard Guard(Builder);
             Builder.SetInsertPoint(MTI);

``````````

</details>


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


More information about the llvm-commits mailing list