[llvm] be50b8c - [riscv] Add debug printing support for VSETVLIInfo class [nfc]
Philip Reames via llvm-commits
llvm-commits at lists.llvm.org
Tue May 3 14:00:27 PDT 2022
Author: Philip Reames
Date: 2022-05-03T14:00:17-07:00
New Revision: be50b8c185c69f1e7e534cc67b590196a381b8a9
URL: https://github.com/llvm/llvm-project/commit/be50b8c185c69f1e7e534cc67b590196a381b8a9
DIFF: https://github.com/llvm/llvm-project/commit/be50b8c185c69f1e7e534cc67b590196a381b8a9.diff
LOG: [riscv] Add debug printing support for VSETVLIInfo class [nfc]
Added:
Modified:
llvm/lib/Target/RISCV/RISCVInsertVSETVLI.cpp
Removed:
################################################################################
diff --git a/llvm/lib/Target/RISCV/RISCVInsertVSETVLI.cpp b/llvm/lib/Target/RISCV/RISCVInsertVSETVLI.cpp
index d36a1076beace..4b18220d4812c 100644
--- a/llvm/lib/Target/RISCV/RISCVInsertVSETVLI.cpp
+++ b/llvm/lib/Target/RISCV/RISCVInsertVSETVLI.cpp
@@ -386,8 +386,45 @@ class VSETVLIInfo {
// Otherwise just use whatever is in this block.
return Other;
}
+
+#if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP)
+ /// Support for debugging, callable in GDB: V->dump()
+ LLVM_DUMP_METHOD void dump() const {
+ print(dbgs());
+ dbgs() << "\n";
+ }
+#endif
+
+ /// Implement operator<<.
+ /// @{
+ void print(raw_ostream &OS) const {
+ OS << "{";
+ if (!isValid())
+ OS << "Uninitialized";
+ if (isUnknown())
+ OS << "unknown";;
+ if (hasAVLReg())
+ OS << "AVLReg=" << (unsigned)AVLReg;
+ if (hasAVLImm())
+ OS << "AVLImm=" << (unsigned)AVLImm;
+ OS << ", "
+ << "VLMul=" << (unsigned)VLMul << ", "
+ << "SEW=" << (unsigned)SEW << ", "
+ << "TailAgnostic=" << (bool)TailAgnostic << ", "
+ << "MaskAgnostic=" << (bool)MaskAgnostic << ", "
+ << "MaskRegOp=" << (bool)MaskRegOp << ", "
+ << "StoreOp=" << (bool)StoreOp << ", "
+ << "ScalarMovOp=" << (bool)ScalarMovOp << ", "
+ << "SEWLMULRatioOnly=" << (bool)SEWLMULRatioOnly << "}";
+ }
};
+inline raw_ostream &operator<<(raw_ostream &OS, const VSETVLIInfo &V) {
+ V.print(OS);
+ return OS;
+}
+
+
struct BlockData {
// The VSETVLIInfo that represents the net changes to the VL/VTYPE registers
// made by this block. Calculated in Phase 1.
More information about the llvm-commits
mailing list