[llvm] [InstCombine] fix hwasan mistake in "remove dead loads" (PR #145057)
Jameson Nash via llvm-commits
llvm-commits at lists.llvm.org
Fri Jun 20 09:00:21 PDT 2025
https://github.com/vtjnash updated https://github.com/llvm/llvm-project/pull/145057
>From 02415d5c33f4da46035938d296eb7cd6e87a0136 Mon Sep 17 00:00:00 2001
From: Jameson Nash <vtjnash at gmail.com>
Date: Fri, 20 Jun 2025 15:47:39 +0000
Subject: [PATCH] [InstCombine] fix hwasan mistake in "remove dead loads"
Detected by CI after #143958.
---
llvm/lib/Transforms/InstCombine/InstructionCombining.cpp | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/llvm/lib/Transforms/InstCombine/InstructionCombining.cpp b/llvm/lib/Transforms/InstCombine/InstructionCombining.cpp
index bcc73090277aa..e4ae119a30499 100644
--- a/llvm/lib/Transforms/InstCombine/InstructionCombining.cpp
+++ b/llvm/lib/Transforms/InstCombine/InstructionCombining.cpp
@@ -3490,8 +3490,8 @@ Instruction *InstCombinerImpl::visitAllocSite(Instruction &MI) {
replaceInstUsesWith(*I, Result);
eraseInstFromFunction(*I);
Users[i] = nullptr; // Skip examining in the next loop.
- }
- if (auto *MTI = dyn_cast<MemTransferInst>(I)) {
+ continue;
+ } else if (auto *MTI = dyn_cast<MemTransferInst>(I)) {
if (KnowInitZero && isRefSet(*Removable)) {
IRBuilderBase::InsertPointGuard Guard(Builder);
Builder.SetInsertPoint(MTI);
More information about the llvm-commits
mailing list