@@ -1032,26 +1032,24 @@ void RISCVInsertVSETVLI::transferBefore(VSETVLIInfo &Info,
1032
1032
if (Info.hasSEWLMULRatioOnly () || !Info.isValid () || Info.isUnknown ())
1033
1033
Info = NewInfo;
1034
1034
1035
- DemandedFields Demanded = getDemanded (MI, MRI, ST);
1036
-
1037
1035
// If we don't use LMUL or the SEW/LMUL ratio, then adjust LMUL so that we
1038
1036
// maintain the SEW/LMUL ratio. This allows us to eliminate VL toggles in more
1039
1037
// places.
1038
+ DemandedFields Demanded = getDemanded (MI, MRI, ST);
1040
1039
if (!Demanded.LMUL && !Demanded.SEWLMULRatio && Info.isValid () &&
1041
1040
!Info.isUnknown ()) {
1042
- if (auto SameRatioLMUL = RISCVVType::getSameRatioLMUL (
1041
+ if (auto NewVLMul = RISCVVType::getSameRatioLMUL (
1043
1042
Info.getSEW (), Info.getVLMUL (), NewInfo.getSEW ())) {
1044
- NewInfo.setVLMul (*SameRatioLMUL );
1043
+ NewInfo.setVLMul (*NewVLMul );
1045
1044
Demanded.LMUL = true ;
1046
1045
}
1047
1046
}
1048
1047
1049
- // If AVL is defined by a vsetvli with the same VLMAX, we can replace the AVL
1050
- // operand with the AVL of the defining vsetvli. We avoid general register
1051
- // AVLs to avoid extending live ranges without being sure we can kill the
1052
- // original source reg entirely.
1053
- if (RISCVII::hasVLOp (TSFlags) && NewInfo.hasAVLReg () &&
1054
- NewInfo.getAVLReg ().isVirtual ()) {
1048
+ // If AVL is defined by a vsetvli with the same VLMAX, we can
1049
+ // replace the AVL operand with the AVL of the defining vsetvli.
1050
+ // We avoid general register AVLs to avoid extending live ranges
1051
+ // without being sure we can kill the original source reg entirely.
1052
+ if (NewInfo.hasAVLReg () && NewInfo.getAVLReg ().isVirtual ()) {
1055
1053
MachineInstr *DefMI = MRI->getVRegDef (NewInfo.getAVLReg ());
1056
1054
if (DefMI && isVectorConfigInstr (*DefMI)) {
1057
1055
VSETVLIInfo DefInfo = getInfoForVSETVLI (*DefMI);
0 commit comments