Author: yingopq
Date: 2026-07-16T10:43:09+08:00
New Revision: fcef475c885c374f42e816669a9c8a82ee9d06fe

URL: 
https://github.com/llvm/llvm-project/commit/fcef475c885c374f42e816669a9c8a82ee9d06fe
DIFF: 
https://github.com/llvm/llvm-project/commit/fcef475c885c374f42e816669a9c8a82ee9d06fe.diff

LOG: Revert "[Mips] Did not put fake_use into delay slot (#201537)"

This reverts commit 071b86797f62e827bf18e83667b0d1875a5ee446.

Added: 
    

Modified: 
    llvm/lib/Target/Mips/MipsDelaySlotFiller.cpp

Removed: 
    llvm/test/CodeGen/Mips/fake-use.ll


################################################################################
diff  --git a/llvm/lib/Target/Mips/MipsDelaySlotFiller.cpp 
b/llvm/lib/Target/Mips/MipsDelaySlotFiller.cpp
index 7d7dac22520ea..bcfaa7cd2ed2d 100644
--- a/llvm/lib/Target/Mips/MipsDelaySlotFiller.cpp
+++ b/llvm/lib/Target/Mips/MipsDelaySlotFiller.cpp
@@ -854,17 +854,10 @@ bool MipsDelaySlotFiller::searchRange(MachineBasicBlock 
&MBB, IterTy Begin,
     IterTy CurrI = I;
     ++I;
     LLVM_DEBUG(dbgs() << DEBUG_TYPE ": checking instruction: "; CurrI->dump());
-
-    if (terminateSearch(*CurrI)) {
-      LLVM_DEBUG(dbgs() << DEBUG_TYPE ": should terminate search: ";
-                 CurrI->dump());
-      break;
-    }
-    // Skip debug and pseudo instructions.
+    // Skip debug value.
     // Instruction TargetOpcode::JUMP_TABLE_DEBUG_INFO is only used to note
     // jump table debug info.
-    if (CurrI->isDebugInstr() || CurrI->isJumpTableDebugInfo() ||
-        CurrI->isMetaInstruction()) {
+    if (CurrI->isDebugInstr() || CurrI->isJumpTableDebugInfo()) {
       LLVM_DEBUG(dbgs() << DEBUG_TYPE ": ignoring debug instruction: ";
                  CurrI->dump());
       continue;
@@ -878,6 +871,12 @@ bool MipsDelaySlotFiller::searchRange(MachineBasicBlock 
&MBB, IterTy Begin,
       continue;
     }
 
+    if (terminateSearch(*CurrI)) {
+      LLVM_DEBUG(dbgs() << DEBUG_TYPE ": should terminate search: ";
+                 CurrI->dump());
+      break;
+    }
+
     assert((!CurrI->isCall() && !CurrI->isReturn() && !CurrI->isBranch()) &&
            "Cannot put calls, returns or branches in delay slot.");
 

diff  --git a/llvm/test/CodeGen/Mips/fake-use.ll 
b/llvm/test/CodeGen/Mips/fake-use.ll
deleted file mode 100644
index c8c7f83624314..0000000000000
--- a/llvm/test/CodeGen/Mips/fake-use.ll
+++ /dev/null
@@ -1,15 +0,0 @@
-; RUN: llc -verify-machineinstrs -mtriple=mipsel-linux-gnu -mcpu=mips32r2 %s 
-o - | FileCheck %s
-
-define void @fake_use(ptr %aaaa) {
-; CHECK-LABEL: fake_use:
-; CHECK:       # %bb.0:    # %entry
-; CHECK-NEXT:              # fake_use: $a0 
-; CHECK-NEXT:    jr $ra 
-; CHECK-NEXT:    nop
-entry:
-  notail call void (...) @llvm.fake.use(ptr %aaaa)
-  ret void
-}
-
-declare void @llvm.fake.use(...)
-


        
_______________________________________________
llvm-branch-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits

Reply via email to