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

Add range attribute to scalar function results and arguments #128371

Merged
merged 1 commit into from
Aug 12, 2024

Conversation

andjo403
Copy link
Contributor

@andjo403 andjo403 commented Jul 29, 2024

as LLVM 19 adds the range attribute this starts to use it for better optimization.
hade been interesting to see a perf run with the #127513

closes #50156
cc #49572 shall be fixed but not possible to see as there is asserts that already trigger the optimization.

@rustbot
Copy link
Collaborator

rustbot commented Jul 29, 2024

r? @compiler-errors

rustbot has assigned @compiler-errors.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Jul 29, 2024

use std::num::NonZero;

// CHECK: noundef range(i64 1, 0) i64 @nonzero_int(i64 noundef range(i64 1, 0) %x)
Copy link
Contributor

@tgross35 tgross35 Jul 29, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you can do

Suggested change
// CHECK: noundef range(i64 1, 0) i64 @nonzero_int(i64 noundef range(i64 1, 0) %x)
// CHECK-LABEL: @nonzero_int
// CHECK-SAME: noundef range(i64 1, 0) i64 @nonzero_int(i64 noundef range(i64 1, 0) %x)

so you get the better section splitting from CHECK-LABEL if the line doesn't match for some reason.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CHECK-SAME will start matching after the CHECK-LABEL so it is not possible to verify that the result get a range applied in that case unless it is moved to the CHECK-LABEL like
CHECK-LABEL: noundef range(i64 1, 0) i64 @nonzero_int
and then it feels like a CHECK is better

