Enzyme main
Loading...
Searching...
No Matches
CloneFunction.cpp File Reference
#include "llvm/ADT/APSInt.h"
#include "mlir/IR/BuiltinTypes.h"
#include "CloneFunction.h"
Include dependency graph for CloneFunction.cpp:

Go to the source code of this file.

Functions

Type getShadowType (Type type, unsigned width)
 
template<typename T >
mlir::FunctionType getFunctionTypeForClone (T FTy, DerivativeMode mode, unsigned width, mlir::Type additionalArg, const std::vector< bool > &returnPrimals, const std::vector< bool > &returnShadows, llvm::ArrayRef< DIFFE_TYPE > ReturnActivity, llvm::ArrayRef< DIFFE_TYPE > ArgActivity)
 
Operation * clone (Operation *src, IRMapping &mapper, Operation::CloneOptions options, std::map< Operation *, Operation * > &opMap)
 
void cloneInto (Region *src, Region *dest, IRMapping &mapper, std::map< Operation *, Operation * > &opMap)
 
void cloneInto (Region *src, Region *dest, Region::iterator destPos, IRMapping &mapper, std::map< Operation *, Operation * > &opMap)
 Clone this region into 'dest' before the given position in 'dest'.
 
FunctionOpInterface CloneFunctionWithReturns (DerivativeMode mode, unsigned width, FunctionOpInterface F, IRMapping &ptrInputs, ArrayRef< DIFFE_TYPE > ArgActivity, SmallPtrSetImpl< mlir::Value > &constants, SmallPtrSetImpl< mlir::Value > &nonconstants, SmallPtrSetImpl< mlir::Value > &returnvals, const std::vector< bool > &returnPrimals, const std::vector< bool > &returnShadows, ArrayRef< DIFFE_TYPE > RetActivity, Twine name, IRMapping &VMap, std::map< Operation *, Operation * > &OpMap, mlir::Type additionalArg)
 

Function Documentation

◆ clone()

Operation * clone ( Operation * src,
IRMapping & mapper,
Operation::CloneOptions options,
std::map< Operation *, Operation * > & opMap )

Definition at line 75 of file CloneFunction.cpp.

References cloneInto().

Referenced by cloneInto().

◆ CloneFunctionWithReturns()

FunctionOpInterface CloneFunctionWithReturns ( DerivativeMode mode,
unsigned width,
FunctionOpInterface F,
IRMapping & ptrInputs,
ArrayRef< DIFFE_TYPE > ArgActivity,
SmallPtrSetImpl< mlir::Value > & constants,
SmallPtrSetImpl< mlir::Value > & nonconstants,
SmallPtrSetImpl< mlir::Value > & returnvals,
const std::vector< bool > & returnPrimals,
const std::vector< bool > & returnShadows,
ArrayRef< DIFFE_TYPE > RetActivity,
Twine name,
IRMapping & VMap,
std::map< Operation *, Operation * > & OpMap,
mlir::Type additionalArg )

◆ cloneInto() [1/2]

void cloneInto ( Region * src,
Region * dest,
IRMapping & mapper,
std::map< Operation *, Operation * > & opMap )

◆ cloneInto() [2/2]

void cloneInto ( Region * src,
Region * dest,
Region::iterator destPos,
IRMapping & mapper,
std::map< Operation *, Operation * > & opMap )

Clone this region into 'dest' before the given position in 'dest'.

Definition at line 124 of file CloneFunction.cpp.

References clone(), and cloneInto().

◆ getFunctionTypeForClone()

template<typename T >
mlir::FunctionType getFunctionTypeForClone ( T FTy,
DerivativeMode mode,
unsigned width,
mlir::Type additionalArg,
const std::vector< bool > & returnPrimals,
const std::vector< bool > & returnShadows,
llvm::ArrayRef< DIFFE_TYPE > ReturnActivity,
llvm::ArrayRef< DIFFE_TYPE > ArgActivity )

Definition at line 19 of file CloneFunction.cpp.

References CONSTANT, DUP_ARG, DUP_NONEED, getShadowType(), and OUT_DIFF.

Referenced by CloneFunctionWithReturns().

◆ getShadowType()