[llvm] 48a1db6 - [Mips] Avoid RegScavenger::forward in Mips16InstrInfo

Jay Foad via llvm-commits llvm-commits at lists.llvm.org
Tue May 23 03:27:15 PDT 2023


Author: Jay Foad
Date: 2023-05-23T11:24:47+01:00
New Revision: 48a1db6a1b8401f61b0d87c261453dd38e8dbc43

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

LOG: [Mips] Avoid RegScavenger::forward in Mips16InstrInfo

RegScavenger::backward is preferred because it does not rely on accurate
kill flags.

Differential Revision: https://reviews.llvm.org/D150557

Added: 
    

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

Removed: 
    


################################################################################
diff  --git a/llvm/lib/Target/Mips/Mips16InstrInfo.cpp b/llvm/lib/Target/Mips/Mips16InstrInfo.cpp
index 47bab9fd7f5ae..20185e83286dd 100644
--- a/llvm/lib/Target/Mips/Mips16InstrInfo.cpp
+++ b/llvm/lib/Target/Mips/Mips16InstrInfo.cpp
@@ -340,8 +340,8 @@ unsigned Mips16InstrInfo::loadImmediate(unsigned FrameReg, int64_t Imm,
   int Reg =0;
   int SpReg = 0;
 
-  rs.enterBasicBlock(MBB);
-  rs.forward(II);
+  rs.enterBasicBlockEnd(MBB);
+  rs.backward(II);
   //
   // We need to know which registers can be used, in the case where there
   // are not enough free registers. We exclude all registers that


        


More information about the llvm-commits mailing list