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

Make TerminatorKind::Call::func Spanned and remove ::fn_span #120114

Closed
wants to merge 2 commits into from

Conversation

Enselic
Copy link
Member

@Enselic Enselic commented Jan 18, 2024

To get structural symmetry between TerminatorKind::Call::func and TerminatorKind::Call::args, make func Spanned, since args already is Spanned. This way we can remove the separate fn_span field.

Doing this was briefly discussed here.

For easier review, this PR is split into two commits. The first commit is the actual change. The second commit just makes the code build again and is very repetitive.

Can someone start a perf run of this change please?

To get structural symmetry between `TerminatorKind::Call::func` and
`TerminatorKind::Call::args`, make `func` `Spanned`, since `args`
already is `Spanned`. This way we can remove the separate `fn_span`
field.

This is a separate commit to make review easy. This commit does not
build. The next commit makes no semantic changes, it only makes the code
compile again.
To make review easier, this commit does not make any semantic changes.
It only makes the previous commit build.
@rustbot
Copy link
Collaborator

rustbot commented Jan 18, 2024

r? @compiler-errors

(rustbot has picked a reviewer for you, use r? to override)

@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 Jan 18, 2024
@rustbot
Copy link
Collaborator

rustbot commented Jan 18, 2024

Some changes occurred to MIR optimizations

cc @rust-lang/wg-mir-opt

Some changes occurred in src/tools/clippy

cc @rust-lang/clippy

Some changes occurred in compiler/rustc_codegen_cranelift

cc @bjorn3

This PR changes MIR

cc @oli-obk, @RalfJung, @JakobDegen, @davidtwco, @celinval, @vakaras

Some changes occurred to the CTFE / Miri engine

cc @rust-lang/miri

@rust-log-analyzer
Copy link
Collaborator

The job x86_64-gnu-llvm-16 failed! Check out the build log: (web) (plain)

Click to see the possible cause of the failure (guessed by this bot)
GITHUB_ACTION=__run_7
GITHUB_ACTIONS=true
GITHUB_ACTION_REF=
GITHUB_ACTION_REPOSITORY=
GITHUB_ACTOR=Enselic
GITHUB_API_URL=https://api.github.com
GITHUB_BASE_REF=master
GITHUB_ENV=/home/runner/work/_temp/_runner_file_commands/set_env_18cab967-290d-4f7c-93e4-7a716d01fee3
GITHUB_EVENT_NAME=pull_request
GITHUB_EVENT_NAME=pull_request
GITHUB_EVENT_PATH=/home/runner/work/_temp/_github_workflow/event.json
GITHUB_GRAPHQL_URL=https://api.github.com/graphql
GITHUB_HEAD_REF=rm-fn_span
GITHUB_JOB=pr
GITHUB_PATH=/home/runner/work/_temp/_runner_file_commands/add_path_18cab967-290d-4f7c-93e4-7a716d01fee3
GITHUB_REF=refs/pull/120114/merge
GITHUB_REF_NAME=120114/merge
GITHUB_REF_PROTECTED=false
---
GITHUB_SERVER_URL=https://github.com
GITHUB_SHA=c3280ab73b7831be4e07d726870cc3c588ba28f7
GITHUB_STATE=/home/runner/work/_temp/_runner_file_commands/save_state_18cab967-290d-4f7c-93e4-7a716d01fee3
GITHUB_STEP_SUMMARY=/home/runner/work/_temp/_runner_file_commands/step_summary_18cab967-290d-4f7c-93e4-7a716d01fee3
GITHUB_TRIGGERING_ACTOR=Enselic
GITHUB_WORKFLOW_REF=rust-lang/rust/.github/workflows/ci.yml@refs/pull/120114/merge
GITHUB_WORKFLOW_SHA=c3280ab73b7831be4e07d726870cc3c588ba28f7
GITHUB_WORKSPACE=/home/runner/work/rust/rust
GOROOT_1_19_X64=/opt/hostedtoolcache/go/1.19.13/x64
---
Built container sha256:9c3c93a371e5aed5c18185b24f130d95d5140dbd72a9b325e7b6b49e521a4faa
Looks like docker image is the same as before, not uploading
https://ci-caches.rust-lang.org/docker/7ebc15c01a233894034d277c8cce4e949f4e7791f66b4727c8fb6e058a0b8171d6152e1441d677cef0653843ceeee469c097b8699b2bb74249e674f6aa1a8813
sha256:9c3c93a371e5aed5c18185b24f130d95d5140dbd72a9b325e7b6b49e521a4faa
Setting extra environment values for docker:  --env ENABLE_GCC_CODEGEN=1 --env GCC_EXEC_PREFIX=/usr/lib/gcc/
[CI_JOB_NAME=x86_64-gnu-llvm-16]
##[group]Clock drift check
  local time: Thu Jan 18 20:16:37 UTC 2024
  network time: Thu, 18 Jan 2024 20:16:37 GMT
  network time: Thu, 18 Jan 2024 20:16:37 GMT
