[llvm] [SPARC] Fix-forward #154950 by returning true if SP::V8BAR if handled (PR #162424)
Thurston Dang via llvm-commits
llvm-commits at lists.llvm.org
Tue Oct 7 22:04:04 PDT 2025
https://github.com/thurstond created https://github.com/llvm/llvm-project/pull/162424
Buildbot report: https://lab.llvm.org/buildbot/#/builders/24/builds/13433
Use-after-poison happens because after SP::V8BAR is handled, it erases MI, which should thereafter not be inspected by ExpandPostRA::run.
>From f400972de46f2dd6113784088102750e6273d2ea Mon Sep 17 00:00:00 2001
From: Thurston Dang <thurston at google.com>
Date: Wed, 8 Oct 2025 04:58:32 +0000
Subject: [PATCH] [SPARC] Fix-forward #154950 by returning true if SP::V8BAR if
handled
Buildbot report: https://lab.llvm.org/buildbot/#/builders/24/builds/13433
Use-after-poison happens because after SP::V8BAR is handled, it erases MI, which should thereafter not be
inspected by ExpandPostRA::run.
---
llvm/lib/Target/Sparc/SparcInstrInfo.cpp | 1 +
1 file changed, 1 insertion(+)
diff --git a/llvm/lib/Target/Sparc/SparcInstrInfo.cpp b/llvm/lib/Target/Sparc/SparcInstrInfo.cpp
index c0cd0176efa30..f66eb9dbee2dc 100644
--- a/llvm/lib/Target/Sparc/SparcInstrInfo.cpp
+++ b/llvm/lib/Target/Sparc/SparcInstrInfo.cpp
@@ -668,6 +668,7 @@ bool SparcInstrInfo::expandPostRAPseudo(MachineInstr &MI) const {
.addImm(-1);
MIBundleBuilder(MBB, InstSTBAR, InstLDSTUB);
MBB.erase(MI);
+ return true;
}
}
return false;
More information about the llvm-commits
mailing list