@@ -477,6 +477,18 @@ class VSETVLIInfo {
477
477
return AVLImm;
478
478
}
479
479
480
+ void setAVL (VSETVLIInfo Info) {
481
+ assert (Info.isValid ());
482
+ if (Info.isUnknown ())
483
+ setUnknown ();
484
+ else if (Info.hasAVLReg ())
485
+ setAVLReg (Info.getAVLReg ());
486
+ else {
487
+ assert (Info.hasAVLImm ());
488
+ setAVLImm (Info.getAVLImm ());
489
+ }
490
+ }
491
+
480
492
unsigned getSEW () const { return SEW; }
481
493
RISCVII::VLMUL getVLMUL () const { return VLMul; }
482
494
@@ -1054,10 +1066,7 @@ void RISCVInsertVSETVLI::transferBefore(VSETVLIInfo &Info,
1054
1066
// TODO: We can probably relax this for immediates.
1055
1067
if (Demanded.VLZeroness && !Demanded.VLAny && PrevInfo.isValid () &&
1056
1068
PrevInfo.hasEquallyZeroAVL (Info, *MRI) && Info.hasSameVLMAX (PrevInfo)) {
1057
- if (PrevInfo.hasAVLImm ())
1058
- Info.setAVLImm (PrevInfo.getAVLImm ());
1059
- else
1060
- Info.setAVLReg (PrevInfo.getAVLReg ());
1069
+ Info.setAVL (PrevInfo);
1061
1070
return ;
1062
1071
}
1063
1072
@@ -1074,10 +1083,7 @@ void RISCVInsertVSETVLI::transferBefore(VSETVLIInfo &Info,
1074
1083
VSETVLIInfo DefInfo = getInfoForVSETVLI (*DefMI);
1075
1084
if (DefInfo.hasSameVLMAX (Info) &&
1076
1085
(DefInfo.hasAVLImm () || DefInfo.getAVLReg () == RISCV::X0)) {
1077
- if (DefInfo.hasAVLImm ())
1078
- Info.setAVLImm (DefInfo.getAVLImm ());
1079
- else
1080
- Info.setAVLReg (DefInfo.getAVLReg ());
1086
+ Info.setAVL (DefInfo);
1081
1087
return ;
1082
1088
}
1083
1089
}
0 commit comments