-
Notifications
You must be signed in to change notification settings - Fork 12.9k
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's master branch (LLVM 7) #51966
Conversation
r? @varkor (rust_highfive has picked a reviewer for you, use r? to override) |
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.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
OptLevel::Less => "-O1", | ||
OptLevel::Default => "-O2", | ||
OptLevel::Aggressive => "-O3", | ||
OptLevel::Size => "-O2", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If this is intentional, it'd be helpful to have a comment here to explain why -O2
is used for the size opt levels (as opposed to -Os
and -Oz
).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure thing!
Everything looks reasonable to me, but it'd be better to have someone more familiar check over this. |
This comment has been minimized.
This comment has been minimized.
abbd4fc
to
aa667e3
Compare
1e57200
to
f29cd71
Compare
Now that https://bugs.llvm.org/show_bug.cgi?id=37382 is fixed I've updated to bring back the thumbv6m build |
Oh one thing I forgot to mention in the OP as well is that there's a change to |
@bors: try |
⌛ Trying commit f29cd71c42d5099fd693e040f3802dc1c9548070 with merge b77640fe5342825939a1222f847c753f7b3c0968... |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
☀️ Test successful - status-appveyor, status-travis |
Set opt-level = 3 the third time. This PR reverts #51165 (set -O2 to fix #50867), which reverted #50329 (set -O3), which was second attempt of #48204 (set -O3, closed due to Windows segfault that is fixed now), which reverted #42123 (set -O2 to fix spurious Windows segfaults), which reverted #41967 (set -O3). Last time we've found that setting -O3 regressed the wall time of NLL (#50329 (comment)), so we may need another perf run to confirm. I'd like to check this *after* the LLVM 7 upgrade #51966 has been merged, so marking this as <kbd>S-blocked</kbd> for now.
Hm, this was a suspiciously smooth upgrade... |
Perf regressions showed up on perf.rust-lang.org as expected: Then there was a slight improvement immediately afterward due to #51230: |
|
Sure! |
…excrichton Update llvm-rebuild-trigger in light of LLVM 7 upgrade Not triggering a LLVM rebuild [since the LLVM 7 upgrade](rust-lang#51966 (comment)) causes builds of rustc to fail. r? @alexcrichton
…excrichton Update llvm-rebuild-trigger in light of LLVM 7 upgrade Not triggering a LLVM rebuild [since the LLVM 7 upgrade](rust-lang#51966 (comment)) causes builds of rustc to fail. r? @alexcrichton
…excrichton Update llvm-rebuild-trigger in light of LLVM 7 upgrade Not triggering a LLVM rebuild [since the LLVM 7 upgrade](rust-lang#51966 (comment)) causes builds of rustc to fail. r? @alexcrichton
Set opt-level = 3 the third time. This PR reverts #51165 (set -O2 for fixing #50867), which reverted #50329 (set -O3), which was second attempt of #48204 (set -O3, closed due to Windows segfault that is fixed now), which reverted #42123 (set -O2 to fix spurious Windows segfaults), which reverted #41967 (set -O3). Since we have found the root cause of #50867, this optimization could be tried again. Last time we've found that setting -O3 regressed the wall time of NLL (#50329 (comment)), so we may need another perf run to confirm. I'd like to check this *after* the LLVM 7 upgrade #51966 has been merged, so marking this as <kbd>S-blocked</kbd> for now.
@@ -57,7 +57,7 @@ struct CheckAttrVisitor<'a, 'tcx: 'a> { | |||
impl<'a, 'tcx> CheckAttrVisitor<'a, 'tcx> { | |||
/// Check any attribute. | |||
fn check_attributes(&self, item: &hir::Item, target: Target) { | |||
if target == Target::Fn { | |||
if target == Target::Fn || target == Target::Const { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@alexcrichton: what motivated this change?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Uh... well it's been over a year, so this is way out of cache. I suspect this was done to handle wasm attribute validation, but you are wondering you can remove this then seems fine to remove it.
Current status
Blocked on a performance regression. The performance regression has an upstream LLVM issue and has also been bisected to an LLVM revision.Ready to merge!
This commit upgrades the main LLVM submodule to LLVM's current master branch.
The LLD submodule is updated in tandem as well as compiler-builtins.
Along the way support was also added for LLVM 7's new features. This primarily
includes the support for custom section concatenation natively in LLD so we now
add wasm custom sections in LLVM IR rather than having custom support in rustc
itself for doing so.
Some other miscellaneous changes are:
--gc-sections
towasm-ld
wasm-ld
--stack-first
option is passed to LLD to have stack overflow always causea trap instead of corrupting static data
wasm32-unknown-unknown
.to reflect this.
Thethumbv6m-none-eabi
target is disabled due to an LLVM bugNowadays we've been mostly only upgrading whenever there's a major release of
LLVM but enough changes have been happening on the wasm target that there's been
growing motivation for quite some time now to upgrade out version of LLD. To
upgrade LLD, however, we need to upgrade LLVM to avoid needing to build yet
another version of LLVM on the builders.
The revision of LLVM in use here is arbitrarily chosen. We will likely need to
continue to update it over time if and when we discover bugs. Once LLVM 7 is
fully released we can switch to that channel as well.
cc #50543