[llvm] 30e200b - [RISCV] Remove forward declaration and unused argument. NFC

Luke Lau via llvm-commits llvm-commits at lists.llvm.org
Tue Dec 12 00:51:50 PST 2023


Author: Luke Lau
Date: 2023-12-12T17:51:35+09:00
New Revision: 30e200b81e2feb1541d8578913d959a2c6e31762

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

LOG: [RISCV] Remove forward declaration and unused argument. NFC

Added: 
    

Modified: 
    llvm/lib/Target/RISCV/RISCVInsertVSETVLI.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/Target/RISCV/RISCVInsertVSETVLI.cpp b/llvm/lib/Target/RISCV/RISCVInsertVSETVLI.cpp
index 723af1182cb79f..096d7ce0cb64df 100644
--- a/llvm/lib/Target/RISCV/RISCVInsertVSETVLI.cpp
+++ b/llvm/lib/Target/RISCV/RISCVInsertVSETVLI.cpp
@@ -1040,9 +1040,23 @@ bool RISCVInsertVSETVLI::needVSETVLI(const MachineInstr &MI,
   return true;
 }
 
+// If we don't use LMUL or the SEW/LMUL ratio, then adjust LMUL so that we
+// maintain the SEW/LMUL ratio. This allows us to eliminate VL toggles in more
+// places.
 static VSETVLIInfo adjustIncoming(VSETVLIInfo PrevInfo, VSETVLIInfo NewInfo,
-                                  DemandedFields &Demanded,
-                                  const MachineRegisterInfo *MRI);
+                                  DemandedFields &Demanded) {
+  VSETVLIInfo Info = NewInfo;
+
+  if (!Demanded.LMUL && !Demanded.SEWLMULRatio && PrevInfo.isValid() &&
+      !PrevInfo.isUnknown()) {
+    if (auto NewVLMul = RISCVVType::getSameRatioLMUL(
+            PrevInfo.getSEW(), PrevInfo.getVLMUL(), Info.getSEW()))
+      Info.setVLMul(*NewVLMul);
+    Demanded.LMUL = true;
+  }
+
+  return Info;
+}
 
 // Given an incoming state reaching MI, minimally modifies that state so that it
 // is compatible with MI. The resulting state is guaranteed to be semantically
@@ -1063,8 +1077,7 @@ void RISCVInsertVSETVLI::transferBefore(VSETVLIInfo &Info,
     Info = NewInfo;
 
   DemandedFields Demanded = getDemanded(MI, MRI, ST);
-  const VSETVLIInfo IncomingInfo =
-      adjustIncoming(PrevInfo, NewInfo, Demanded, MRI);
+  const VSETVLIInfo IncomingInfo = adjustIncoming(PrevInfo, NewInfo, Demanded);
 
   // If MI only demands that VL has the same zeroness, we only need to set the
   // AVL if the zeroness 
diff ers.  This removes a vsetvli entirely if the types
@@ -1098,25 +1111,6 @@ void RISCVInsertVSETVLI::transferBefore(VSETVLIInfo &Info,
   }
 }
 
-static VSETVLIInfo adjustIncoming(VSETVLIInfo PrevInfo, VSETVLIInfo NewInfo,
-                                  DemandedFields &Demanded,
-                                  const MachineRegisterInfo *MRI) {
-  VSETVLIInfo Info = NewInfo;
-
-  // If we don't use LMUL or the SEW/LMUL ratio, then adjust LMUL so that we
-  // maintain the SEW/LMUL ratio. This allows us to eliminate VL toggles in more
-  // places.
-  if (!Demanded.LMUL && !Demanded.SEWLMULRatio && PrevInfo.isValid() &&
-      !PrevInfo.isUnknown()) {
-    if (auto NewVLMul = RISCVVType::getSameRatioLMUL(
-            PrevInfo.getSEW(), PrevInfo.getVLMUL(), Info.getSEW()))
-      Info.setVLMul(*NewVLMul);
-    Demanded.LMUL = true;
-  }
-
-  return Info;
-}
-
 // Given a state with which we evaluated MI (see transferBefore above for why
 // this might be 
diff erent that the state MI requested), modify the state to
 // reflect the changes MI might make.


        


More information about the llvm-commits mailing list