tensorflow/compiler/mlir/tensorflow/transforms/tpu_sharding_identification_pass.cc
// Looks up arg->retval aliases for every argument, and builds a reverse map.
Looks up arg->retval aliases for every argument, and builds a reverse map.
Looks up arg - > retval aliases for every argument and builds a reverse map .
void ExtractAliases(FuncOp func, llvm::SmallVectorImpl<int>& aliases) {
  aliases.resize(func.getNumResults(), -1);
  for (int i = 0; i < func.getNumArguments(); i++) {
    if (auto v = func.getArgAttrOfType<mlir::IntegerAttr>(i, kAliasingAttr)) {
      int retval_index = v.getInt();
      if (retval_index >= 0 && retval_index < aliases.size()) {
        aliases[retval_index] = i;
      }
    }
  }
}
void ExtractAliases ( FuncOp func , llvm :: SmallVectorImpl < int > & aliases ) { aliases . resize ( func . getNumResults ( ) , -1 ) ; for ( int i = 0 ; i < func . getNumArguments ( ) ; i ++ ) { if ( auto v = func . getArgAttrOfType < mlir :: IntegerAttr > ( i , kAliasingAttr ) ) { int retval_index = v . getInt ( ) ; if ( retval_index >= 0 && retval_index < aliases . size ( ) ) { aliases [ retval_index ] = i ; } } } }
Looks up arg->retval aliases for every argument, and builds a reverse map.
Looks up arg - > retval aliases for every argument and builds a reverse map .