[mlir][gpu] Let gpu::TargetOptions carry LLVM library options (#242734)

ModuleToObject creates the LLVMContext and TargetMachine for GPU
serialization without a cl::LibraryOptionsContext, so its TargetMachine
reads NVPTX, AMDGPU, CodeGen, and MC options from T::Global. Since
#242689, only LLVMParseCommandLineOptions still sets T::Global, and
#242692 removes that.

Add gpu::TargetOptions::setLibraryOptions. The NVVM, ROCDL, and XeVM
serializers pass the context to ModuleToObject, which assigns it to its
LLVMContext and points its TargetMachine at it.

LLM-aided

GitOrigin-RevId: 0d99dea85f62f385cd90723e5ddbadd6ebd8accf
7 files changed
tree: 0899a73a33b0c83e36ee9e776bc8fc7d05e0b9f0
  1. benchmark/
  2. cmake/
  3. docs/
  4. examples/
  5. include/
  6. lib/
  7. python/
  8. test/
  9. tools/
  10. unittests/
  11. utils/
  12. .clang-format
  13. .clang-tidy
  14. CMakeLists.txt
  15. LICENSE.TXT
  16. Maintainers.md
  17. README.md
README.md

Multi-Level Intermediate Representation

See https://mlir.llvm.org/ for more information.