================
@@ -79,13 +85,63 @@ IncrementalHIPDeviceParser::GenerateDeviceObject() {
return llvm::StringRef(ObjectContent.data(), ObjectContent.size());
}
+llvm::Expected<llvm::StringRef>
+IncrementalHIPDeviceParser::GenerateHSACO(llvm::StringRef Object) {
+ std::string Exe = llvm::sys::fs::getMainExecutable(nullptr, nullptr);
+ llvm::ErrorOr<std::string> LLDPath = llvm::sys::findProgramByName(
+ "ld.lld", {llvm::sys::path::parent_path(Exe)});
+ if (!LLDPath)
+ LLDPath = llvm::sys::findProgramByName("ld.lld");
----------------
lhames wrote:
Apologies for the delayed reply here. I reached out to the Bolt folks on
discord, because I was curious whether there was any overlap with their
`JITLink` use case. The answer seems to be "maybe, but there's no pressing need
on our end", so we'd be driving any effort, at least to begin with.
If we wanted to do this with JITLink (to avoid taking the additional dependence
on `lld`) I think that you could do it with a custom JITLinkMemoryManager and
some additional Blocks / relocations:
1. Create "packaging" graphs for the dylib headers and additional sections
(symbol table, etc).
2. Have a custom `JITLinkMemoryManager` that records every graph and then
performs global layout.
3. Fix up the `LinkGraph`s concurrently
4. Write the output to the target (either an on-disk or in-memory buffer) in
the finalize step).
I'll see if I can prototype something like this quickly.
https://github.com/llvm/llvm-project/pull/235614
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits