Skip to content

Commit 00f8b01

Browse files
committed
Add Type analysis demangle list
1 parent 3244024 commit 00f8b01

1 file changed

Lines changed: 17 additions & 0 deletions

File tree

enzyme/Enzyme/Utils.cpp

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,8 @@ llvm::cl::opt<bool> EnzymeNonPower2Cache(
109109
cl::desc("Disable caching of integers which are not a power of 2"));
110110
}
111111

112+
#include "llvm/Demangle/Demangle.h"
113+
112114
#define addAttribute addAttributeAtIndex
113115
#define getAttribute getAttributeAtIndex
114116
bool attributeKnownFunctions(llvm::Function &F) {
@@ -407,6 +409,21 @@ bool attributeKnownFunctions(llvm::Function &F) {
407409
AttributeList::FunctionIndex,
408410
Attribute::get(F.getContext(), "enzyme_no_escaping_allocation"));
409411
}
412+
413+
const char *DemangledNoTAFunctionsStartingWith[] = {
414+
415+
};
416+
417+
std::string demangledName = llvm::demangle(fname.str());
418+
auto dName = StringRef(demangledName);
419+
for (auto FuncName : DemangledNoTAFunctionsStartingWith) {
420+
if (startsWith(dName, FuncName)) {
421+
changed = true;
422+
F.addAttribute(AttributeList::FunctionIndex,
423+
Attribute::get(F.getContext(), "enzyme_ta_norecur"));
424+
break;
425+
}
426+
}
410427
changed |= attributeTablegen(F);
411428
return changed;
412429
}

0 commit comments

Comments
 (0)