Skip to content

Commit 6936611

Browse files
committed
[RISCV] Omit VTYPE in VSETVLIInfo::print() when state is uninit or unknown.
1 parent 488ed96 commit 6936611

File tree

1 file changed

+20
-18
lines changed

1 file changed

+20
-18
lines changed

llvm/lib/Target/RISCV/RISCVInsertVSETVLI.cpp

Lines changed: 20 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -837,7 +837,7 @@ class VSETVLIInfo {
837837
/// Implement operator<<.
838838
/// @{
839839
void print(raw_ostream &OS) const {
840-
OS << "{";
840+
OS << '{';
841841
switch (State) {
842842
case Uninitialized:
843843
OS << "Uninitialized";
@@ -855,24 +855,26 @@ class VSETVLIInfo {
855855
OS << "AVLVLMAX";
856856
break;
857857
}
858-
OS << ", ";
858+
if (State != Uninitialized && State != Unknown) {
859+
OS << ", ";
860+
861+
unsigned LMul;
862+
bool Fractional;
863+
std::tie(LMul, Fractional) = decodeVLMUL(VLMul);
864+
865+
OS << "VLMul=m";
866+
if (Fractional)
867+
OS << 'f';
868+
OS << LMul << ", "
869+
<< "SEW=e" << (unsigned)SEW << ", "
870+
<< "TailAgnostic=" << (bool)TailAgnostic << ", "
871+
<< "MaskAgnostic=" << (bool)MaskAgnostic << ", "
872+
<< "SEWLMULRatioOnly=" << (bool)SEWLMULRatioOnly << ", "
873+
<< "TWiden=" << (unsigned)TWiden << ", "
874+
<< "AltFmt=" << (bool)AltFmt;
875+
}
859876

860-
unsigned LMul;
861-
bool Fractional;
862-
std::tie(LMul, Fractional) = decodeVLMUL(VLMul);
863-
864-
OS << "VLMul=";
865-
if (Fractional)
866-
OS << "mf";
867-
else
868-
OS << "m";
869-
OS << LMul << ", "
870-
<< "SEW=e" << (unsigned)SEW << ", "
871-
<< "TailAgnostic=" << (bool)TailAgnostic << ", "
872-
<< "MaskAgnostic=" << (bool)MaskAgnostic << ", "
873-
<< "SEWLMULRatioOnly=" << (bool)SEWLMULRatioOnly << ", "
874-
<< "TWiden=" << (unsigned)TWiden << ", "
875-
<< "AltFmt=" << (bool)AltFmt << "}";
877+
OS << '}';
876878
}
877879
#endif
878880
};

0 commit comments

Comments
 (0)