MaskAgnostic == Other.MaskAgnostic;
}
- bool hasCompatibleVTYPE(const MachineInstr &MI,
+ bool hasCompatibleVTYPE(const DemandedFields &Used,
const VSETVLIInfo &Require) const {
- const DemandedFields Used = getDemanded(MI);
return areCompatibleVTYPEs(encodeVTYPE(), Require.encodeVTYPE(), Used);
}
// Determine whether the vector instructions requirements represented by
// Require are compatible with the previous vsetvli instruction represented
// by this. MI is the instruction whose requirements we're considering.
- bool isCompatible(const MachineInstr &MI, const VSETVLIInfo &Require) const {
+ bool isCompatible(const DemandedFields &Used, const VSETVLIInfo &Require) const {
assert(isValid() && Require.isValid() &&
"Can't compare invalid VSETVLIInfos");
assert(!Require.SEWLMULRatioOnly &&
if (SEW == Require.SEW)
return true;
- return hasSameAVL(Require) && hasCompatibleVTYPE(MI, Require);
+ // TODO: Check Used.VL here
+ if (!hasSameAVL(Require))
+ return false;
+ return areCompatibleVTYPEs(encodeVTYPE(), Require.encodeVTYPE(), Used);
}
bool operator==(const VSETVLIInfo &Other) const {
if (!CurInfo.isValid() || CurInfo.isUnknown() || CurInfo.hasSEWLMULRatioOnly())
return true;
- if (CurInfo.isCompatible(MI, Require))
+ const DemandedFields Used = getDemanded(MI);
+ if (CurInfo.isCompatible(Used, Require))
return false;
// For vmv.s.x and vfmv.s.f, there is only two behaviors, VL = 0 and VL > 0.
// and the last VL/VTYPE we observed is the same, we don't need a
// VSETVLI here.
if (Require.hasAVLReg() && Require.getAVLReg().isVirtual() &&
- CurInfo.hasCompatibleVTYPE(MI, Require)) {
+ CurInfo.hasCompatibleVTYPE(Used, Require)) {
if (MachineInstr *DefMI = MRI->getVRegDef(Require.getAVLReg())) {
if (isVectorConfigInstr(*DefMI)) {
VSETVLIInfo DefInfo = getInfoForVSETVLI(*DefMI);