Skip to content

Commit

Permalink
Rollup merge of #136608 - kulst:ptx_target_features, r=bjorn3
Browse files Browse the repository at this point in the history
Pass through of target features to llvm-bitcode-linker and handling them

When using the llvm-bitcode-linker (`linker-flavor=llbc`) target-features are not passed through and are not handled by it.
The llvm-bitcode-linker is mainly used as a self contained linker to link llvm bitcode for the nvptx64 target. It uses `llvm-link`, `opt` and `llc` internally. To produce a `.ptx` file of a specific ptx-version it is necessary to pass the version to llc with the `--mattr` option. Without explicitly setting it, the emitted `.ptx`-version is the minimum supported version of the `--target-cpu`.

I would like to be able to explicitly set the ptx version as [some llvm problems only occur in earlier `.ptx`-versions](llvm/llvm-project#112998).

Therefore this pull request adds support for passing target features to llvm-bitcode-linker and handling them.
I was not quite sure if adding these features to `rustc_target/src/target_features.rs` is necessary or not. If so I will gladly add these.

    r? ``@kjetilkjeka``
  • Loading branch information
workingjubilee authored Feb 20, 2025
2 parents acbe0aa + 1aac875 commit e6481ec
Showing 0 changed files with 0 additions and 0 deletions.

0 comments on commit e6481ec

Please sign in to comment.