Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade to LLVM 11 (rc2) #73526

Merged
merged 6 commits into from
Aug 23, 2020
Merged

Upgrade to LLVM 11 (rc2) #73526

merged 6 commits into from
Aug 23, 2020

Conversation

cuviper
Copy link
Member

@cuviper cuviper commented Jun 20, 2020

This builds on #73525 to try actually moving rust-lang/llvm-project to LLVM 11.

@rust-highfive
Copy link
Collaborator

@cuviper: no appropriate reviewer found, use r? to override

@rust-highfive
Copy link
Collaborator

⚠️ Warning ⚠️

  • These commits modify submodules.

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Jun 20, 2020
@cuviper
Copy link
Member Author

cuviper commented Jun 20, 2020

r? @nikic

@bors try @rust-timer queue

@rust-timer
Copy link
Collaborator

Awaiting bors try build completion

@bors
Copy link
Contributor

bors commented Jun 20, 2020

⌛ Trying commit 9e693e204b536e4ca493056004403623574515ee with merge 3850eb2b77cbad53a08dafa5cc8c355c61cfa7fc...

@bors
Copy link
Contributor

bors commented Jun 20, 2020

💔 Test failed - checks-azure

@bors bors added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Jun 20, 2020
@cuviper
Copy link
Member Author

cuviper commented Jun 20, 2020

Sorry, I hadn't pushed the latest llvm commit to that branch.

@bors try @rust-timer queue

@rust-timer
Copy link
Collaborator

Awaiting bors try build completion

@bors
Copy link
Contributor

bors commented Jun 20, 2020

⌛ Trying commit bcdd0dbb05fc69c475e1c6565449ece566f18df3 with merge 60407dcb5300e11b39bb7ecdb054f4ca12b21d06...

@cuviper
Copy link
Member Author

cuviper commented Jun 20, 2020

@bors
Copy link
Contributor

bors commented Jun 20, 2020

💔 Test failed - checks-azure

@cuviper
Copy link
Member Author

cuviper commented Jun 20, 2020

Hmm, CPU_COUNT is assumed starting in llvm/llvm-project@041a355, but while sched_getaffinity has been around as long as stated there, CPU_COUNT was only added in glibc 2.6. Our CI on CentOS 5 only has glibc 2.5.

As it happens, I also have a branch where I'm updating that to CentOS 6 (see also #62516), but that will need some kind of signoff to raise the supported OS.

@nikic
Copy link
Contributor

nikic commented Jun 20, 2020

Hmm, CPU_COUNT is assumed starting in llvm/llvm-project@041a355, but while sched_getaffinity has been around as long as stated there, CPU_COUNT was only added in glibc 2.6. Our CI on CentOS 5 only has glibc 2.5.

For now, we can just revert that commit. We already have a few workarounds for CentOS 5...

As it happens, I also have a branch where I'm updating that to CentOS 6 (see also #62516), but that will need some kind of signoff to raise the supported OS.

Let's get that started then :) This is a recurring problem, every LLVM update breaks compatibility with CentOS 5 more.

@cuviper
Copy link
Member Author

cuviper commented Jun 26, 2020

I reverted two CPU_COUNT commits, and now I have a clean docker build locally, so... 🤞

@bors try @rust-timer queue

@rust-timer
Copy link
Collaborator

Awaiting bors try build completion

@bors
Copy link
Contributor

bors commented Jun 26, 2020

⌛ Trying commit 6f91e02651a42b5deec704e07f3540eeb6cce9af with merge 5ba9571d17e40ba72702b33e2d565f807eab0446...

@bors
Copy link
Contributor

bors commented Jun 26, 2020

☀️ Try build successful - checks-azure
Build commit: 5ba9571d17e40ba72702b33e2d565f807eab0446 (5ba9571d17e40ba72702b33e2d565f807eab0446)

@rust-timer
Copy link
Collaborator

Queued 5ba9571d17e40ba72702b33e2d565f807eab0446 with parent 1033351, future comparison URL.

@rust-timer
Copy link
Collaborator

Finished benchmarking try commit (5ba9571d17e40ba72702b33e2d565f807eab0446): comparison url.

@nikic
Copy link
Contributor

nikic commented Jun 26, 2020

Huh, that's unexpected. Given that we have major check build regressions, I'm assuming this is not due to another LLVM compile-time regression, but an optimization regression that affects rustc very badly.

