[llvm] [Mips] Fix mfhi/mflo hazard miscompilation about div and mult (PR #91449)

via llvm-commits llvm-commits at lists.llvm.org
Sat Sep 14 00:20:26 PDT 2024


================
@@ -766,17 +769,40 @@ bool MipsBranchExpansion::handleSlot(Pred Predicate, Safe SafeInSlot) {
         if (std::next(Iit) == FI->end() ||
             std::next(Iit)->getOpcode() != Mips::NOP) {
           Changed = true;
-          TII->insertNop(*(I->getParent()), std::next(I), I->getDebugLoc())
-              ->bundleWithPred();
-          NumInsertedNops++;
+          if (Predicate(*I) ||
----------------
yingopq wrote:

Updated. I added a new function which makes it simpler.

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


More information about the llvm-commits mailing list