From 07f3e71dcc9b45a1f6ea14f8b8eb2a0a2d008f35 Mon Sep 17 00:00:00 2001 From: William Moses Date: Sun, 1 Oct 2023 22:23:21 -0400 Subject: [PATCH] Simplify type analysis dump (#1461) --- enzyme/Enzyme/TypeAnalysis/TypeAnalysis.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/enzyme/Enzyme/TypeAnalysis/TypeAnalysis.cpp b/enzyme/Enzyme/TypeAnalysis/TypeAnalysis.cpp index a389ad94c292..d7b1132f2f2b 100644 --- a/enzyme/Enzyme/TypeAnalysis/TypeAnalysis.cpp +++ b/enzyme/Enzyme/TypeAnalysis/TypeAnalysis.cpp @@ -35,6 +35,7 @@ #include "llvm/IR/InstrTypes.h" #include "llvm/IR/Instructions.h" #include "llvm/IR/IntrinsicInst.h" +#include "llvm/IR/ModuleSlotTracker.h" #include "llvm/IR/Type.h" #include "llvm/IR/Value.h" @@ -2168,8 +2169,15 @@ void TypeAnalyzer::visitInsertValueInst(InsertValueInst &I) { void TypeAnalyzer::dump(llvm::raw_ostream &ss) { ss << "\n"; + // We don't care about correct MD node numbering here. + ModuleSlotTracker MST(fntypeinfo.Function->getParent(), + /*ShouldInitializeAllMetadata*/ false); for (auto &pair : analysis) { - ss << *pair.first << ": " << pair.second.str() + if (auto F = dyn_cast(pair.first)) + ss << "@" << F->getName(); + else + pair.first->print(ss, MST); + ss << ": " << pair.second.str() << ", intvals: " << to_string(knownIntegralValues(pair.first)) << "\n"; } ss << "\n";