@@ -2147,6 +2147,8 @@ static constexpr std::array kExplicitAttributes{
21472147 StringLiteral (" denormal-fp-math-f32" ),
21482148 StringLiteral (" fp-contract" ),
21492149 StringLiteral (" frame-pointer" ),
2150+ StringLiteral (" instrument-function-entry" ),
2151+ StringLiteral (" instrument-function-exit" ),
21502152 StringLiteral (" no-infs-fp-math" ),
21512153 StringLiteral (" no-nans-fp-math" ),
21522154 StringLiteral (" no-signed-zeros-fp-math" ),
@@ -2302,6 +2304,16 @@ void ModuleImport::processFunctionAttributes(llvm::Function *func,
23022304 attr.isStringAttribute ())
23032305 funcOp.setApproxFuncFpMath (attr.getValueAsBool ());
23042306
2307+ if (llvm::Attribute attr = func->getFnAttribute (" instrument-function-entry" );
2308+ attr.isStringAttribute ())
2309+ funcOp.setInstrumentFunctionEntry (
2310+ StringAttr::get (context, attr.getValueAsString ()));
2311+
2312+ if (llvm::Attribute attr = func->getFnAttribute (" instrument-function-exit" );
2313+ attr.isStringAttribute ())
2314+ funcOp.setInstrumentFunctionExit (
2315+ StringAttr::get (context, attr.getValueAsString ()));
2316+
23052317 if (llvm::Attribute attr = func->getFnAttribute (" no-signed-zeros-fp-math" );
23062318 attr.isStringAttribute ())
23072319 funcOp.setNoSignedZerosFpMath (attr.getValueAsBool ());
0 commit comments