Skip to content

Commit 4d3bc2b

Browse files
authored
[Comgr] Update verbose log for multi-bundle support (llvm#1248)
2 parents 63796a2 + 4ac728f commit 4d3bc2b

File tree

1 file changed

+16
-13
lines changed

1 file changed

+16
-13
lines changed

amd/comgr/src/comgr-compiler.cpp

Lines changed: 16 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1293,8 +1293,15 @@ amd_comgr_status_t AMDGPUCompiler::unbundle() {
12931293
size_t Index = OutputPrefix.find_last_of(".");
12941294
OutputPrefix = OutputPrefix.substr(0, Index);
12951295

1296-
// Bundler target and output names
1297-
for (auto Entry : ActionInfo->BundleEntryIDs) {
1296+
// TODO: Log Command (see linkBitcodeToBitcode() unbundling)
1297+
if (env::shouldEmitVerboseLogs()) {
1298+
LogS << " Extracting Bundle:\n"
1299+
<< " Input Filename: " << BundlerConfig.InputFileNames[0] << "\n"
1300+
<< " Unbundled Files Extension: ." << FileExtension << "\n";
1301+
}
1302+
1303+
for (size_t I = 0; I < ActionInfo->BundleEntryIDs.size(); I++) {
1304+
auto Entry = ActionInfo->BundleEntryIDs[I];
12981305
BundlerConfig.TargetNames.push_back(Entry);
12991306

13001307
// Add an output file for each target
@@ -1304,21 +1311,17 @@ amd_comgr_status_t AMDGPUCompiler::unbundle() {
13041311
// TODO: Switch this to LLVM path APIs
13051312
std::string OutputFilePath = OutputDir.str().str() + "/" + OutputFileName;
13061313
BundlerConfig.OutputFileNames.push_back(OutputFilePath);
1314+
1315+
if (env::shouldEmitVerboseLogs()) {
1316+
LogS << "\tBundle Entry ID: " << BundlerConfig.TargetNames[I] << "\n"
1317+
<< "\tOutput Filename: " << BundlerConfig.OutputFileNames[I]
1318+
<< "\n";
1319+
LogS.flush();
1320+
}
13071321
}
13081322

13091323
OffloadBundler Bundler(BundlerConfig);
13101324

1311-
// TODO: log vectors, build clang command
1312-
if (env::shouldEmitVerboseLogs()) {
1313-
LogS << "Extracting Bundle:\n"
1314-
<< "\t Unbundled Files Extension: ." << FileExtension << "\n"
1315-
<< "\t Bundle Entry ID: " << BundlerConfig.TargetNames[0] << "\n"
1316-
<< "\t Input Filename: " << BundlerConfig.InputFileNames[0] << "\n"
1317-
<< "\t Output Filename: " << BundlerConfig.OutputFileNames[0]
1318-
<< "\n";
1319-
LogS.flush();
1320-
}
1321-
13221325
switch (Input->DataKind) {
13231326
case AMD_COMGR_DATA_KIND_BC_BUNDLE: {
13241327
llvm::Error Err = Bundler.UnbundleFiles();

0 commit comments

Comments
 (0)