@@ -216,7 +216,7 @@ void mlir::enzyme::MGradientUtils::forceAugmentedReturns() {
216
216
// getContext(cast<BasicBlock>(getNewFromOriginal(&oBB)), loopContext);
217
217
218
218
oldFunc.walk ([&](Block *blk) {
219
- if (blk == &oldFunc.getBody ().getBlocks ().front ())
219
+ if (blk == &oldFunc.getFunctionBody ().getBlocks ().front ())
220
220
return ;
221
221
auto nblk = getNewFromOriginal (blk);
222
222
for (auto val : llvm::reverse (blk->getArguments ())) {
@@ -510,15 +510,15 @@ FunctionOpInterface CloneFunctionWithReturns(
510
510
DIFFE_TYPE returnType, Twine name, BlockAndValueMapping &VMap,
511
511
std::map<Operation *, Operation *> &OpMap, bool diffeReturnArg,
512
512
mlir::Type additionalArg) {
513
- assert (!F.getBody ().empty ());
513
+ assert (!F.getFunctionBody ().empty ());
514
514
// F = preprocessForClone(F, mode);
515
515
// llvm::ValueToValueMapTy VMap;
516
516
auto FTy = getFunctionTypeForClone (
517
517
F.getFunctionType ().cast <mlir::FunctionType>(), mode, width,
518
518
additionalArg, constant_args, diffeReturnArg, returnValue, returnType);
519
519
520
520
/*
521
- for (Block &BB : F.getBody ().getBlocks()) {
521
+ for (Block &BB : F.getFunctionBody ().getBlocks()) {
522
522
if (auto ri = dyn_cast<ReturnInst>(BB.getTerminator())) {
523
523
if (auto rv = ri->getReturnValue()) {
524
524
returnvals.insert(rv);
@@ -538,12 +538,12 @@ FunctionOpInterface CloneFunctionWithReturns(
538
538
table.insert (NewF);
539
539
SymbolTable::setSymbolVisibility (NewF, SymbolTable::Visibility::Private);
540
540
541
- cloneInto (&F.getBody (), &NewF.getBody (), VMap, OpMap);
541
+ cloneInto (&F.getFunctionBody (), &NewF.getFunctionBody (), VMap, OpMap);
542
542
543
543
{
544
- auto &blk = NewF.getBody ().front ();
544
+ auto &blk = NewF.getFunctionBody ().front ();
545
545
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);
547
547
if (constant_args[i] == DIFFE_TYPE::CONSTANT)
548
548
constants.insert (oval);
549
549
else
@@ -771,7 +771,7 @@ FunctionOpInterface mlir::enzyme::MEnzymeLogic::CreateForwardDiff(
771
771
std::vector<DIFFE_TYPE> constants, MTypeAnalysis &TA, bool returnUsed,
772
772
DerivativeMode mode, bool freeMemory, size_t width, mlir::Type addedType,
773
773
MFnTypeInfo type_args, std::vector<bool > volatile_args, void *augmented) {
774
- if (fn.getBody ().empty ()) {
774
+ if (fn.getFunctionBody ().empty ()) {
775
775
llvm::errs () << fn << " \n " ;
776
776
llvm_unreachable (" Differentiating empty function" );
777
777
}
@@ -829,7 +829,7 @@ FunctionOpInterface mlir::enzyme::MEnzymeLogic::CreateForwardDiff(
829
829
unnecessaryInstructions, gutils, TLI);
830
830
*/
831
831
832
- for (Block &oBB : gutils->oldFunc .getBody ().getBlocks ()) {
832
+ for (Block &oBB : gutils->oldFunc .getFunctionBody ().getBlocks ()) {
833
833
// Don't create derivatives for code that results in termination
834
834
if (guaranteedUnreachable.find (&oBB) != guaranteedUnreachable.end ()) {
835
835
auto newBB = gutils->getNewFromOriginal (&oBB);
@@ -865,7 +865,7 @@ FunctionOpInterface mlir::enzyme::MEnzymeLogic::CreateForwardDiff(
865
865
866
866
// gutils->eraseFictiousPHIs();
867
867
868
- mlir::Block *entry = &gutils->newFunc .getBody ().front ();
868
+ mlir::Block *entry = &gutils->newFunc .getFunctionBody ().front ();
869
869
870
870
// cleanupInversionAllocs(gutils, entry);
871
871
// clearFunctionAttributes(gutils->newFunc);
0 commit comments