Comment on lines 419 to 428
let apply_range_attr = |idx: AttributePlace, abi: rustc_target::abi::Abi| {
if cx.sess().opts.optimize != config::OptLevel::No
&& llvm_util::get_version() >= (19, 0, 0)
{
if let abi::Abi::Scalar(scalar) = abi {
// If the value is a boolean, the range is 0..2 and that ultimately
// become 0..0 when the type becomes i1, which would be rejected
// by the LLVM verifier.
if let Int(..) = scalar.primitive() {
if !scalar.is_bool() && !scalar.is_always_valid(cx) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't quote me on this but I think it is okay to use let chains in the compiler to avoid all this nesting

Suggested change
let apply_range_attr = |idx: AttributePlace, abi: rustc_target::abi::Abi| {
if cx.sess().opts.optimize != config::OptLevel::No
&& llvm_util::get_version() >= (19, 0, 0)
{
if let abi::Abi::Scalar(scalar) = abi {
// If the value is a boolean, the range is 0..2 and that ultimately
// become 0..0 when the type becomes i1, which would be rejected
// by the LLVM verifier.
if let Int(..) = scalar.primitive() {
if !scalar.is_bool() && !scalar.is_always_valid(cx) {
let apply_range_attr = |idx: AttributePlace, abi: rustc_target::abi::Abi| {
if cx.sess().opts.optimize != config::OptLevel::No
&& llvm_util::get_version() >= (19, 0, 0)
&& let abi::Abi::Scalar(scalar) = abi
// If the value is a boolean, the range is 0..2 and that ultimately
// become 0..0 when the type becomes i1, which would be rejected
// by the LLVM verifier.
&& matches!(scalar.primitive(), Int(..))
&& !scalar.is_bool() && !scalar.is_always_valid(cx) {

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes please

Copy link
Contributor

@tgross35 tgross35 Jul 29, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One day that will stable :(

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice did not think it was possible to do that.

@tgross35 tgross35 added the S-blocked Status: Marked as blocked ❌ on something else such as an RFC or other implementation work. label Jul 29, 2024
@tgross35
Copy link
Contributor

tgross35 commented Jul 29, 2024

Marking as blocked on #127513, which hopefully won't be too far away.

Also, thanks for pushing this forward on both the Rust and LLVM side. The results will be awesome :)

Copy link
Contributor

@erikdesjardins erikdesjardins left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's great to see this!

Ideally you'll be able to revert the assumes added in #103584, now that we can represent this range info properly. (in another PR, perhaps)

Comment on lines +1 to +2
// Checks that range metadata gets emitted on functions result and arguments
// with scalar value.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some more tests that would be nice:

  • slice length (I don't think that will get range attributes yet, but when it does, it'll resolve Add unreachable hints for length getters? #106737. Having a test is still useful whether it gets the attribute or not, just to show the current state.)
  • discriminant of an enum with a payload (one that gets scalarpair layout) e.g. enum Foo { A(u64), B(u64), C(u64) }.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks to rust-lang/reference#1499 we're allowed to do this for slices, and per #122926 (comment) it has a decent chance to save a couple megs off the compiler size. So excited to get to do it with range attributes, since doing it with assumes was perf-horrible.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

think that I have added the test that you wanted. I'm letting someone more familiar create a PR for adding the range on slices.

@nikic
Copy link
Contributor

nikic commented Jul 31, 2024

@bors try @rust-timer queue

@rust-timer

This comment has been minimized.

@rustbot rustbot added the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Jul 31, 2024
@bors
Copy link
Contributor

bors commented Jul 31, 2024

⌛ Trying commit 5ff174c with merge b8ab1d7...

bors added a commit to rust-lang-ci/rust that referenced this pull request Jul 31, 2024
Add range attribute to scalar function results and arguments

as LLVM 19 adds the range attribute this starts to use it for better optimization.
hade been interesting to see a perf run with the rust-lang#127513

closes rust-lang#50156
cc rust-lang#49572 shall be fixed but not possible to see as there is asserts that already trigger the optimization.

r​? `@nikic`
@bors
Copy link
Contributor

bors commented Jul 31, 2024

☀️ Try build successful - checks-actions
Build commit: b8ab1d7 (b8ab1d77f3f3c9e0b913842d10cc6b21af0c746a)

@rust-timer

This comment has been minimized.

@rust-timer
Copy link
Collaborator

Finished benchmarking commit (b8ab1d7): comparison URL.

Overall result: ✅ improvements - no action needed

Benchmarking this pull request likely means that it is perf-sensitive, so we're automatically marking it as not fit for rolling up. While you can manually mark this PR as fit for rollup, we strongly recommend not doing so since this PR may lead to changes in compiler perf.

@bors rollup=never
@rustbot label: -S-waiting-on-perf -perf-regression

Instruction count

This is a highly reliable metric that was used to determine the overall result at the top of this comment.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-1.1% [-1.1%, -1.1%] 1
All ❌✅ (primary) - - 0

Max RSS (memory usage)

This benchmark run did not return any relevant results for this metric.

Cycles

Results (primary 3.4%)

This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.

mean range count
Regressions ❌
(primary)
3.4% [3.4%, 3.4%] 1
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) 3.4% [3.4%, 3.4%] 1

Binary size

This benchmark run did not return any relevant results for this metric.

Bootstrap: 755.634s -> 754.893s (-0.10%)
Artifact size: 336.68 MiB -> 336.66 MiB (-0.01%)

@rustbot rustbot removed the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Aug 1, 2024
@andjo403
Copy link
Contributor Author

andjo403 commented Aug 1, 2024

This is not blocked anymore now after the rebase and the perf was ok.

@@ -20,8 +20,6 @@ pub fn u32_index(c: u32) -> [bool; 22] {
// CHECK-LABEL: @char_as_u32_index
#[no_mangle]
pub fn char_as_u32_index(c: char) -> [bool; 22] {
// CHECK: %[[B:.+]] = icmp ult i32 %c, 1114112
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is optimized away when the range is added to the input. I only removed it as it do not seem important for the test and more a nice to have check. otherwise I do not know how to update this test.

Copy link
Contributor

@erikdesjardins erikdesjardins Aug 1, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe the CHECK-NOT: call core::panicking::panic below, ensuring that the bounds check gets optimized out, is the important part of this test. Since that still works, I think the spirit of this test is upheld.

You can/should remove the assume (added in https://github.com/rust-lang/rust/pull/124905/files#diff-db08b7c8b00530c7183cf2e42f25dc93b02da93fb40edadbd009eee6ad60e3a1R298-R302) now that it gets optimized out anyways. (Probably need to add min-llvm-version to the test in that case, which is fine.)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do that assume not add value if the cast is not on an input/result of a function call ?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can leave it there for now, I'll take a look at it in a separate PR.

Technically yes, it could be beneficial. Although, after this PR, we'll have range metadata on loads, arguments, and returns, which covers the vast majority of cases where new values are "introduced" into a function. I think it's unlikely that handing the remaining rare cases would be worthwhile, given that adding assumes costs a bit of compile time and can block other optimizations.

@andjo403
Copy link
Contributor Author

andjo403 commented Aug 1, 2024

@rustbot ready


// CHECK: noundef range(i8 0, 4) i8 @enum1_value(i8 noundef range(i8 0, 4) %x)
#[no_mangle]
pub fn enum1_value(x: Enum0) -> Enum0 {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
pub fn enum1_value(x: Enum0) -> Enum0 {
pub fn enum1_value(x: Enum1) -> Enum1 {

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed

Comment on lines 41 to 50
// CHECK: define { i64, i64 } @enum1_value(i64 noundef %x.0, i64 noundef %x.1)
#[no_mangle]
pub fn enum1_value(x: Enum1) -> Enum1 {
x
}
Copy link
Contributor

@erikdesjardins erikdesjardins Aug 2, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm, this should be getting a range attribute, we definitely set the valid range for discriminants. I suspect...

Comment on lines 419 to 436
let apply_range_attr = |idx: AttributePlace, abi: rustc_target::abi::Abi| {
if cx.sess().opts.optimize != config::OptLevel::No
&& llvm_util::get_version() >= (19, 0, 0)
&& let abi::Abi::Scalar(scalar) = abi
&& matches!(scalar.primitive(), Int(..))
// If the value is a boolean, the range is 0..2 and that ultimately
// become 0..0 when the type becomes i1, which would be rejected
// by the LLVM verifier.
&& !scalar.is_bool()
// LLVM also rejects full range.
&& !scalar.is_always_valid(cx)
{
attributes::apply_to_llfn(
llfn,
idx,
&[llvm::CreateRangeAttr(cx.llcx, scalar.size(cx), scalar.valid_range(cx))],
);
}
};
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

...that this isn't called in enough places. Instead of building the attribute here, I would suggest:

  • add a valid_range field to struct ArgAttributes
  • set valid_range in adjust_for_rust_scalar when applicable
  • call llvm::CreateRangeAttr in rustc_codegen_llvm::abi::get_attrs, based on the value of valid_range

Then the existing code should handle the rest.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This solution seems to use a lot more memory if I add a valid_range_and_num_bits: Option<(WrappingRange, u32)> to ArgAttributes the ArgAbi size goes from 56 to 192 and FnAbi from 80 to 224 and the WrappingRange will not be interned but the layout is so even the same types will result in same ranges manytimes.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

updated scalarPair also to avoid undoing the work from #100999 but there maybe is some good reason to do like you suggested like other backends want to use the data also.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is the size of ArgAttributes / FnAbi sensitive? I'd have hoped they only exist temporarily while lowering a call/declaration, but maybe that's not the case.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@rust-log-analyzer

This comment has been minimized.

@nikic
Copy link
Contributor

nikic commented Aug 7, 2024

@bors r+

@andjo403
Copy link
Contributor Author

managed to run the DEPLOY=1 ./src/ci/docker/run.sh test-various with the latest commit but
DEPLOY=1 ./src/ci/docker/run.sh i686-gnu fails both on master and this commit for me so seems unrelated.

@nikic
Copy link
Contributor

nikic commented Aug 12, 2024

@bors r+

@bors
Copy link
Contributor

bors commented Aug 12, 2024

📌 Commit cfadfab has been approved by nikic

It is now in the queue for this repository.

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Aug 12, 2024
@bors
Copy link
Contributor

bors commented Aug 12, 2024

⌛ Testing commit cfadfab with merge 9392a60...

bors added a commit to rust-lang-ci/rust that referenced this pull request Aug 12, 2024
Add range attribute to scalar function results and arguments

as LLVM 19 adds the range attribute this starts to use it for better optimization.
hade been interesting to see a perf run with the rust-lang#127513

closes rust-lang#50156
cc rust-lang#49572 shall be fixed but not possible to see as there is asserts that already trigger the optimization.
@rust-log-analyzer
Copy link
Collaborator

The job dist-x86_64-msvc failed! Check out the build log: (web) (plain)

Click to see the possible cause of the failure (guessed by this bot)
[2024-08-12T08:57:09Z DEBUG collector::compile::benchmark] Benchmark iteration 1/1
[2024-08-12T08:57:09Z INFO  collector::compile::execute] run_rustc with incremental=false, profile=Check, scenario=Some(Full), patch=None, backend=Llvm, phase=benchmark
[2024-08-12T08:57:09Z DEBUG collector::compile::execute] "\\\\?\\C:\\a\\rust\\rust\\build\\x86_64-pc-windows-msvc\\stage0\\bin\\cargo.exe" "rustc" "--manifest-path" "Cargo.toml" "-p" "path+file:///C:/a/_temp/msys64/tmp/.tmpXRHLmm#ctfe-stress-5@0.1.0" "--profile" "check" "--" "--wrap-rustc-with" "Eprintln"
[2024-08-12T08:57:14Z INFO  collector::compile::execute] run_rustc with incremental=true, profile=Check, scenario=Some(IncrFull), patch=None, backend=Llvm, phase=benchmark
[2024-08-12T08:57:14Z DEBUG collector::compile::execute] "\\\\?\\C:\\a\\rust\\rust\\build\\x86_64-pc-windows-msvc\\stage0\\bin\\cargo.exe" "rustc" "--manifest-path" "Cargo.toml" "-p" "path+file:///C:/a/_temp/msys64/tmp/.tmpXRHLmm#ctfe-stress-5@0.1.0" "--profile" "check" "--" "--wrap-rustc-with" "Eprintln" "-C" "incremental=C:\\a\\_temp\\msys64\\tmp\\.tmpXRHLmm\\incremental-state"
[2024-08-12T08:57:20Z INFO  collector::compile::execute] run_rustc with incremental=true, profile=Check, scenario=Some(IncrUnchanged), patch=None, backend=Llvm, phase=benchmark
[2024-08-12T08:57:20Z DEBUG collector::compile::execute] "\\\\?\\C:\\a\\rust\\rust\\build\\x86_64-pc-windows-msvc\\stage0\\bin\\cargo.exe" "rustc" "--manifest-path" "Cargo.toml" "-p" "path+file:///C:/a/_temp/msys64/tmp/.tmpXRHLmm#ctfe-stress-5@0.1.0" "--profile" "check" "--" "--wrap-rustc-with" "Eprintln" "-C" "incremental=C:\\a\\_temp\\msys64\\tmp\\.tmpXRHLmm\\incremental-state"
[2024-08-12T08:57:20Z DEBUG collector::compile::benchmark] Benchmark iteration 1/1
[2024-08-12T08:57:20Z INFO  collector::compile::execute] run_rustc with incremental=false, profile=Debug, scenario=Some(Full), patch=None, backend=Llvm, phase=benchmark
[2024-08-12T08:57:20Z DEBUG collector::compile::execute] "\\\\?\\C:\\a\\rust\\rust\\build\\x86_64-pc-windows-msvc\\stage0\\bin\\cargo.exe" "rustc" "--manifest-path" "Cargo.toml" "-p" "path+file:///C:/a/_temp/msys64/tmp/.tmpweH6um#ctfe-stress-5@0.1.0" "--" "--wrap-rustc-with" "Eprintln"
[2024-08-12T08:57:26Z INFO  collector::compile::execute] run_rustc with incremental=true, profile=Debug, scenario=Some(IncrFull), patch=None, backend=Llvm, phase=benchmark
---
   Compiling rustc_driver v0.0.0 (C:\a\rust\rust\compiler\rustc_driver)
[RUSTC-TIMING] rustc_driver test:false 5.120
error: linking with `link.exe` failed: exit code: 1104
  |
  = note: "C:\\Program Files\\Microsoft Visual Studio\\2022\\Enterprise\\VC\\Tools\\MSVC\\14.40.33807\\bin\\HostX64\\x64\\link.exe" "/NOLOGO" "C:\\a\\_temp\\msys64\\tmp\\rustcBM1zZI\\symbols.o" "C:\\a\\rust\\rust\\build\\x86_64-pc-windows-msvc\\stage1-rustc\\x86_64-pc-windows-msvc\\release\\deps\\rustc_main-abe621a284360afc.rustc_main.3d10d463641474e1-cgu.0.rcgu.o" "C:\\a\\rust\\rust\\build\\x86_64-pc-windows-msvc\\stage1-rustc\\x86_64-pc-windows-msvc\\release\\deps\\rustc_driver-99a7fdabd5344319.dll.lib" "C:\\a\\rust\\rust\\build\\x86_64-pc-windows-msvc\\stage1\\lib\\rustlib\\x86_64-pc-windows-msvc\\lib\\libcompiler_builtins-0a4b04fca3ab5f90.rlib" "psapi.lib" "shell32.lib" "ole32.lib" "uuid.lib" "advapi32.lib" "ws2_32.lib" "ntdll.lib" "advapi32.lib" "kernel32.lib" "ole32.lib" "oleaut32.lib" "bcrypt.lib" "advapi32.lib" "advapi32.lib" "cfgmgr32.lib" "gdi32.lib" "kernel32.lib" "msimg32.lib" "opengl32.lib" "user32.lib" "winspool.lib" "legacy_stdio_definitions.lib" "kernel32.lib" "advapi32.lib" "ntdll.lib" "userenv.lib" "ws2_32.lib" "kernel32.lib" "kernel32.lib" "/defaultlib:libcmt" "C:\\a\\_temp\\msys64\\tmp\\rustcBM1zZI\\advapi32.dll_imports_indirect.lib" "C:\\a\\_temp\\msys64\\tmp\\rustcBM1zZI\\api-ms-win-core-errorhandling-l1-1-3.dll_imports_indirect.lib" "C:\\a\\_temp\\msys64\\tmp\\rustcBM1zZI\\api-ms-win-core-file-fromapp-l1-1-0.dll_imports_indirect.lib" "C:\\a\\_temp\\msys64\\tmp\\rustcBM1zZI\\api-ms-win-core-handle-l1-1-0.dll_imports_indirect.lib" "C:\\a\\_temp\\msys64\\tmp\\rustcBM1zZI\\api-ms-win-core-ioring-l1-1-0.dll_imports_indirect.lib" "C:\\a\\_temp\\msys64\\tmp\\rustcBM1zZI\\api-ms-win-core-synch-l1-2-0.dll_imports_indirect.lib" "C:\\a\\_temp\\msys64\\tmp\\rustcBM1zZI\\api-ms-win-core-sysinfo-l1-2-0.dll_imports_indirect.lib" "C:\\a\\_temp\\msys64\\tmp\\rustcBM1zZI\\api-ms-win-core-sysinfo-l1-2-3.dll_imports_indirect.lib" "C:\\a\\_temp\\msys64\\tmp\\rustcBM1zZI\\api-ms-win-core-sysinfo-l1-2-4.dll_imports_indirect.lib" "C:\\a\\_temp\\msys64\\tmp\\rustcBM1zZI\\api-ms-win-core-util-l1-1-1.dll_imports_indirect.lib" "C:\\a\\_temp\\msys64\\tmp\\rustcBM1zZI\\api-ms-win-core-wow64-l1-1-1.dll_imports_indirect.lib" "C:\\a\\_temp\\msys64\\tmp\\rustcBM1zZI\\api-ms-win-security-base-l1-2-2.dll_imports_indirect.lib" "C:\\a\\_temp\\msys64\\tmp\\rustcBM1zZI\\avrt.dll_imports_indirect.lib" "C:\\a\\_temp\\msys64\\tmp\\rustcBM1zZI\\bcp47mrm.dll_imports_indirect.lib" "C:\\a\\_temp\\msys64\\tmp\\rustcBM1zZI\\bcryptprimitives.dll_imports_indirect.lib" "C:\\a\\_temp\\msys64\\tmp\\rustcBM1zZI\\clfsw32.dll_imports_indirect.lib" "C:\\a\\_temp\\msys64\\tmp\\rustcBM1zZI\\dbghelp.dll_imports_indirect.lib" "C:\\a\\_temp\\msys64\\tmp\\rustcBM1zZI\\elscore.dll_imports_indirect.lib" "C:\\a\\_temp\\msys64\\tmp\\rustcBM1zZI\\fwpuclnt.dll_imports_indirect.lib" "C:\\a\\_temp\\msys64\\tmp\\rustcBM1zZI\\gdi32.dll_imports_indirect.lib" "C:\\a\\_temp\\msys64\\tmp\\rustcBM1zZI\\icu.dll_imports_indirect.lib" "C:\\a\\_temp\\msys64\\tmp\\rustcBM1zZI\\imagehlp.dll_imports_indirect.lib" "C:\\a\\_temp\\msys64\\tmp\\rustcBM1zZI\\iphlpapi.dll_imports_indirect.lib" "C:\\a\\_temp\\msys64\\tmp\\rustcBM1zZI\\kernel32.dll_imports_indirect.lib" "C:\\a\\_temp\\msys64\\tmp\\rustcBM1zZI\\ktmw32.dll_imports_indirect.lib" "C:\\a\\_temp\\msys64\\tmp\\rustcBM1zZI\\mswsock.dll_imports_indirect.lib" "C:\\a\\_temp\\msys64\\tmp\\rustcBM1zZI\\netapi32.dll_imports_indirect.lib" "C:\\a\\_temp\\msys64\\tmp\\rustcBM1zZI\\normaliz.dll_imports_indirect.lib" "C:\\a\\_temp\\msys64\\tmp\\rustcBM1zZI\\ntdll.dll_imports_indirect.lib" "C:\\a\\_temp\\msys64\\tmp\\rustcBM1zZI\\ntdllk.dll_imports_indirect.lib" "C:\\a\\_temp\\msys64\\tmp\\rustcBM1zZI\\ole32.dll_imports_indirect.lib" "C:\\a\\_temp\\msys64\\tmp\\rustcBM1zZI\\oleaut32.dll_imports_indirect.lib" "C:\\a\\_temp\\msys64\\tmp\\rustcBM1zZI\\psapi.dll_imports_indirect.lib" "C:\\a\\_temp\\msys64\\tmp\\rustcBM1zZI\\rtworkq.dll_imports_indirect.lib" "C:\\a\\_temp\\msys64\\tmp\\rustcBM1zZI\\txfw32.dll_imports_indirect.lib" "C:\\a\\_temp\\msys64\\tmp\\rustcBM1zZI\\user32.dll_imports_indirect.lib" "C:\\a\\_temp\\msys64\\tmp\\rustcBM1zZI\\usp10.dll_imports_indirect.lib" "C:\\a\\_temp\\msys64\\tmp\\rustcBM1zZI\\version.dll_imports_indirect.lib" "C:\\a\\_temp\\msys64\\tmp\\rustcBM1zZI\\windows.networking.dll_imports_indirect.lib" "C:\\a\\_temp\\msys64\\tmp\\rustcBM1zZI\\wofutil.dll_imports_indirect.lib" "C:\\a\\_temp\\msys64\\tmp\\rustcBM1zZI\\ws2_32.dll_imports_indirect.lib" "/NXCOMPAT" "/LIBPATH:C:\\Program Files\\Microsoft Visual Studio\\2022\\Enterprise\\VC\\Tools\\MSVC\\14.40.33807\\atlmfc\\lib\\x64" "/LIBPATH:C:\\a\\rust\\rust\\build\\x86_64-pc-windows-msvc\\stage1-rustc\\x86_64-pc-windows-msvc\\release\\build\\stacker-7601138db8f1aeb3\\out" "/LIBPATH:C:\\Program Files\\Microsoft Visual Studio\\2022\\Enterprise\\VC\\Tools\\MSVC\\14.40.33807\\atlmfc\\lib\\x64" "/LIBPATH:C:\\a\\rust\\rust\\build\\x86_64-pc-windows-msvc\\stage1-rustc\\x86_64-pc-windows-msvc\\release\\build\\psm-fbf8fbd57a82bcdd\\out" "/LIBPATH:C:\\Program Files\\Microsoft Visual Studio\\2022\\Enterprise\\VC\\Tools\\MSVC\\14.40.33807\\atlmfc\\lib\\x64" "/LIBPATH:C:\\a\\rust\\rust\\build\\x86_64-pc-windows-msvc\\stage1-rustc\\x86_64-pc-windows-msvc\\release\\build\\rustc_llvm-196fa4f2fa841609\\out" "/LIBPATH:C:\\a\\rust\\rust\\build\\x86_64-pc-windows-msvc\\llvm\\lib" "/OUT:C:\\a\\rust\\rust\\build\\x86_64-pc-windows-msvc\\stage1-rustc\\x86_64-pc-windows-msvc\\release\\deps\\rustc_main-abe621a284360afc.exe" "/OPT:REF,ICF" "/DEBUG" "/PDBALTPATH:%_PDB%" "/MANIFEST:EMBED" "/MANIFESTINPUT:C:\\a\\rust\\rust\\compiler\\rustc\\Windows Manifest.xml" "/WX"
  = note: LINK : fatal error LNK1104: cannot open file 'C:\a\rust\rust\build\x86_64-pc-windows-msvc\stage1-rustc\x86_64-pc-windows-msvc\release\deps\rustc_main-abe621a284360afc.exe'␍

[RUSTC-TIMING] rustc_main test:false 0.626
error: could not compile `rustc-main` (bin "rustc-main") due to 1 previous error
Build completed unsuccessfully in 0:07:49

@bors
Copy link
Contributor

bors commented Aug 12, 2024

💔 Test failed - checks-actions

@bors bors added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Aug 12, 2024
@nikic
Copy link
Contributor

nikic commented Aug 12, 2024

@bors retry

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Aug 12, 2024
@bors
Copy link
Contributor

bors commented Aug 12, 2024

⌛ Testing commit cfadfab with merge e08b80c...

@bors
Copy link
Contributor

bors commented Aug 12, 2024

☀️ Test successful - checks-actions
Approved by: nikic
Pushing e08b80c to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Aug 12, 2024
@bors bors merged commit e08b80c into rust-lang:master Aug 12, 2024
7 checks passed
@rustbot rustbot added this to the 1.82.0 milestone Aug 12, 2024
@andjo403 andjo403 deleted the rangeAttribute branch August 12, 2024 13:13
@rust-timer
Copy link
Collaborator

Finished benchmarking commit (e08b80c): comparison URL.

Overall result: ✅ improvements - no action needed

@rustbot label: -perf-regression

Instruction count

This is a highly reliable metric that was used to determine the overall result at the top of this comment.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
-0.3% [-0.3%, -0.3%] 2
Improvements ✅
(secondary)
-1.7% [-1.7%, -1.7%] 1
All ❌✅ (primary) -0.3% [-0.3%, -0.3%] 2

Max RSS (memory usage)

Results (primary -2.5%, secondary 2.1%)

This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
2.1% [1.2%, 2.8%] 3
Improvements ✅
(primary)
-2.5% [-2.5%, -2.5%] 1
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) -2.5% [-2.5%, -2.5%] 1

Cycles

This benchmark run did not return any relevant results for this metric.

Binary size

Results (secondary 0.0%)

This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
0.0% [0.0%, 0.0%] 1
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-0.0% [-0.0%, -0.0%] 1
All ❌✅ (primary) - - 0

Bootstrap: 753.683s -> 753.452s (-0.03%)
Artifact size: 339.37 MiB -> 341.39 MiB (0.59%)

bors added a commit to rust-lang-ci/rust that referenced this pull request Aug 13, 2024
Stop generating assumes for validity ranges

After rust-lang#128371, we represent validity ranges as parameter / return value attributes, so we no longer need to use assumes.

r? `@ghost`
@jieyouxu
Copy link
Member

The job dist-x86_64-msvc failed! Check out the build log: (web) (plain)
Click to see the possible cause of the failure (guessed by this bot)

error: linking with `link.exe` failed: exit code: 1104
[...]
 = note: LINK : fatal error LNK1104: cannot open file 'C:\a\rust\rust\build\x86_64-pc-windows-msvc\stage1-rustc\x86_64-pc-windows-msvc\release\deps\rustc_main-abe621a284360afc.exe'␍

Pinging back #127883.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
merged-by-bors This PR was explicitly merged by bors. 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.

Implement & use metadata on arguments in LLVM