Repository navigation
Use runCodeGen Abstraction for new LLVM - #163672
boomanaiden154 wants to merge 1 commit into
Conversation
|
r? @cuviper rustbot has assigned @cuviper. Use Why was this reviewer chosen?The reviewer was selected based on:
|
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
92b27b6 to
86c9fc2
Compare
This comment has been minimized.
This comment has been minimized.
|
r? @nikic |
| // TargetMachine::addPassesToEmitFile stores pointers to the output streams | ||
| // in a couple of places inside of the object. Explicitly delete the PM after | ||
| // we call run() to avoid dangling references. | ||
| std::unique_ptr<llvm::ToolOutputFile> DOS; |
There was a problem hiding this comment.
| std::unique_ptr<llvm::ToolOutputFile> DOS; | |
| std::unique_ptr<llvm::ToolOutputFile> DwoOS; |
There was a problem hiding this comment.
Also not sure I understand the unique_ptr here. Can this be just std::optional?
There was a problem hiding this comment.
Renamed.
It could be std::optional, but right now runCodeGenPipeline takes a reference to a std::unique_ptr, so we would need to repackage it at some point. That's mostly cargo-culting from clang. I can adjust it on the LLVM side first if you think that would be cleaner.
There was a problem hiding this comment.
Looking at how it's used, I think it would probably make the most sense to accept a raw_pwrite_stream *?
There was a problem hiding this comment.
Yeah, given that's what the underlying functions expect too.
llvm/llvm-project#235339 to update the LLVM side. I've kept the unique_ptr for the normal/buffered stream. For DwoOS I think we could use either, but using a unique_ptr for BDwoOS makes things a bit nicer given the LLVM APIs take raw pointers so we don't need to use a ternary to return nullptr if has_value() is false.
| if (DisableSimplifyLibCalls) | ||
| TLII.disableAllFunctions(); | ||
| PM->add(new TargetLibraryInfoWrapperPass(TLII)); | ||
| #if LLVM_VERSION_GE(22, 0) |
There was a problem hiding this comment.
This should no longer be needed, LLVM 22 is the minimum version.
8208452 to
49810b3
Compare
|
Some changes occurred to the CTFE / Miri interpreter cc @rust-lang/miri Some changes occurred to the intrinsics. Make sure the CTFE / Miri interpreter cc @rust-lang/miri, @RalfJung, @oli-obk, @lcnr Some changes occurred in src/tools/opt-dist cc @Kobzol
cc @rust-lang/clippy This PR changes a file inside The parser was modified, potentially altering the grammar of (stable) Rust cc @fmease
cc @TaKO8Ki Some changes occurred in src/tools/compiletest cc @jieyouxu This PR modifies If appropriate, please update This PR modifies If appropriate, please update Some changes occurred to the CTFE machinery
|
49810b3 to
ceaa153
Compare
|
Some changes occurred in engine.rs, potentially modifying the public API of cc @lcnr
cc @rust-lang/rust-analyzer changes to the core type system cc @lcnr
cc @rust-lang/rustfmt
cc @Muscraft The rustc-dev-guide subtree was changed. If your future PRs only touch the subtree, consider submitting them directly to rust-lang/rustc-dev-guide, which is where the document is primarily maintained (and has faster CI). These commits modify the If this was unintentional then you should revert the changes before this PR is merged. Some changes occurred in float parsing cc @tgross35 Some changes occurred to MIR optimizations cc @rust-lang/wg-mir-opt Some changes occurred in compiler/rustc_attr_ir cc @jdonszelmann, @JonathanBrouwer Some changes occurred in src/etc/lldb_lookup.py cc @Walnut356 Some changes occurred in src/etc/lldb_providers.py cc @Walnut356
cc @rust-lang/miri |
ceaa153 to
c6865b7
Compare
|
This PR was rebased onto a different main commit. Here's a range-diff highlighting what actually changed. Rebasing is a normal part of keeping PRs up to date, so no action is needed—this note is just to help reviewers. |
|
And of course I somehow end up rebasing a merge... Sorry for all the pings. This should be squashed now. |
| #include "llvm/Support/FileSystem.h" | ||
| #include "llvm/Support/Program.h" | ||
| #include "llvm/Support/TimeProfiler.h" | ||
| #include "llvm/Support/ToolOutputFile.h" |
There was a problem hiding this comment.
This header should no longer be needed in the latest version, I think.
There was a problem hiding this comment.
Good point, removed.
This is the abstraction that clang/flang both use. It simplifies the code by quite a bit (although not until we delete the old version). Mainly this enables the use of the NewPM for LLVM targets that opt-in (currently only Lanai and MSP430, but more soon).
c6865b7 to
b5c68b6
Compare
|
@bors r+ |
…traction, r=nikic Use runCodeGen Abstraction for new LLVM This is the abstraction that clang/flang both use. It simplifies the code by quite a bit (although not until we delete the old version). Mainly this enables the use of the NewPM for LLVM targets that opt-in (currently only Lanai and MSP430, but more soon).
…uwer Rollup of 22 pull requests Successful merges: - #159580 (Reject cfg on expressions that cannot be safely removed) - #162597 (raise ambiguity error on attribute macro that could be tool attribute) - #162808 (Enable `--generate-link-to-definition` rustdoc option on std docs) - #163059 (Recover invalid return type until `{`, `}` or `;`) - #163672 (Use runCodeGen Abstraction for new LLVM) - #164028 (Add a future incompat warning for #[no_link]) - #164188 (Suggest adding lifetime for `dyn Trait` in return type) - #164345 (fix: handle `false` in root contexts) - #164494 (drop ands which are a superset of other ands) - #164766 (Unstably introduce MVP edition migration lint `unmarked_unchecked_type_aliases` together with bikeshed attribute `#[rustc_unchecked_type_alias]`) - #164785 (delegation: emit error when there is no field for `Self` mapping) - #164799 (Don't use `IntoIterator` in parallel API) - #164871 (Refactor call argument codegen) - #164648 (parse inline and rustc_force_inline with same parser) - #164811 (fix: Prevent ICE when comparing EII impl against generic declaration) - #164900 (make tool_attrs method to retrieve tool attributes.) - #164993 (copy_nonoverlapping: dont skip ovelrap check when src is fully uninit) - #164996 (miri: add missing alignment check in write_bytes) - #165012 (Remove Span::eq_ctxt()) - #165013 ([tiny] Add missing backticks around lifetime name) - #165024 (rustdoc-search: rank re-export lower) - #165028 (Update enzyme to fix one bug related to higher-order derivatives) > [!WARNING] > This rollup conflicts with pending auto build #165042 and may need to be recreated if the pending build succeeds.
…traction, r=nikic Use runCodeGen Abstraction for new LLVM This is the abstraction that clang/flang both use. It simplifies the code by quite a bit (although not until we delete the old version). Mainly this enables the use of the NewPM for LLVM targets that opt-in (currently only Lanai and MSP430, but more soon).
…uwer Rollup of 21 pull requests Successful merges: - #159580 (Reject cfg on expressions that cannot be safely removed) - #162597 (raise ambiguity error on attribute macro that could be tool attribute) - #162808 (Enable `--generate-link-to-definition` rustdoc option on std docs) - #163059 (Recover invalid return type until `{`, `}` or `;`) - #163672 (Use runCodeGen Abstraction for new LLVM) - #164028 (Add a future incompat warning for #[no_link]) - #164188 (Suggest adding lifetime for `dyn Trait` in return type) - #164345 (fix: handle `false` in root contexts) - #164494 (drop ands which are a superset of other ands) - #164785 (delegation: emit error when there is no field for `Self` mapping) - #164799 (Don't use `IntoIterator` in parallel API) - #164871 (Refactor call argument codegen) - #164648 (parse inline and rustc_force_inline with same parser) - #164811 (fix: Prevent ICE when comparing EII impl against generic declaration) - #164900 (make tool_attrs method to retrieve tool attributes.) - #164993 (copy_nonoverlapping: dont skip ovelrap check when src is fully uninit) - #164996 (miri: add missing alignment check in write_bytes) - #165012 (Remove Span::eq_ctxt()) - #165013 ([tiny] Add missing backticks around lifetime name) - #165024 (rustdoc-search: rank re-export lower) - #165028 (Update enzyme to fix one bug related to higher-order derivatives)
View all comments
This is the abstraction that clang/flang both use. It simplifies the code by quite a bit (although not until we delete the old version). Mainly this enables the use of the NewPM for LLVM targets that opt-in (currently only Lanai and MSP430, but more soon).