LinkerWrapperOpts.td 5.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124
  1. include "llvm/Option/OptParser.td"
  2. def WrapperOnlyOption : OptionFlag;
  3. def DeviceOnlyOption : OptionFlag;
  4. def help : Flag<["--"], "help">,
  5. HelpText<"Display available options (--help-hidden for more)">;
  6. def help_hidden : Flag<["--"], "help-hidden">,
  7. HelpText<"Display all available options">;
  8. // Flags for the linker wrapper.
  9. def linker_path_EQ : Joined<["--"], "linker-path=">,
  10. Flags<[WrapperOnlyOption]>, MetaVarName<"<path>">,
  11. HelpText<"The linker executable to invoke">;
  12. def cuda_path_EQ : Joined<["--"], "cuda-path=">,
  13. Flags<[WrapperOnlyOption]>, MetaVarName<"<dir>">,
  14. HelpText<"Set the system CUDA path">;
  15. def host_triple_EQ : Joined<["--"], "host-triple=">,
  16. Flags<[WrapperOnlyOption]>, MetaVarName<"<triple>">,
  17. HelpText<"Triple to use for the host compilation">;
  18. def opt_level : Joined<["--"], "opt-level=">,
  19. Flags<[WrapperOnlyOption]>, MetaVarName<"<O0, O1, O2, or O3>">,
  20. HelpText<"Optimization level for LTO">;
  21. def bitcode_library_EQ : Joined<["--"], "bitcode-library=">,
  22. Flags<[WrapperOnlyOption]>, MetaVarName<"<kind>-<triple>-<arch>=<path>">,
  23. HelpText<"Extra bitcode library to link">;
  24. def device_linker_args_EQ : Joined<["--"], "device-linker=">,
  25. Flags<[WrapperOnlyOption]>, MetaVarName<"<value> or <triple>=<value>">,
  26. HelpText<"Arguments to pass to the device linker invocation">;
  27. def dry_run : Flag<["--"], "dry-run">,
  28. Flags<[WrapperOnlyOption]>,
  29. HelpText<"Print program arguments without running">;
  30. def verbose : Flag<["--"], "wrapper-verbose">,
  31. Flags<[WrapperOnlyOption]>, HelpText<"Verbose output from tools">;
  32. def embed_bitcode : Flag<["--"], "embed-bitcode">,
  33. Flags<[WrapperOnlyOption]>, HelpText<"Embed linked bitcode in the module">;
  34. def debug : Flag<["--"], "device-debug">, Flags<[WrapperOnlyOption]>,
  35. HelpText<"Use debugging">;
  36. def ptxas_arg : Joined<["--"], "ptxas-arg=">,
  37. Flags<[WrapperOnlyOption]>,
  38. HelpText<"Argument to pass to the 'ptxas' invocation">;
  39. def pass_remarks_EQ : Joined<["--"], "pass-remarks=">,
  40. Flags<[WrapperOnlyOption]>, HelpText<"Pass remarks for LTO">;
  41. def pass_remarks_missed_EQ : Joined<["--"], "pass-remarks-missed=">,
  42. Flags<[WrapperOnlyOption]>, HelpText<"Pass remarks for LTO">;
  43. def pass_remarks_analysis_EQ : Joined<["--"], "pass-remarks-analysis=">,
  44. Flags<[WrapperOnlyOption]>, HelpText<"Pass remarks for LTO">;
  45. def print_wrapped_module : Flag<["--"], "print-wrapped-module">,
  46. Flags<[WrapperOnlyOption]>,
  47. HelpText<"Print the wrapped module's IR for testing">;
  48. def save_temps : Flag<["--"], "save-temps">,
  49. Flags<[WrapperOnlyOption]>, HelpText<"Save intermediate results">;
  50. def wrapper_time_trace_eq : Joined<["--"], "wrapper-time-trace=">,
  51. Flags<[WrapperOnlyOption]>, MetaVarName<"<file>">,
  52. HelpText<"Enable time-trace and write the output to <file>">;
  53. def wrapper_time_trace_granularity : Joined<["--"], "wrapper-time-trace-granularity=">,
  54. Flags<[WrapperOnlyOption]>, MetaVarName<"<number>">,
  55. HelpText<"Set the granularity of time-trace updates">;
  56. def wrapper_jobs : Joined<["--"], "wrapper-jobs=">,
  57. Flags<[WrapperOnlyOption]>, MetaVarName<"<number>">,
  58. HelpText<"Sets the number of parallel jobs to use for device linking">;
  59. // Flags passed to the device linker.
  60. def arch_EQ : Joined<["--"], "arch=">,
  61. Flags<[DeviceOnlyOption, HelpHidden]>, MetaVarName<"<arch>">,
  62. HelpText<"The device subarchitecture">;
  63. def triple_EQ : Joined<["--"], "triple=">,
  64. Flags<[DeviceOnlyOption, HelpHidden]>, MetaVarName<"<triple>">,
  65. HelpText<"The device target triple">;
  66. def whole_program : Flag<["--"], "whole-program">,
  67. Flags<[DeviceOnlyOption, HelpHidden]>,
  68. HelpText<"LTO has visibility of all input files">;
  69. def linker_arg_EQ : Joined<["--"], "linker-arg=">,
  70. Flags<[DeviceOnlyOption, HelpHidden]>,
  71. HelpText<"An extra argument to be passed to the linker">;
  72. // Separator between the linker wrapper and host linker flags.
  73. def separator : Flag<["--"], "">, Flags<[WrapperOnlyOption]>,
  74. HelpText<"The separator for the wrapped linker arguments">;
  75. // Arguments for the LLVM backend.
  76. def mllvm : Separate<["-"], "mllvm">, Flags<[WrapperOnlyOption]>,
  77. MetaVarName<"<arg>">, HelpText<"Arguments passed to the LLVM invocation">;
  78. def offload_opt_eq_minus : Joined<["--", "-"], "offload-opt=-">, Flags<[HelpHidden, WrapperOnlyOption]>,
  79. HelpText<"Options passed to LLVM">;
  80. // Standard linker flags also used by the linker wrapper.
  81. def sysroot_EQ : Joined<["--"], "sysroot">, HelpText<"Set the system root">;
  82. def o : JoinedOrSeparate<["-"], "o">, MetaVarName<"<path>">,
  83. HelpText<"Path to file to write output">;
  84. def output_EQ : Joined<["--"], "output=">, Alias<o>, Flags<[HelpHidden]>,
  85. HelpText<"Alias for -o">;
  86. def output : Separate<["--"], "output">, Alias<o>, Flags<[HelpHidden]>,
  87. HelpText<"Alias for -o">;
  88. def library_path : JoinedOrSeparate<["-"], "L">, MetaVarName<"<dir>">,
  89. HelpText<"Add <dir> to the library search path">;
  90. def library_path_S : Separate<["--", "-"], "library-path">, Flags<[HelpHidden]>,
  91. Alias<library_path>;
  92. def library_path_EQ : Joined<["--", "-"], "library-path=">, Flags<[HelpHidden]>,
  93. Alias<library_path>;
  94. def library : JoinedOrSeparate<["-"], "l">, MetaVarName<"<libname>">,
  95. HelpText<"Search for library <libname>">;
  96. def library_S : Separate<["--", "-"], "library">, Flags<[HelpHidden]>,
  97. Alias<library_path>;
  98. def library_EQ : Joined<["--", "-"], "library=">, Flags<[HelpHidden]>,
  99. Alias<library_path>;
  100. def as_needed : Flag<["--", "-"], "as-needed">;
  101. def no_as_needed : Flag<["--", "-"], "no-as-needed">;
  102. def rpath : Separate<["--", "-"], "rpath">;
  103. def rpath_EQ : Joined<["--", "-"], "rpath=">, Flags<[HelpHidden]>, Alias<rpath>;
  104. def dynamic_linker : Separate<["--", "-"], "dynamic-linker">;
  105. def dynamic_linker_EQ : Joined<["--", "-"], "dynamic-linker=">, Alias<dynamic_linker>;
  106. def v : Flag<["--", "-"], "v">, HelpText<"Display the version number and exit">;
  107. def version : Flag<["--", "-"], "version">, Flags<[HelpHidden]>, Alias<v>;