MCPcopy Create free account
hub / github.com/DeepRec-AI/DeepRec / CodegenModule

Function CodegenModule

tensorflow/compiler/aot/embedded_protocol_buffers.cc:77–93  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

75}
76
77static StatusOr<string> CodegenModule(llvm::TargetMachine* target_machine,
78 std::unique_ptr<llvm::Module> module) {
79 llvm::SmallVector<char, 0> stream_buffer;
80 llvm::raw_svector_ostream ostream(stream_buffer);
81 llvm::legacy::PassManager codegen_passes;
82
83 if (target_machine->addPassesToEmitFile(
84 codegen_passes, ostream, nullptr,
85 llvm::CGFT_ObjectFile)) {
86 return xla::InternalError(
87 "Could not create pass pipeline to generate object file");
88 }
89
90 codegen_passes.run(*module);
91
92 return string(stream_buffer.begin(), stream_buffer.end());
93}
94
95static StatusOr<std::unique_ptr<llvm::TargetMachine>>
96GetTargetMachineFromTriple(absl::string_view target_triple) {

Callers 1

Calls 4

InternalErrorFunction · 0.50
runMethod · 0.45
beginMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected