@@ -216,7 +216,7 @@ void mlir::enzyme::MGradientUtils::forceAugmentedReturns() {
216216 // getContext(cast<BasicBlock>(getNewFromOriginal(&oBB)), loopContext);
217217
218218 oldFunc.walk ([&](Block *blk) {
219- if (blk == &oldFunc.getBody ().getBlocks ().front ())
219+ if (blk == &oldFunc.getFunctionBody ().getBlocks ().front ())
220220 return ;
221221 auto nblk = getNewFromOriginal (blk);
222222 for (auto val : llvm::reverse (blk->getArguments ())) {
@@ -510,15 +510,15 @@ FunctionOpInterface CloneFunctionWithReturns(
510510 DIFFE_TYPE returnType, Twine name, BlockAndValueMapping &VMap,
511511 std::map<Operation *, Operation *> &OpMap, bool diffeReturnArg,
512512 mlir::Type additionalArg) {
513- assert (!F.getBody ().empty ());
513+ assert (!F.getFunctionBody ().empty ());
514514 // F = preprocessForClone(F, mode);
515515 // llvm::ValueToValueMapTy VMap;
516516 auto FTy = getFunctionTypeForClone (
517517 F.getFunctionType ().cast <mlir::FunctionType>(), mode, width,
518518 additionalArg, constant_args, diffeReturnArg, returnValue, returnType);
519519
520520 /*
521- for (Block &BB : F.getBody ().getBlocks()) {
521+ for (Block &BB : F.getFunctionBody ().getBlocks()) {
522522 if (auto ri = dyn_cast<ReturnInst>(BB.getTerminator())) {
523523 if (auto rv = ri->getReturnValue()) {
524524 returnvals.insert(rv);
@@ -538,12 +538,12 @@ FunctionOpInterface CloneFunctionWithReturns(
538538 table.insert (NewF);
539539 SymbolTable::setSymbolVisibility (NewF, SymbolTable::Visibility::Private);
540540
541- cloneInto (&F.getBody (), &NewF.getBody (), VMap, OpMap);
541+ cloneInto (&F.getFunctionBody (), &NewF.getFunctionBody (), VMap, OpMap);
542542
543543 {
544- auto &blk = NewF.getBody ().front ();
544+ auto &blk = NewF.getFunctionBody ().front ();
545545 for (ssize_t i = constant_args.size () - 1 ; i >= 0 ; i--) {
546- mlir::Value oval = F.getBody ().front ().getArgument (i);
546+ mlir::Value oval = F.getFunctionBody ().front ().getArgument (i);
547547 if (constant_args[i] == DIFFE_TYPE::CONSTANT)
548548 constants.insert (oval);
549549 else
@@ -771,7 +771,7 @@ FunctionOpInterface mlir::enzyme::MEnzymeLogic::CreateForwardDiff(
771771 std::vector<DIFFE_TYPE> constants, MTypeAnalysis &TA, bool returnUsed,
772772 DerivativeMode mode, bool freeMemory, size_t width, mlir::Type addedType,
773773 MFnTypeInfo type_args, std::vector<bool > volatile_args, void *augmented) {
774- if (fn.getBody ().empty ()) {
774+ if (fn.getFunctionBody ().empty ()) {
775775 llvm::errs () << fn << " \n " ;
776776 llvm_unreachable (" Differentiating empty function" );
777777 }
@@ -829,7 +829,7 @@ FunctionOpInterface mlir::enzyme::MEnzymeLogic::CreateForwardDiff(
829829 unnecessaryInstructions, gutils, TLI);
830830 */
831831
832- for (Block &oBB : gutils->oldFunc .getBody ().getBlocks ()) {
832+ for (Block &oBB : gutils->oldFunc .getFunctionBody ().getBlocks ()) {
833833 // Don't create derivatives for code that results in termination
834834 if (guaranteedUnreachable.find (&oBB) != guaranteedUnreachable.end ()) {
835835 auto newBB = gutils->getNewFromOriginal (&oBB);
@@ -865,7 +865,7 @@ FunctionOpInterface mlir::enzyme::MEnzymeLogic::CreateForwardDiff(
865865
866866 // gutils->eraseFictiousPHIs();
867867
868- mlir::Block *entry = &gutils->newFunc .getBody ().front ();
868+ mlir::Block *entry = &gutils->newFunc .getFunctionBody ().front ();
869869
870870 // cleanupInversionAllocs(gutils, entry);
871871 // clearFunctionAttributes(gutils->newFunc);
0 commit comments