Skip to content

Commit cae0c63

Browse files
committed
Get rid of MRI from hasNonZeroAVL and hasEquallyZeroAVL
1 parent b712c80 commit cae0c63

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
@@ -523,7 +523,7 @@ class VSETVLIInfo {
523523
bool getTailAgnostic() const { return TailAgnostic; }
524524
bool getMaskAgnostic() const { return MaskAgnostic; }
525525

526-
bool hasNonZeroAVL(const MachineRegisterInfo &MRI) const {
526+
bool hasNonZeroAVL() const {
527527
if (hasAVLImm())
528528
return getAVLImm() > 0;
529529
if (hasAVLReg()) {
@@ -536,11 +536,10 @@ class VSETVLIInfo {
536536
return false;
537537
}
538538

539-
bool hasEquallyZeroAVL(const VSETVLIInfo &Other,
540-
const MachineRegisterInfo &MRI) const {
539+
bool hasEquallyZeroAVL(const VSETVLIInfo &Other) const {
541540
if (hasSameAVL(Other))
542541
return true;
543-
return (hasNonZeroAVL(MRI) && Other.hasNonZeroAVL(MRI));
542+
return (hasNonZeroAVL() && Other.hasNonZeroAVL());
544543
}
545544

546545
bool hasSameAVL(const VSETVLIInfo &Other) const {
@@ -635,7 +634,7 @@ class VSETVLIInfo {
635634
if (Used.VLAny && !(hasSameAVL(Require) && hasSameVLMAX(Require)))
636635
return false;
637636

638-
if (Used.VLZeroness && !hasEquallyZeroAVL(Require, MRI))
637+
if (Used.VLZeroness && !hasEquallyZeroAVL(Require))
639638
return false;
640639

641640
return hasCompatibleVTYPE(Used, Require);
@@ -1170,7 +1169,7 @@ void RISCVInsertVSETVLI::transferBefore(VSETVLIInfo &Info,
11701169
// variant, so we avoid the transform to prevent extending live range of an
11711170
// avl register operand.
11721171
// TODO: We can probably relax this for immediates.
1173-
bool EquallyZero = IncomingInfo.hasEquallyZeroAVL(PrevInfo, *MRI) &&
1172+
bool EquallyZero = IncomingInfo.hasEquallyZeroAVL(PrevInfo) &&
11741173
IncomingInfo.hasSameVLMAX(PrevInfo);
11751174
if (Demanded.VLAny || (Demanded.VLZeroness && !EquallyZero))
11761175
Info.setAVL(IncomingInfo);
@@ -1565,7 +1564,7 @@ static bool canMutatePriorConfig(const MachineInstr &PrevMI,
15651564
if (isVLPreservingConfig(PrevMI))
15661565
return false;
15671566
if (!getInfoForVSETVLI(PrevMI, MRI)
1568-
.hasEquallyZeroAVL(getInfoForVSETVLI(MI, MRI), MRI))
1567+
.hasEquallyZeroAVL(getInfoForVSETVLI(MI, MRI)))
15691568
return false;
15701569
}
15711570

0 commit comments

Comments
 (0)