@cuviper
Copy link
Member Author

cuviper commented Jun 26, 2020

That will be sad if the apparent opt time wins are just by doing less optimization, especially with noticeable effects. Do you have any tips for how to track down the difference? Tracing LLVM passes or something?

@mati865
Copy link
Contributor

mati865 commented Sep 1, 2020

@cuviper regarding rust-lang/llvm-project@08116dc, rust-lld apparently does use threadpool. I'll try to take care of that but I thought you might want to know it.

@cuviper
Copy link
Member Author

cuviper commented Sep 1, 2020

@mati865 oh, ok -- is that at least falling back to a single thread as intended?

@mati865
Copy link
Contributor

mati865 commented Sep 2, 2020

@cuviper i686 windows-gnu rust-lld still works with ThinLTO enabled so I think the answer is yes.

@tspiteri
Copy link
Contributor

tspiteri commented Sep 2, 2020

@cuviper It seems that #76042 is hitting an LLVM 11 blocker. Is it a good idea to have the current beta 1.47 depend on an unreleased LLVM which still has a few blockers?

@cuviper
Copy link
Member Author

cuviper commented Sep 2, 2020

@tspiteri the compiler team explicitly approved the risk of landing pre-release: #73526 (comment)
Even after release, compilers may have bugs/regressions, so there's no perfect upgrade.

If an LLVM fix comes soon for your issue, we can backport it to our LLVM branch or pick that up in a rollup to the next 11-RC or final release. Otherwise, if we decide that your issue is a release-blocker for Rust 1.47, then this can be reverted from beta.

Dylan-DPC-zz pushed a commit to Dylan-DPC-zz/rust that referenced this pull request Sep 15, 2020
Test that bounds checks are elided for [..index] after .position()

Closes rust-lang#73396.

This was fixed by the LLVM 11 update in rust-lang#73526.
@ehuss ehuss mentioned this pull request Sep 20, 2020
@pnkfelix pnkfelix added the A-LLVM Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues. label Sep 25, 2020
bors added a commit to rust-lang-ci/rust that referenced this pull request Sep 30, 2020
…-schievink

Add support for cmse_nonsecure_entry attribute

This pull request adds the `cmse_nonsecure_entry` attribute under an unstable feature.

I was not sure if it was fine for me to send directly the pull-request or if I should submit a RFC first. I was told on Zulip that it was fine to do so but please close it if I need first submit a RFC or follow another process instead.

