Skip to content

Commit

Permalink
Simplify type analysis dump (#1461)
Browse files Browse the repository at this point in the history
  • Loading branch information
wsmoses authored Oct 2, 2023
1 parent d0ba44d commit 07f3e71
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion enzyme/Enzyme/TypeAnalysis/TypeAnalysis.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand Down Expand Up @@ -2168,8 +2169,15 @@ void TypeAnalyzer::visitInsertValueInst(InsertValueInst &I) {

void TypeAnalyzer::dump(llvm::raw_ostream &ss) {
ss << "<analysis>\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<Function>(pair.first))
ss << "@" << F->getName();
else
pair.first->print(ss, MST);
ss << ": " << pair.second.str()
<< ", intvals: " << to_string(knownIntegralValues(pair.first)) << "\n";
}
ss << "</analysis>\n";
Expand Down

0 comments on commit 07f3e71

Please sign in to comment.