[llvm] Prevent undefined behavior caused by combination of branch and load delay slots on MIPS1 (PR #185427)

via llvm-commits llvm-commits at lists.llvm.org
Wed Apr 8 14:02:30 PDT 2026


================
@@ -1011,6 +1109,53 @@ bool MipsDelaySlotFiller::delayHasHazard(const MachineInstr &Candidate,
   HasHazard |= IM.hasHazard(Candidate);
   HasHazard |= RegDU.update(Candidate, 0, Candidate.getNumOperands());
 
+  // This only matters for MIPS1 and only if we do not have a hazard already
+  if (!STI.hasMips2() && !HasHazard) {
----------------
JaberwockySeamonstah wrote:

Updated and re-run test. 
Please resolve the comment if you are happy with the change.

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


More information about the llvm-commits mailing list