@@ -882,7 +882,7 @@ class RISCVInsertVSETVLI : public MachineFunctionPass {
882
882
StringRef getPassName () const override { return RISCV_INSERT_VSETVLI_NAME; }
883
883
884
884
private:
885
- bool needVSETVLI (const MachineInstr &MI , const VSETVLIInfo &Require,
885
+ bool needVSETVLI (const DemandedFields &Used , const VSETVLIInfo &Require,
886
886
const VSETVLIInfo &CurInfo) const ;
887
887
bool needVSETVLIPHI (const VSETVLIInfo &Require,
888
888
const MachineBasicBlock &MBB) const ;
@@ -1175,17 +1175,13 @@ void RISCVInsertVSETVLI::insertVSETVLI(MachineBasicBlock &MBB,
1175
1175
}
1176
1176
1177
1177
// / Return true if a VSETVLI is required to transition from CurInfo to Require
1178
- // / before MI .
1179
- bool RISCVInsertVSETVLI::needVSETVLI (const MachineInstr &MI ,
1178
+ // / given a set of DemandedFields \p Used .
1179
+ bool RISCVInsertVSETVLI::needVSETVLI (const DemandedFields &Used ,
1180
1180
const VSETVLIInfo &Require,
1181
1181
const VSETVLIInfo &CurInfo) const {
1182
- assert (Require == computeInfoForInstr (MI, MI.getDesc ().TSFlags , *ST, LIS));
1183
-
1184
1182
if (!CurInfo.isValid () || CurInfo.isUnknown () || CurInfo.hasSEWLMULRatioOnly ())
1185
1183
return true ;
1186
1184
1187
- DemandedFields Used = getDemanded (MI, ST);
1188
-
1189
1185
if (CurInfo.isCompatible (Used, Require, LIS))
1190
1186
return false ;
1191
1187
@@ -1232,16 +1228,17 @@ void RISCVInsertVSETVLI::transferBefore(VSETVLIInfo &Info,
1232
1228
if (!RISCVII::hasSEWOp (TSFlags))
1233
1229
return ;
1234
1230
1231
+ DemandedFields Demanded = getDemanded (MI, ST);
1232
+
1235
1233
const VSETVLIInfo NewInfo = computeInfoForInstr (MI, TSFlags, *ST, LIS);
1236
1234
assert (NewInfo.isValid () && !NewInfo.isUnknown ());
1237
- if (Info.isValid () && !needVSETVLI (MI , NewInfo, Info))
1235
+ if (Info.isValid () && !needVSETVLI (Demanded , NewInfo, Info))
1238
1236
return ;
1239
1237
1240
1238
const VSETVLIInfo PrevInfo = Info;
1241
1239
if (!Info.isValid () || Info.isUnknown ())
1242
1240
Info = NewInfo;
1243
1241
1244
- DemandedFields Demanded = getDemanded (MI, ST);
1245
1242
const VSETVLIInfo IncomingInfo = adjustIncoming (PrevInfo, NewInfo, Demanded);
1246
1243
1247
1244
// If MI only demands that VL has the same zeroness, we only need to set the
0 commit comments