[PATCH] D117048: [OpenMP] Link the bitcode library late for device LTO

2022-01-31 Thread Joseph Huber via Phabricator via cfe-commits
This revision was landed with ongoing or failed builds. This revision was automatically updated to reflect the committed changes. Closed by commit rG3762111aa960: [OpenMP] Link the bitcode library late for device LTO (authored by jhuber6). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST

[PATCH] D117048: [OpenMP] Link the bitcode library late for device LTO

2022-01-31 Thread Joseph Huber via Phabricator via cfe-commits
jhuber6 added inline comments. Comment at: clang/tools/clang-linker-wrapper/ClangLinkerWrapper.cpp:75 +static cl::opt +BitcodeLibrary("target-library", + cl::desc("Path for the target bitcode library"), tianshilei1992 wrote: > `target-librar

[PATCH] D117048: [OpenMP] Link the bitcode library late for device LTO

2022-01-31 Thread Shilei Tian via Phabricator via cfe-commits
tianshilei1992 accepted this revision. tianshilei1992 added a comment. This revision is now accepted and ready to land. LGTM with two nits. Comment at: clang/tools/clang-linker-wrapper/ClangLinkerWrapper.cpp:75 +static cl::opt +BitcodeLibrary("target-library", +

[PATCH] D117048: [OpenMP] Link the bitcode library late for device LTO

2022-01-25 Thread Joseph Huber via Phabricator via cfe-commits
jhuber6 updated this revision to Diff 402925. jhuber6 added a comment. Squash other uncommitted changes. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D117048/new/ https://reviews.llvm.org/D117048 Files: clang/lib/Driver/ToolChains/AMDGPUOpenMP.c

[PATCH] D117048: [OpenMP] Link the bitcode library late for device LTO

2022-01-11 Thread Joseph Huber via Phabricator via cfe-commits
jhuber6 added inline comments. Comment at: clang/lib/Driver/ToolChains/Clang.cpp:8159 + std::string BitcodeSuffix; + if (TCArgs.hasFlag(options::OPT_fopenmp_target_new_runtime, + options::OPT_fno_openmp_target_new_runtime, true))

[PATCH] D117048: [OpenMP] Link the bitcode library late for device LTO

2022-01-11 Thread Jon Chesterfield via Phabricator via cfe-commits
JonChesterfield added inline comments. Comment at: clang/lib/Driver/ToolChains/AMDGPUOpenMP.cpp:268 + // Link the bitcode library late if we're using device LTO. + if (getDriver().isUsingLTO(/* IsOffload */ true)) +return; Can/should probably always link it

[PATCH] D117048: [OpenMP] Link the bitcode library late for device LTO

2022-01-11 Thread Jon Chesterfield via Phabricator via cfe-commits
JonChesterfield added a comment. Oh, right. Nvptx is still lowering to machine code per-tu. We don't want the devicertl linking as machine code, so it has to go in per-tu. Or we could link nvptx as IR instead, and send that plus amdgpu down the same code path. Probably makes applications faster

[PATCH] D117048: [OpenMP] Link the bitcode library late for device LTO

2022-01-11 Thread Joseph Huber via Phabricator via cfe-commits
jhuber6 added a comment. In D117048#3235763 , @JonChesterfield wrote: > Do we have a hook where we could link it at, uh, link time on nvtptx without > LTO? Amdgpu had a llvm-link already there. Always bothered me a little that > we link a copy per TU t

[PATCH] D117048: [OpenMP] Link the bitcode library late for device LTO

2022-01-11 Thread Jon Chesterfield via Phabricator via cfe-commits
JonChesterfield added a comment. Do we have a hook where we could link it at, uh, link time on nvtptx without LTO? Amdgpu had a llvm-link already there. Always bothered me a little that we link a copy per TU then hope the optimiser sorts it out nicely. Repository: rG LLVM Github Monorepo CH

[PATCH] D117048: [OpenMP] Link the bitcode library late for device LTO

2022-01-11 Thread Joseph Huber via Phabricator via cfe-commits
jhuber6 created this revision. jhuber6 added reviewers: jdoerfert, ronlieb, gregrodgers, JonChesterfield. Herald added subscribers: kerbowa, guansong, inglorion, yaxunl, nhaehnle, jvesely. jhuber6 requested review of this revision. Herald added subscribers: cfe-commits, sstefan1. Herald added a pr