Skip to content

Commit 30e200b

Browse files
committed
[RISCV] Remove forward declaration and unused argument. NFC
1 parent 90d8241 commit 30e200b

File tree

1 file changed

+17
-23
lines changed

1 file changed

+17
-23
lines changed

llvm/lib/Target/RISCV/RISCVInsertVSETVLI.cpp

Lines changed: 17 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1040,9 +1040,23 @@ bool RISCVInsertVSETVLI::needVSETVLI(const MachineInstr &MI,
10401040
return true;
10411041
}
10421042

1043+
// If we don't use LMUL or the SEW/LMUL ratio, then adjust LMUL so that we
1044+
// maintain the SEW/LMUL ratio. This allows us to eliminate VL toggles in more
1045+
// places.
10431046
static VSETVLIInfo adjustIncoming(VSETVLIInfo PrevInfo, VSETVLIInfo NewInfo,
1044-
DemandedFields &Demanded,
1045-
const MachineRegisterInfo *MRI);
1047+
DemandedFields &Demanded) {
1048+
VSETVLIInfo Info = NewInfo;
1049+
1050+
if (!Demanded.LMUL && !Demanded.SEWLMULRatio && PrevInfo.isValid() &&
1051+
!PrevInfo.isUnknown()) {
1052+
if (auto NewVLMul = RISCVVType::getSameRatioLMUL(
1053+
PrevInfo.getSEW(), PrevInfo.getVLMUL(), Info.getSEW()))
1054+
Info.setVLMul(*NewVLMul);
1055+
Demanded.LMUL = true;
1056+
}
1057+
1058+
return Info;
1059+
}
10461060

10471061
// Given an incoming state reaching MI, minimally modifies that state so that it
10481062
// is compatible with MI. The resulting state is guaranteed to be semantically
@@ -1063,8 +1077,7 @@ void RISCVInsertVSETVLI::transferBefore(VSETVLIInfo &Info,
10631077
Info = NewInfo;
10641078

10651079
DemandedFields Demanded = getDemanded(MI, MRI, ST);
1066-
const VSETVLIInfo IncomingInfo =
1067-
adjustIncoming(PrevInfo, NewInfo, Demanded, MRI);
1080+
const VSETVLIInfo IncomingInfo = adjustIncoming(PrevInfo, NewInfo, Demanded);
10681081

10691082
// If MI only demands that VL has the same zeroness, we only need to set the
10701083
// AVL if the zeroness differs. This removes a vsetvli entirely if the types
@@ -1098,25 +1111,6 @@ void RISCVInsertVSETVLI::transferBefore(VSETVLIInfo &Info,
10981111
}
10991112
}
11001113

1101-
static VSETVLIInfo adjustIncoming(VSETVLIInfo PrevInfo, VSETVLIInfo NewInfo,
1102-
DemandedFields &Demanded,
1103-
const MachineRegisterInfo *MRI) {
1104-
VSETVLIInfo Info = NewInfo;
1105-
1106-
// If we don't use LMUL or the SEW/LMUL ratio, then adjust LMUL so that we
1107-
// maintain the SEW/LMUL ratio. This allows us to eliminate VL toggles in more
1108-
// places.
1109-
if (!Demanded.LMUL && !Demanded.SEWLMULRatio && PrevInfo.isValid() &&
1110-
!PrevInfo.isUnknown()) {
1111-
if (auto NewVLMul = RISCVVType::getSameRatioLMUL(
1112-
PrevInfo.getSEW(), PrevInfo.getVLMUL(), Info.getSEW()))
1113-
Info.setVLMul(*NewVLMul);
1114-
Demanded.LMUL = true;
1115-
}
1116-
1117-
return Info;
1118-
}
1119-
11201114
// Given a state with which we evaluated MI (see transferBefore above for why
11211115
// this might be different that the state MI requested), modify the state to
11221116
// reflect the changes MI might make.

0 commit comments

Comments
 (0)