The `cmse_nonsecure_entry` attribute is a LLVM attribute that will be available in LLVM 11. I plan to rebase on the [upgrade PR](rust-lang#73526) once merged to make this one compile.

This attribute modifies code generation of the function as explained [here](https://developer.arm.com/documentation/ecm0359818/latest/) to make it work with the TrustZone-M hardware feature. This feature is only available on `thumbv8m` targets so I created an error for that if one tries to use this attribute for another target.

I added this attribute in Rust as any other LLVM attribute are added but since this one is target-dependent I am not sure if it was the best thing to do. Please indicate me if you think of other ways, like isolating target-dependent attributes together.

----------------

Tracking issue: rust-lang#75835
Aaron1011 added a commit to Aaron1011/rust that referenced this pull request Oct 4, 2020
This was fixed with the upgrade to LLVM 11 in rust-lang#73526.
It seems extremely unlikey that this exact issue will ever reoccur,
since slight modifications to the code caused the crash to stop
happening. However, it can't hurt to have a test for it.
bors added a commit to rust-lang-ci/rust that referenced this pull request Oct 5, 2020
…jasper

Re-land PR rust-lang#71840 (Rework MIR drop tree lowering)

PR rust-lang#71840 was reverted in rust-lang#72989 to fix an LLVM error (rust-lang#72470). That LLVM error no longer occurs with the recent upgrade to LLVM 11 (rust-lang#73526), so let's try re-landing this PR.

I've cherry-picked the commits from the original PR (with the exception of the commit blessing test output), making as few modifications as possible. I addressed the rebase fallout in separate commits on top of those.

r? `@matthewjasper`
netbsd-srcmastr pushed a commit to NetBSD/pkgsrc that referenced this pull request Nov 13, 2020
Pkgsrc changes:
 * Remove patches now integrated upstream, many related to SunOS / Illumos.
 * The LLVM fix for powerpc is also now integrated upstream.
 * Adapt those patches where the source has moved or parts are integrated.
 * The randomness patches no longer applies, and I could not find
   where those files went...
 * Provide a separate bootstrap for NetBSD/powerpc 9.0, since apparently
   the C++ ABI is different from 8.0.  Yes, this appears to be specific to
   the NetBSD powerpc ports.

Upstream changes:

Version 1.47.0 (2020-10-08)
==========================

Language
--------
- [Closures will now warn when not used.][74869]

Compiler
--------
- [Stabilized the `-C control-flow-guard` codegen option][73893], which enables
  [Control Flow Guard][1.47.0-cfg] for Windows platforms, and is ignored on
  other platforms.
- [Upgraded to LLVM 11.][73526]
- [Added tier 3\* support for the `thumbv4t-none-eabi` target.][74419]
- [Upgrade the FreeBSD toolchain to version 11.4][75204]
- [`RUST_BACKTRACE`'s output is now more compact.][75048]

\* Refer to Rust's [platform support page][forge-platform-support] for more
information on Rust's tiered platform support.

Libraries
---------
- [`CStr` now implements `Index<RangeFrom<usize>>`.][74021]
- [Traits in `std`/`core` are now implemented for arrays of any length, not just
  those of length less than 33.][74060]
- [`ops::RangeFull` and `ops::Range` now implement Default.][73197]
- [`panic::Location` now implements `Copy`, `Clone`, `Eq`, `Hash`, `Ord`,
  `PartialEq`, and `PartialOrd`.][73583]

Stabilized APIs
---------------
- [`Ident::new_raw`]
- [`Range::is_empty`]
- [`RangeInclusive::is_empty`]
- [`Result::as_deref`]
- [`Result::as_deref_mut`]
- [`Vec::leak`]
- [`pointer::offset_from`]
- [`f32::TAU`]
- [`f64::TAU`]

The following previously stable APIs have now been made const.

- [The `new` method for all `NonZero` integers.][73858]
- [The `checked_add`,`checked_sub`,`checked_mul`,`checked_neg`, `checked_shl`,
  `checked_shr`, `saturating_add`, `saturating_sub`, and `saturating_mul`
  methods for all integers.][73858]
- [The `checked_abs`, `saturating_abs`, `saturating_neg`, and `signum`  for all
  signed integers.][73858]
- [The `is_ascii_alphabetic`, `is_ascii_uppercase`, `is_ascii_lowercase`,
  `is_ascii_alphanumeric`, `is_ascii_digit`, `is_ascii_hexdigit`,
  `is_ascii_punctuation`, `is_ascii_graphic`, `is_ascii_whitespace`, and
  `is_ascii_control` methods for `char` and `u8`.][73858]

Cargo
-----
- [`build-dependencies` are now built with opt-level 0 by default.][cargo/8500]
  You can override this by setting the following in your `Cargo.toml`.
  ```toml
  [profile.release.build-override]
  opt-level = 3
  ```
- [`cargo-help` will now display man pages for commands rather just the
  `--help` text.][cargo/8456]
- [`cargo-metadata` now emits a `test` field indicating if a target has
  tests enabled.][cargo/8478]
- [`workspace.default-members` now respects `workspace.exclude`.][cargo/8485]
- [`cargo-publish` will now use an alternative registry by default if it's the
  only registry specified in `package.publish`.][cargo/8571]

Misc
----
- [Added a help button beside Rustdoc's searchbar that explains rustdoc's
  type based search.][75366]
- [Added the Ayu theme to rustdoc.][71237]

Compatibility Notes
-------------------
- [Bumped the minimum supported Emscripten version to 1.39.20.][75716]
- [Fixed a regression parsing `{} && false` in tail expressions.][74650]
- [Added changes to how proc-macros are expanded in `macro_rules!` that should
  help to preserve more span information.][73084] These changes may cause
  compiliation errors if your macro was unhygenic or didn't correctly handle
  `Delimiter::None`.
- [Moved support for the CloudABI target to tier 3.][75568]
- [`linux-gnu` targets now require minimum kernel 2.6.32 and glibc 2.11.][74163]

Internal Only
--------
- [Improved default settings for bootstrapping in `x.py`.][73964]
  You can read details about this change in the ["Changes to `x.py`
  defaults"](https://blog.rust-lang.org/inside-rust/2020/08/30/changes-to-x-py-defaults.html)
  post on the Inside Rust blog.

- [Added the `rustc-docs` component.][75560] This allows you to install
  and read the documentation for the compiler internal APIs. (Currently only
  available for `x86_64-unknown-linux-gnu`.)

[1.47.0-cfg]: https://docs.microsoft.com/en-us/windows/win32/secbp/control-flow-guard
[76980]: rust-lang/rust#76980
[75048]: rust-lang/rust#75048
[74163]: rust-lang/rust#74163
[71237]: rust-lang/rust#71237
[74869]: rust-lang/rust#74869
[73858]: rust-lang/rust#73858
[75716]: rust-lang/rust#75716
[75908]: rust-lang/rust#75908
[75516]: rust-lang/rust#75516
[75560]: rust-lang/rust#75560
[75568]: rust-lang/rust#75568
[75366]: rust-lang/rust#75366
[75204]: rust-lang/rust#75204
[74650]: rust-lang/rust#74650
[74419]: rust-lang/rust#74419
[73964]: rust-lang/rust#73964
[74021]: rust-lang/rust#74021
[74060]: rust-lang/rust#74060
[73893]: rust-lang/rust#73893
[73526]: rust-lang/rust#73526
[73583]: rust-lang/rust#73583
[73084]: rust-lang/rust#73084
[73197]: rust-lang/rust#73197
[72488]: rust-lang/rust#72488
[cargo/8456]: rust-lang/cargo#8456
[cargo/8478]: rust-lang/cargo#8478
[cargo/8485]: rust-lang/cargo#8485
[cargo/8500]: rust-lang/cargo#8500
[cargo/8571]: rust-lang/cargo#8571
[`Ident::new_raw`]:  https://doc.rust-lang.org/nightly/proc_macro/struct.Ident.html#method.new_raw
[`Range::is_empty`]: https://doc.rust-lang.org/nightly/std/ops/struct.Range.html#method.is_empty
[`RangeInclusive::is_empty`]: https://doc.rust-lang.org/nightly/std/ops/struct.RangeInclusive.html#method.is_empty
[`Result::as_deref_mut`]: https://doc.rust-lang.org/nightly/std/result/enum.Result.html#method.as_deref_mut
[`Result::as_deref`]: https://doc.rust-lang.org/nightly/std/result/enum.Result.html#method.as_deref
[`TypeId::of`]: https://doc.rust-lang.org/nightly/std/any/struct.TypeId.html#method.of
[`Vec::leak`]: https://doc.rust-lang.org/nightly/std/vec/struct.Vec.html#method.leak
[`f32::TAU`]: https://doc.rust-lang.org/nightly/std/f32/consts/constant.TAU.html
[`f64::TAU`]: https://doc.rust-lang.org/nightly/std/f64/consts/constant.TAU.html
[`pointer::offset_from`]: https://doc.rust-lang.org/nightly/std/primitive.pointer.html#method.offset_from
JohnTitor added a commit to JohnTitor/rust that referenced this pull request Jan 16, 2021
…acrum

Add a regression test for rust-lang#76281

This has been fixed between 1.47.0-nightly (663d2f5 2020-08-22) and 1.47.0-nightly (5180f3d 2020-08-23). Maybe fixed by rust-lang#73526?

Created `wasm` dir, it currently has only one test but I'll move some wasm-related tests there as a follow-up.

Closes rust-lang#76281
m-ou-se added a commit to m-ou-se/rust that referenced this pull request Jan 16, 2021
…acrum

Add a regression test for rust-lang#76281

This has been fixed between 1.47.0-nightly (663d2f5 2020-08-22) and 1.47.0-nightly (5180f3d 2020-08-23). Maybe fixed by rust-lang#73526?

Created `wasm` dir, it currently has only one test but I'll move some wasm-related tests there as a follow-up.

Closes rust-lang#76281
m-ou-se added a commit to m-ou-se/rust that referenced this pull request Jan 16, 2021
…acrum

Add a regression test for rust-lang#76281

This has been fixed between 1.47.0-nightly (663d2f5 2020-08-22) and 1.47.0-nightly (5180f3d 2020-08-23). Maybe fixed by rust-lang#73526?

Created `wasm` dir, it currently has only one test but I'll move some wasm-related tests there as a follow-up.

Closes rust-lang#76281
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-LLVM Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues. merged-by-bors This PR was explicitly merged by bors. relnotes Marks issues that should be documented in the release notes of the next release. S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.