[llvm] [NFC][RISCV] Keep AVLReg define instr inside VSETVLInfo (PR #89180)
Luke Lau via llvm-commits
llvm-commits at lists.llvm.org
Thu Apr 25 05:54:41 PDT 2024
================
@@ -528,31 +537,27 @@ class VSETVLIInfo {
bool getTailAgnostic() const { return TailAgnostic; }
bool getMaskAgnostic() const { return MaskAgnostic; }
- bool hasNonZeroAVL(const MachineRegisterInfo &MRI) const {
+ bool hasNonZeroAVL() const {
if (hasAVLImm())
return getAVLImm() > 0;
- if (hasAVLReg()) {
- MachineInstr *MI = MRI.getUniqueVRegDef(getAVLReg());
- assert(MI);
- return isNonZeroLoadImmediate(*MI);
- }
+ if (hasAVLReg())
+ return isNonZeroLoadImmediate(getAVLDefMI());
if (hasAVLVLMAX())
return true;
if (hasAVLIgnored())
return false;
return false;
}
- bool hasEquallyZeroAVL(const VSETVLIInfo &Other,
- const MachineRegisterInfo &MRI) const {
+ bool hasEquallyZeroAVL(const VSETVLIInfo &Other) const {
if (hasSameAVL(Other))
return true;
- return (hasNonZeroAVL(MRI) && Other.hasNonZeroAVL(MRI));
+ return (hasNonZeroAVL() && Other.hasNonZeroAVL());
}
bool hasSameAVL(const VSETVLIInfo &Other) const {
if (hasAVLReg() && Other.hasAVLReg())
- return getAVLReg() == Other.getAVLReg();
+ return getAVLDefMI().isIdenticalTo(Other.getAVLDefMI());
----------------
lukel97 wrote:
Need to check the registers are the same too
https://github.com/llvm/llvm-project/pull/89180
More information about the llvm-commits
mailing list