Skip to content

Commit df3319a

Browse files
committed
Get rid of MRI from hasNonZeroAVL and hasEquallyZeroAVL
1 parent 6719983 commit df3319a

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
@@ -535,7 +535,7 @@ class VSETVLIInfo {
535535
bool getTailAgnostic() const { return TailAgnostic; }
536536
bool getMaskAgnostic() const { return MaskAgnostic; }
537537

538-
bool hasNonZeroAVL(const MachineRegisterInfo &MRI) const {
538+
bool hasNonZeroAVL() const {
539539
if (hasAVLImm())
540540
return getAVLImm() > 0;
541541
if (hasAVLReg()) {
@@ -550,11 +550,10 @@ class VSETVLIInfo {
550550
return false;
551551
}
552552

553-
bool hasEquallyZeroAVL(const VSETVLIInfo &Other,
554-
const MachineRegisterInfo &MRI) const {
553+
bool hasEquallyZeroAVL(const VSETVLIInfo &Other) const {
555554
if (hasSameAVL(Other))
556555
return true;
557-
return (hasNonZeroAVL(MRI) && Other.hasNonZeroAVL(MRI));
556+
return (hasNonZeroAVL() && Other.hasNonZeroAVL());
558557
}
559558

560559
bool hasSameAVL(const VSETVLIInfo &Other) const {
@@ -655,7 +654,7 @@ class VSETVLIInfo {
655654
if (Used.VLAny && !(hasSameAVL(Require) && hasSameVLMAX(Require)))
656655
return false;
657656

658-
if (Used.VLZeroness && !hasEquallyZeroAVL(Require, MRI))
657+
if (Used.VLZeroness && !hasEquallyZeroAVL(Require))
659658
return false;
660659

661660
return hasCompatibleVTYPE(Used, Require);
@@ -1192,7 +1191,7 @@ void RISCVInsertVSETVLI::transferBefore(VSETVLIInfo &Info,
11921191
// variant, so we avoid the transform to prevent extending live range of an
11931192
// avl register operand.
11941193
// TODO: We can probably relax this for immediates.
1195-
bool EquallyZero = IncomingInfo.hasEquallyZeroAVL(PrevInfo, *MRI) &&
1194+
bool EquallyZero = IncomingInfo.hasEquallyZeroAVL(PrevInfo) &&
11961195
IncomingInfo.hasSameVLMAX(PrevInfo);
11971196
if (Demanded.VLAny || (Demanded.VLZeroness && !EquallyZero))
11981197
Info.setAVL(IncomingInfo);
@@ -1586,7 +1585,7 @@ static bool canMutatePriorConfig(const MachineInstr &PrevMI,
15861585
if (isVLPreservingConfig(PrevMI))
15871586
return false;
15881587
if (!getInfoForVSETVLI(PrevMI, MRI)
1589-
.hasEquallyZeroAVL(getInfoForVSETVLI(MI, MRI), MRI))
1588+
.hasEquallyZeroAVL(getInfoForVSETVLI(MI, MRI)))
15901589
return false;
15911590
}
15921591

0 commit comments

Comments
 (0)