Skip to content

Commit ccbd0d1

Browse files
authored
[RISCV] Add assertions to VSETVLIInfo accessors. NFC (#169462)
1 parent 031d998 commit ccbd0d1

File tree

1 file changed

+30
-6
lines changed

1 file changed

+30
-6
lines changed

llvm/lib/Target/RISCV/RISCVInsertVSETVLI.cpp

Lines changed: 30 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -607,12 +607,36 @@ class VSETVLIInfo {
607607
}
608608
}
609609

610-
unsigned getSEW() const { return SEW; }
611-
RISCVVType::VLMUL getVLMUL() const { return VLMul; }
612-
bool getTailAgnostic() const { return TailAgnostic; }
613-
bool getMaskAgnostic() const { return MaskAgnostic; }
614-
bool getAltFmt() const { return AltFmt; }
615-
unsigned getTWiden() const { return TWiden; }
610+
unsigned getSEW() const {
611+
assert(isValid() && !isUnknown() &&
612+
"Can't use VTYPE for uninitialized or unknown");
613+
return SEW;
614+
}
615+
RISCVVType::VLMUL getVLMUL() const {
616+
assert(isValid() && !isUnknown() &&
617+
"Can't use VTYPE for uninitialized or unknown");
618+
return VLMul;
619+
}
620+
bool getTailAgnostic() const {
621+
assert(isValid() && !isUnknown() &&
622+
"Can't use VTYPE for uninitialized or unknown");
623+
return TailAgnostic;
624+
}
625+
bool getMaskAgnostic() const {
626+
assert(isValid() && !isUnknown() &&
627+
"Can't use VTYPE for uninitialized or unknown");
628+
return MaskAgnostic;
629+
}
630+
bool getAltFmt() const {
631+
assert(isValid() && !isUnknown() &&
632+
"Can't use VTYPE for uninitialized or unknown");
633+
return AltFmt;
634+
}
635+
unsigned getTWiden() const {
636+
assert(isValid() && !isUnknown() &&
637+
"Can't use VTYPE for uninitialized or unknown");
638+
return TWiden;
639+
}
616640

617641
bool hasNonZeroAVL(const LiveIntervals *LIS) const {
618642
if (hasAVLImm())

0 commit comments

Comments
 (0)