File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff 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
114116bool 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}
You can’t perform that action at this time.
0 commit comments