Skip to content

Commit bed6d72

Browse files
committed
Get rid of MRI from hasNonZeroAVL and hasEquallyZeroAVL
1 parent 0e2958a commit bed6d72

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed

llvm/lib/Target/RISCV/RISCVInsertVSETVLI.cpp

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -546,7 +546,7 @@ class VSETVLIInfo {
546546
bool getTailAgnostic() const { return TailAgnostic; }
547547
bool getMaskAgnostic() const { return MaskAgnostic; }
548548

549-
bool hasNonZeroAVL(const MachineRegisterInfo &MRI) const {
549+
bool hasNonZeroAVL() const {
550550
if (hasAVLImm())
551551
return getAVLImm() > 0;
552552
if (hasAVLReg()) {
@@ -561,11 +561,10 @@ class VSETVLIInfo {
561561
return false;
562562
}
563563

564-
bool hasEquallyZeroAVL(const VSETVLIInfo &Other,
565-
const MachineRegisterInfo &MRI) const {
564+
bool hasEquallyZeroAVL(const VSETVLIInfo &Other) const {
566565
if (hasSameAVL(Other))
567566
return true;
568-
return (hasNonZeroAVL(MRI) && Other.hasNonZeroAVL(MRI));
567+
return (hasNonZeroAVL() && Other.hasNonZeroAVL());
569568
}
570569

571570
bool hasSameAVL(const VSETVLIInfo &Other) const {
@@ -666,7 +665,7 @@ class VSETVLIInfo {
666665
if (Used.VLAny && !(hasSameAVL(Require) && hasSameVLMAX(Require)))
667666
return false;
668667

669-
if (Used.VLZeroness && !hasEquallyZeroAVL(Require, MRI))
668+
if (Used.VLZeroness && !hasEquallyZeroAVL(Require))
670669
return false;
671670

672671
return hasCompatibleVTYPE(Used, Require);
@@ -1203,7 +1202,7 @@ void RISCVInsertVSETVLI::transferBefore(VSETVLIInfo &Info,
12031202
// variant, so we avoid the transform to prevent extending live range of an
12041203
// avl register operand.
12051204
// TODO: We can probably relax this for immediates.
1206-
bool EquallyZero = IncomingInfo.hasEquallyZeroAVL(PrevInfo, *MRI) &&
1205+
bool EquallyZero = IncomingInfo.hasEquallyZeroAVL(PrevInfo) &&
12071206
IncomingInfo.hasSameVLMAX(PrevInfo);
12081207
if (Demanded.VLAny || (Demanded.VLZeroness && !EquallyZero))
12091208
Info.setAVL(IncomingInfo);
@@ -1592,7 +1591,7 @@ static bool canMutatePriorConfig(const MachineInstr &PrevMI,
15921591
if (isVLPreservingConfig(PrevMI))
15931592
return false;
15941593
if (!getInfoForVSETVLI(PrevMI, MRI)
1595-
.hasEquallyZeroAVL(getInfoForVSETVLI(MI, MRI), MRI))
1594+
.hasEquallyZeroAVL(getInfoForVSETVLI(MI, MRI)))
15961595
return false;
15971596
}
15981597

0 commit comments

Comments
 (0)