##[endgroup]
sccache: Starting the server...
##[group]Configure the build
configure: processing command line
configure: 
configure: build.configure-args := ['--build=x86_64-unknown-linux-gnu', '--llvm-root=/usr/lib/llvm-16', '--enable-llvm-link-shared', '--set', 'rust.thin-lto-import-instr-limit=10', '--set', 'change-id=99999999', '--enable-verbose-configure', '--enable-sccache', '--disable-manage-submodules', '--enable-locked-deps', '--enable-cargo-native-static', '--set', 'rust.codegen-units-std=1', '--set', 'dist.compression-profile=balanced', '--dist-compression-formats=xz', '--set', 'build.optimized-compiler-builtins', '--disable-dist-src', '--release-channel=nightly', '--enable-debug-assertions', '--enable-overflow-checks', '--enable-llvm-assertions', '--set', 'rust.verify-llvm-ir', '--set', 'rust.codegen-backends=llvm,cranelift,gcc', '--set', 'llvm.static-libstdcpp', '--enable-new-symbol-mangling']
configure: target.x86_64-unknown-linux-gnu.llvm-config := /usr/lib/llvm-16/bin/llvm-config
configure: llvm.link-shared     := True
configure: rust.thin-lto-import-instr-limit := 10
configure: change-id            := 99999999
---
3 note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
4 


The actual run.stderr differed from the expected run.stderr.
Actual run.stderr saved to /checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/intrinsics/const-eval-select-backtrace/const-eval-select-backtrace.run.stderr
error: 1 errors occurred comparing run output.
status: exit status: 101
command: cd "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/intrinsics/const-eval-select-backtrace" && RUST_BACKTRACE="0" RUST_TEST_THREADS="16" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/intrinsics/const-eval-select-backtrace/a"
stdout: none

@compiler-errors
Copy link
Member

@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 Jan 18, 2024
@bors
Copy link
Contributor

bors commented Jan 18, 2024

⌛ Trying commit 9f62d5c with merge 0907f12...

bors added a commit to rust-lang-ci/rust that referenced this pull request Jan 18, 2024
Make `TerminatorKind::Call::func` `Spanned` and remove `::fn_span`

To get structural symmetry between `TerminatorKind::Call::func` and `TerminatorKind::Call::args`, make `func` `Spanned`, since `args` already is `Spanned`. This way we can remove the separate `fn_span` field.

Doing this was briefly discussed [here](rust-lang#116520 (comment)).

For easier review, this PR is split into two commits. The first commit is the actual change. The second commit just makes the code build again and is very repetitive.

Can someone start a perf run of this change please?
@bors
Copy link
Contributor

bors commented Jan 18, 2024

☀️ Try build successful - checks-actions
Build commit: 0907f12 (0907f127a60f30749024c364d64022bc57f3cdf8)

@rust-timer

This comment has been minimized.

@rust-timer
Copy link
Collaborator

Finished benchmarking commit (0907f12): comparison URL.

Overall result: no relevant changes - 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 benchmark run did not return any relevant results for this metric.

Max RSS (memory usage)

Results

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
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-4.5% [-4.5%, -4.5%] 1
All ❌✅ (primary) - - 0

Cycles

Results

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)
8.0% [8.0%, 8.0%] 1
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) - - 0

Binary size

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

Bootstrap: 666.403s -> 665.929s (-0.07%)
Artifact size: 308.34 MiB -> 308.35 MiB (0.01%)

@rustbot rustbot removed the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Jan 19, 2024
func: Operand<'tcx>,
/// The function that’s being called, including the `Span` of the
/// function, without the dot and receiver
/// e.g. `foo(a, b)` in `x.foo(a, b)`
Copy link
Member

@RalfJung RalfJung Jan 19, 2024

Choose a reason for hiding this comment

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

Now that we have separate spans for the arguments, wouldn't it make a lot more sense to make this just the foo? That's what I would expect from a Spanned<Operand> -- that the span only covers that operand.

What this PR does is confusing.

Copy link
Member Author

Choose a reason for hiding this comment

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

Hmm, good point. Since that is not as straightforward, I'll leave that for the future and go ahead and close this.

Thanks for taking a look!

@Enselic Enselic closed this Jan 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
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.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants